diff options
Diffstat (limited to 'lib/packages/docutils/rstgen.nim')
-rw-r--r-- | lib/packages/docutils/rstgen.nim | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/packages/docutils/rstgen.nim b/lib/packages/docutils/rstgen.nim index 9f707f4e8..c70998edb 100644 --- a/lib/packages/docutils/rstgen.nim +++ b/lib/packages/docutils/rstgen.nim @@ -27,8 +27,7 @@ import strutils, os, hashes, strtabs, rstast, rst, highlite, tables, sequtils, algorithm, parseutils -import "$lib/../compiler/nimpaths" -import "$lib/../compiler/pathutils" + import ../../std/private/since const @@ -58,8 +57,8 @@ type options*: RstParseOptions findFile*: FindFileHandler msgHandler*: MsgHandler - outDir*: AbsoluteDir ## output directory, initialized by docgen.nim - destFile*: AbsoluteFile ## output (HTML) file, initialized by docgen.nim + outDir*: string ## output directory, initialized by docgen.nim + destFile*: string ## output (HTML) file, initialized by docgen.nim filename*: string ## source Nim or Rst file meta*: array[MetaEnum, string] currentSection: string ## \ @@ -84,7 +83,7 @@ type status: int proc prettyLink*(file: string): string = - changeFileExt(file, "").replace(dotdotMangle, "..") + changeFileExt(file, "").replace("_._", "..") proc init(p: var CodeBlockParams) = ## Default initialisation of CodeBlockParams to sane values. @@ -759,13 +758,13 @@ proc renderHeadline(d: PDoc, n: PRstNode, result: var string) = # Generate index entry using spaces to indicate TOC level for the output HTML. assert n.level >= 0 let - htmlFileRelPath = if d.outDir.isEmpty(): + htmlFileRelPath = if d.outDir.len == 0: # /foo/bar/zoo.nim -> zoo.html changeFileExt(extractFilename(d.filename), HtmlExt) else: # d is initialized in docgen.nim # outDir = /foo -\ # destFile = /foo/bar/zoo.html -|-> bar/zoo.html - d.destFile.relativeTo(d.outDir, '/').string + d.destFile.relativePath(d.outDir, '/') setIndexTerm(d, htmlFileRelPath, refname, tmp.stripTocHtml, spaces(max(0, n.level)) & tmp) |