sphinx-markdown-builder icon indicating copy to clipboard operation
sphinx-markdown-builder copied to clipboard

Header level adjustment

Open theogravity opened this issue 9 months ago • 1 comments

Is your feature request related to a problem? Please describe.

The generated markdown uses a base of three levels for sub-headers:

# AirtopWindowScreenshot

### *class* airtop_sdk.AirtopWindowScreenshot(screenshot_data: Dict[str, Any])

I'd like to be able to adjust it to be using ## (basically decrease levels by one). So if there is #### then it should be ### instead.

The reason for this is I'm using this with docusaurus and it prefers this level for rendering sidebar TOC.

Describe the solution you'd like

Maybe add an option like markdown_subheader_level (I can't come up with a good name for this) where 3 is the default behavior (### / ####), and 2 is ## / ###.

Describe alternatives you've considered I guess post-parsing the generated markdown to adjust the levels via a script

theogravity avatar Mar 13 '25 22:03 theogravity

Thanks for opening the issue. This is a good suggestion. There is no clear justification for using a hard-coded level for methods/classes or even using headers at all, other than that it looks nice. There are a lot of customizations to be made according to what looks nice in different document environments.

liran-funaro avatar Apr 27 '25 14:04 liran-funaro