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

Merge sections with identical title #300

Closed
krlmlr opened this issue Oct 27, 2014 · 4 comments · Fixed by #312
Closed

Merge sections with identical title #300

krlmlr opened this issue Oct 27, 2014 · 4 comments · Fixed by #312

Comments

@krlmlr
Copy link
Member

krlmlr commented Oct 27, 2014

If two files have entries @section OBTW and @rdname base, the file base.Rd contains two sections titled "OBTW". On the other hand, the "Description" and "Detail" sections are merged. Wouldn't it be a good idea (and feasible) to also merge sections with identical names?

Example package: https://github.com/krlmlr/section.merge.test

Also, the contents are generated in the order of the input file names. In the example above, it's a < b < base, but base.R is the "main" source file for base.Rd. Perhaps the contents that come from the "main" input file (if there is one) should come before the other contents?

krlmlr pushed a commit to krlmlr/LoadMyData that referenced this issue Oct 27, 2014
@hadley
Copy link
Member

hadley commented Dec 9, 2014

Yes, merging sections with identical titles would be good, and I'd be happy to review a pull request.

Merging them in a better order is going to be hard, because it'll involve a topological sort. I'd also be happy to review a (separate) PR for that, if you're game!

@krlmlr
Copy link
Member Author

krlmlr commented Dec 10, 2014

Basic (unordered) functionality is now ready for review.

For @rdname, I think the best order would be first the contents of the "main" item (that defines the .Rd file) followed by all other items in their natural order. Can you think of an example that actually involves a more complicated topological sort?

@hadley
Copy link
Member

hadley commented Dec 12, 2014

I'm going to hold of on merging this for this release, just because I need to get roxygen2 out today, and haven't had a chance to properly review this

@Geoff99
Copy link
Contributor

Geoff99 commented Jun 7, 2015

Not sure if it is exactly what you are looking for in terms of the natural order for the merged sections, but pull request #324, relating to issue #323, would ensure that roxygen2 parses the files in collate (as opposed to alphabetical) order, and hence also generates the documentation in that order.

If not it might at least give a low effort way of specifying the natural order via @include tags.

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.

3 participants