3

How is it possible to create not only first-level but also second-level headers in function reference page of R package documentation created with pkgdown? Can I do this by modifying the _pkgdown.yml file?

More details:

An example of an R package (as a ZIP file) is here. It contains 3 "hello" and 1 "other" function. I want two <H1> level (first-level) section "Hello" and "Other" and also "Hello" functions should be split into 2 subsections (level <H2>) an in the last print-screen.

The project contains _pkgdown.yml file with these settings that control the appearance of the reference page, and maybe it's possible to tweak this code to get the desired results?:

destination: docs

reference:
# All 3 Hello function should be in a super section A, e.g., level <H1>
  - title: "Hello A functions" # This should be subsection A-1, e.g., level <H2>
    contents:
    - hello-a1
    - hello-a2
  - title: "Hello B functions"  # This should be subsection A-2, e.g., level <H2>
    contents:
    - hello-b1
# This should be in super section B, e.g., level <H1>
  - title: "Other functions"
    contents:
    - other

The output of the reference page looks like this one: enter image description here

The type of output I expect should be similar to:

enter image description here

GegznaV
  • 4,938
  • 4
  • 23
  • 43
  • It's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. – MrFlick Sep 13 '19 at 14:41
  • I updated the question. Is it more clear now @MrFlick? – GegznaV Sep 14 '19 at 10:36

0 Answers0