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

Sections and subsections support #32

Closed
maksymiuks opened this issue Sep 14, 2023 · 0 comments · Fixed by #33
Closed

Sections and subsections support #32

maksymiuks opened this issue Sep 14, 2023 · 0 comments · Fixed by #33
Assignees

Comments

@maksymiuks
Copy link
Collaborator

Apparently NEWS files could also be provided to the package as .Rd files (see ?utils::news). This forces us to consider another class of tags, which are section and subsection that could be nested. It means we can no longer hard code level in with_md_title to be 2L as this will depend on depth we are currently on

rd2markdown/R/rd2markdown.R

Lines 160 to 165 in b448cb8

rd2markdown.description <- function(x, fragments = c(), ..., title = NULL) {
out <- map_rd2markdown(x, ..., collapse = "")
out <- gsub("\n{1,}$", "", out)
out <- gsub("\n*\\\\lifecycle\\{(.*)\\}\n*", "\n\nLifecycle: *\\1*\n\n", out)
with_md_title(out, title, 2L, ...)
}

Each section tag should increment the level of all tags nested in it while keeping its own level. I'll try to prepare a draft for this change and how I see it.

@maksymiuks maksymiuks self-assigned this Sep 14, 2023
@maksymiuks maksymiuks linked a pull request Sep 18, 2023 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant