Fix word wrapping

This commit is contained in:
Jjp137 2019-10-17 20:13:04 -07:00
commit 3ad48069d3
18 changed files with 146 additions and 125 deletions

View file

@ -154,7 +154,8 @@ proc writeIndexFile*(g: var RstGenerator, outfile: string) =
## Writes the current index buffer to the specified output file.
##
## You previously need to add entries to the index with the `setIndexTerm()
## <#setIndexTerm,RstGenerator,string,string,string,string,string>`_ proc. If the index is empty the file won't be created.
## <#setIndexTerm,RstGenerator,string,string,string,string,string>`_ proc.
## If the index is empty the file won't be created.
if g.theIndex.len > 0: writeFile(outfile, g.theIndex)
proc addXmlChar(dest: var string, c: char) =
@ -318,8 +319,9 @@ proc setIndexTerm*(d: var RstGenerator, htmlFile, id, term: string,
## columns with their contents will be added.
##
## The index won't be written to disk unless you call `writeIndexFile()
## <#writeIndexFile,RstGenerator,string>`_. The purpose of the index is documented in the `docgen
## tools guide <docgen.html#related-options-index-switch>`_.
## <#writeIndexFile,RstGenerator,string>`_. The purpose of the index is
## documented in the `docgen tools guide
## <docgen.html#related-options-index-switch>`_.
var
entry = term
isTitle = false
@ -472,8 +474,8 @@ proc generateSymbolIndex(symbols: seq[IndexEntry]): string =
proc isDocumentationTitle(hyperlink: string): bool =
## Returns true if the hyperlink is actually a documentation title.
##
## Documentation titles lack the hash. See `mergeIndexes() <#mergeIndexes,string>`_
## for a more detailed explanation.
## Documentation titles lack the hash. See `mergeIndexes()
## <#mergeIndexes,string>`_ for a more detailed explanation.
result = hyperlink.find('#') < 0
proc stripTocLevel(s: string): tuple[level: int, text: string] =
@ -650,8 +652,10 @@ proc mergeIndexes*(dir: string): string =
## This proc will first scan `dir` for index files with the ``.idx``
## extension previously created by commands like ``nim doc|rst2html``
## which use the ``--index:on`` switch. These index files are the result of
## calls to `setIndexTerm() <#setIndexTerm,RstGenerator,string,string,string,string,string>`_ and `writeIndexFile()
## <#writeIndexFile,RstGenerator,string>`_, so they are simple tab separated files.
## calls to `setIndexTerm()
## <#setIndexTerm,RstGenerator,string,string,string,string,string>`_
## and `writeIndexFile() <#writeIndexFile,RstGenerator,string>`_, so they are
## simple tab separated files.
##
## As convention this proc will split index files into two categories:
## documentation and API. API indices will be all joined together into a