Skip to content

Commit 5997617

Browse files
committed
docs: use sphinx-syntax over sphinx-a4doc
1 parent 872018f commit 5997617

File tree

4 files changed

+16
-14
lines changed

4 files changed

+16
-14
lines changed

docs/_static/css/custom-dark.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,6 @@
590590
stroke: white;
591591
}
592592

593-
:root[style*=dark] .a4 .sig-name {
593+
:root[style*=dark] .sig-name {
594594
background-color: transparent !important;
595595
}

docs/conf.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,15 @@ def get_github_username_repo(url):
9292
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
9393
# ones.
9494
extensions = [
95-
'sphinx_a4doc',
95+
'sphinx_syntax',
9696
'html_extra_template_renderer',
9797
'remix_code_links',
9898
'sphinx.ext.imgconverter',
9999
]
100100

101-
a4_base_path = os.path.dirname(__file__) + '/grammar'
101+
syntax_base_path = 'grammar'
102+
# generate link anchors compatible with Sphinx-A4Doc’s naming
103+
syntax_a4doc_compat_links = True
102104

103105
# Add any paths that contain templates here, relative to this directory.
104106
templates_path = ['_templates']
@@ -182,7 +184,8 @@ def get_github_username_repo(url):
182184
# documentation.
183185
html_theme_options = {
184186
'logo_only': True,
185-
'display_version': True,
187+
'version_selector': True,
188+
'language_selector': True,
186189
}
187190

188191
# Add any paths that contain custom themes here, relative to this directory.

docs/grammar.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
Language Grammar
33
****************
44

5-
.. a4:autogrammar:: SolidityParser
6-
:only-reachable-from: SolidityParser.sourceUnit
5+
.. syntax:autogrammar:: SolidityParser.g4
6+
:root-rule: SolidityParser.sourceUnit
77
:undocumented:
88
:cc-to-dash:
99

10-
.. a4:autogrammar:: SolidityLexer
11-
:only-reachable-from: SolidityParser.sourceUnit
10+
.. syntax:autogrammar:: SolidityLexer.g4
11+
:root-rule: SolidityParser.sourceUnit
1212
:fragments:
1313
:cc-to-dash:

docs/requirements.txt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
# which could result in it being installed anyway and the style (especially bullet points) being broken.
33
# See https://github.com/readthedocs/sphinx_rtd_theme/issues/1115
44
# theme >=3.0.0 removes the display_version option in favor of version_selector and language_selector
5-
sphinx_rtd_theme>=0.5.2, <3.0.0
5+
# Use rtd theme version that supports sphinx>=8.0
6+
sphinx_rtd_theme>=3.0.0
67

78
pygments-lexer-solidity>=0.7.0
8-
sphinx-a4doc>=1.6.0; python_version < '3.13'
9-
# todo remove this once there is a version > 1.6.0
10-
sphinx-a4doc @ git+https://github.com/taminomara/sphinx-a4doc@f63d3b2; python_version >= '3.13'
9+
sphinx-syntax>=1.0.1
1110

12-
# Sphinx 2.1.0 is the oldest version that accepts a lexer class in add_lexer()
13-
sphinx>=2.1.0, <9.0
11+
# Sphinx version constraints for sphinx-syntax compatibility
12+
sphinx>=8.0.0, <9.0.0

0 commit comments

Comments
 (0)