doc2tex: generate docs to Latex (#17997)

* `doc2tex`: generate docs to Latex

* address some comments
This commit is contained in:
Andrey Makarov 2021-05-14 08:30:47 +03:00 • committed by GitHub
commit 97970d9dcc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 171 additions and 161 deletions

View file

@ -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