Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beautify comment: Lists #12

Open
SchmidtPaul opened this issue Jun 3, 2022 · 1 comment
Open

Beautify comment: Lists #12

SchmidtPaul opened this issue Jun 3, 2022 · 1 comment

Comments

@SchmidtPaul
Copy link

I am not sure whether it is worthwhile for you to make this work, but for completeness, I should create this issue:

When Compiling Reports in R, you can basically make use of all Markdown features when writing text after #'. One of the more common ones that may also need to be beautified is lists:

Here is the example:

#' Unordered List:
#' 
#' * Item 1
#' * Item 2
#'    + Item 2a
#'    + Item 2b
#'
#' Ordered List:
#' 
#' 1. Item 1
#' 2. Item 2
#' 3. Item 3
#'    + Item 3a
#'    + Item 3b
#' 
#' An example that actually needs line breaks:
#' 
#' 1. Super Mario is a 2D- and 3D-platform game series created by `Nintendo` based on and starring the fictional plumber Mario. 
#' 2. Alternatively called the `Super Mario Bros.` series or simply the Mario series, it is the central series of the greater Mario franchise. 
#' 3. At least one Super Mario game has been released for every major Nintendo video game console. There are over twenty games in the series.
#'    + Super Mario World was released for the Super Nintendo Entertainment System and consists of nine worlds displayed via a world map.
#'    + It is a direct successor to the Super Mario Bros. games, bearing the subtitle Super Mario Bros. 4 in Japan.

image

and this is what beautifyR currently does:

#' Unordered List: * Item 1 * Item 2 + Item 2a + Item 2b Ordered List: 1. Item
#' 1 2. Item 2 3. Item 3 + Item 3a + Item 3b An example that actually needs
#' line breaks: 1. Super Mario is a 2D- and 3D-platform game series created by
#' `Nintendo` based on and starring the fictional plumber Mario. 2.
#' Alternatively called the `Super Mario Bros.` series or simply the Mario
#' series, it is the central series of the greater Mario franchise. 3. At
#' least one Super Mario game has been released for every major Nintendo video
#' game console. There are over twenty games in the series. + Super Mario
#' World was released for the Super Nintendo Entertainment System and consists
#' of nine worlds displayed via a world map. + It is a direct successor to the
#' Super Mario Bros. games, bearing the subtitle Super Mario Bros. 4 in Japan.

image

while this is what it should do:

#' Unordered List:
#' 
#' * Item 1
#' * Item 2
#'    + Item 2a
#'    + Item 2b
#'
#' Ordered List:
#' 
#' 1. Item 1
#' 2. Item 2
#' 3. Item 3
#'    + Item 3a
#'    + Item 3b
#' 
#' An example that actually needs line breaks:
#' 
#' 1. Super Mario is a 2D- and 3D-platform game series created 
#'    by `Nintendo` based on and starring the fictional plumber 
#'    Mario. 
#' 2. Alternatively called the `Super Mario Bros.` series or simply 
#'    the Mario series, it is the central series of the greater 
#'    Mario franchise. 
#' 3. At least one Super Mario game has been released for every 
#'    major Nintendo video game console. There are over twenty 
#'    games in the series.
#'    + Super Mario World was released for the Super Nintendo 
#'      Entertainment System and consists of nine worlds displayed 
#'      via a world map.
#'    + It is a direct successor to the Super Mario Bros. games, 
#'      bearing the subtitle Super Mario Bros. 4 in Japan.

But again - feel free to close this issue if this goes beyond what you have in mind for what {beautifyR} is supposed to do.

@mwip
Copy link
Owner

mwip commented Jun 3, 2022

Super interesting, indeed. Though, I think this needs some serious work. Currently, I am not able to do this, as I am focusing on finishing my PhD. After that, I will hopefully have more time to work on this. I'll leave this issue open, in case anyone is willing to contribute a PR. I hope you understand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants