summary refs log tree commit diff stats
path: root/config
diff options
context:
space:
mode:
authorAndrey Makarov <ph.makarov@gmail.com>2021-10-28 20:20:52 +0300
committerGitHub <noreply@github.com>2021-10-28 19:20:52 +0200
commit7ba2659f733b97db63b7552415ad048e34d4a11a (patch)
tree54eb85f0eabc927c6d15c2d69c45aefd09efa39d /config
parentc80e2c173686bd12904e5487752dc0ce20cb8bcb (diff)
downloadNim-7ba2659f733b97db63b7552415ad048e34d4a11a.tar.gz
docgen: implement doc link resolution in current module (#18642)
Diffstat (limited to 'config')
-rw-r--r--config/nimdoc.cfg11
-rw-r--r--config/nimdoc.tex.cfg10
2 files changed, 20 insertions, 1 deletions
diff --git a/config/nimdoc.cfg b/config/nimdoc.cfg
index 162b2b4a3..c1074f344 100644
--- a/config/nimdoc.cfg
+++ b/config/nimdoc.cfg
@@ -56,6 +56,17 @@ $seeSrc
 </div>
 """
 
+# A wrapper of a few overloaded `doc.item`s with the same basic name
+# * $header_plain - see above
+# * $overloadGroupName - the anchor for this whole group
+# * $content - string containing `doc.item`s themselves
+doc.item2 = """
+
+<div id="$overloadGroupName">
+$content
+</div>
+"""
+
 # Chunk of HTML emitted for each entry in the HTML table of contents.
 # See doc.item for available substitution variables.
 
diff --git a/config/nimdoc.tex.cfg b/config/nimdoc.tex.cfg
index 4aff9b379..d7ab652eb 100644
--- a/config/nimdoc.tex.cfg
+++ b/config/nimdoc.tex.cfg
@@ -19,7 +19,8 @@ doc.section.toc = ""
 doc.item = """
 
 \vspace{1em}
-\phantomsection\addcontentsline{toc}{subsection}{$uniqueName}
+\phantomsection\addcontentsline{toc}{subsubsection}{$uniqueName}
+\label{$itemSymOrID}\hypertarget{$itemSymOrID}{}
 
 \begin{rstdocitem}
 $header
@@ -30,6 +31,13 @@ $desc
 \end{addmargin}
 """
 
+doc.item2 = """
+\phantomsection\addcontentsline{toc}{subsection}{$header_plain}
+\label{$overloadGroupName}\hypertarget{$overloadGroupName}{}
+
+$content
+"""
+
 doc.item.toc = ""
 
 doc.toc = r"\tableofcontents \newpage"