Skip to content

Beautify comment: Lists #12

Description

@SchmidtPaul

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions