doc2tex: generate docs to Latex (#17997)
* `doc2tex`: generate docs to Latex * address some comments
This commit is contained in:
parent
3c622d7999
commit
97970d9dcc
12 changed files with 171 additions and 161 deletions
|
|
@ -8,22 +8,24 @@ split.item.toc = "20"
|
|||
# after this number of characters
|
||||
|
||||
doc.section = """
|
||||
\chapter{$sectionTitle}\label{$sectionID}
|
||||
\begin{description}
|
||||
\rsthA{$sectionTitle}\label{$sectionID}
|
||||
$content
|
||||
\end{description}
|
||||
"""
|
||||
|
||||
doc.section.toc = ""
|
||||
# $sectionID $sectionTitleID $sectionTitle $content
|
||||
|
||||
doc.item = """
|
||||
\item[\texttt{$header}\label{$itemID}]\mbox{~}\\*
|
||||
|
||||
\phantomsection\addcontentsline{toc}{subsection}{$uniqueName}
|
||||
|
||||
\begin{rstpre}
|
||||
$header
|
||||
\end{rstpre}
|
||||
$desc
|
||||
"""
|
||||
|
||||
doc.item.toc = ""
|
||||
# \item $name\ref{$itemID}
|
||||
|
||||
doc.toc = r"\tableofcontents \newpage"
|
||||
|
||||
|
|
@ -38,6 +40,10 @@ $moduledesc
|
|||
$content
|
||||
"""
|
||||
|
||||
# $1 - number of listing in document, $2 - language (e.g. langNim), $3 - anchor
|
||||
doc.listing_start = "\\begin{rstpre}\n"
|
||||
doc.listing_end = "\n\\end{rstpre}\n"
|
||||
|
||||
doc.file = """
|
||||
% This file was generated by Nim.
|
||||
% Generated: $date $time UTC
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue