lsms-worldbank / adodownr

⏬ Create Quarto package documentation website for Stata packages
Other
6 stars 1 forks source link

Build a custom reference index #16

Closed arthur-shaw closed 9 months ago

arthur-shaw commented 10 months ago

The build_reference_index() function currently builds an index page/table that's an alphabetically arranged list of commands present in the package.

While this is definitely much better than nothing, it would be far better if the list could be ordered and/or grouped by the package author.

To help users undertand the scope of the package and find the right commands for the right job, the author might want to organize commands by theme or by function. For example, labeller has commands for variable labels and value labels. It would be good to group them in this way.

For inspiration, see pkgdown's YAML specification for custom index pages. See also a worked example for susoapi: YAML file here; resulting page here.

arthur-shaw commented 10 months ago

@kbjarkefur , beyond providing documentation for the expected format, do you see anything on the Stata that could/should help with this?

Basically, I'm thinking of two modes of building the index page. In the base case, adodownr does what it does not: creates a single table of alphabetically organized commands. If the user provides some custom reference index page specification in the expected place, adodownr will build the index page in a different way--perhaps one heading per group and one table in each heading. The package author will need to specify the groupings and which commands belong to each grouping. The adodownr package will take care of the rest: building the tables, creating the links, forming the Quarto file, etc.