sphinx-contrib / confluencebuilder

Confluence Markup Builder Plugin for Sphinx
BSD 2-Clause "Simplified" License
315 stars 99 forks source link

Improve styled configuration references for extension's documentation #1002

Closed jdknight closed 3 months ago

jdknight commented 3 months ago

With reStructuredText/Sphinx, there does not appear to be a way to take advantage of the :ref: role and apply a literal style processing on select elements. This extension's documentation would handle this by first adding a literal description of an element, followed by a reference named "ref" -- not ideal.

This change adds a custom domain/role to support a lref role, the "literal-styled reference" role. For generated references using this role, they will be manipulated/forwarded to Sphinx's standard domain to handle as a normal cross reference. When resolved, the custom domain will then wrap the inner node with a literal node. This allows both having a page-to-page reference that is also styled as a literal.

Updating various links to use this capability. In addition, cleanup other links/literals that can take advantage of this role.