Browse Source

Fixed #28290 -- Enabled Sphinx auto-label generation for title and section headers.

Abhijeet 5 years ago
parent
commit
1a9459b88e
1 changed files with 7 additions and 0 deletions
  1. 7 0
      docs/conf.py

+ 7 - 0
docs/conf.py

@@ -41,8 +41,15 @@ extensions = [
     'sphinx.ext.extlinks',
     "sphinx.ext.intersphinx",
     "sphinx.ext.viewcode",
+    "sphinx.ext.autosectionlabel",
 ]
 
+# AutosectionLabel settings.
+# Uses a <page>:<label> schema which doesn't work for duplicate sub-section
+# labels, so set max depth.
+autosectionlabel_prefix_document = True
+autosectionlabel_maxdepth = 2
+
 # Spelling check needs an additional module that is not installed by default.
 # Add it only if spelling check is requested so docs can be generated without it.
 if 'spelling' in sys.argv: