Skip to content

Commit

Permalink
Only include ref links to index in multi-page html (#1388)
Browse files Browse the repository at this point in the history
This allows us to drop some manual links removal in mathjax2katex.py.
  • Loading branch information
ngzhian committed Nov 2, 2021
1 parent 932fbf8 commit 3ae76b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
6 changes: 5 additions & 1 deletion document/core/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ WebAssembly Specification
appendix/index-instructions
appendix/index-rules

.. only:: html
..
Only include these links when using (multi-page) html builder.
(The singlepage html builder is called builder_singlehtml.)
.. only:: builder_html

* :ref:`index-type`
* :ref:`index-instr`
Expand Down
13 changes: 0 additions & 13 deletions document/core/util/mathjax2katex.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,19 +160,6 @@ def ExtractMath(match):
data = data.replace(
'<li class="nav-item nav-item-0"><a href="index.html#document-index">'
'WebAssembly 1.0</a> »', '')
# Drop Index links.
data = data.replace(
'<li><a class="reference internal" href="index.html#index-type">'
'<span class="std std-ref">Index of Types</span></a>', '')
data = data.replace(
'<li><a class="reference internal" href="index.html#index-instr">'
'<span class="std std-ref">Index of Instructions</span></a>', '')
data = data.replace(
'<li><a class="reference internal" href="index.html#index-rules">'
'<span class="std std-ref">Index of Semantic Rules</span></a>', '')
data = data.replace(
'<li><a class="reference internal" href="genindex.html">'
'<span class="std std-ref">Index</span></a>', '')
# Drop sphinx css.
data = data.replace(
'<link href="_static/classic.css" rel="stylesheet" type="text/css">', '')
Expand Down

0 comments on commit 3ae76b1

Please sign in to comment.