@@ -1009,6 +1009,9 @@ proc genSection(d: PDoc, kind: TSymKind) =
1009
1009
" sectionid" , " sectionTitle" , " sectionTitleID" , " content" ], [
1010
1010
ord(kind).rope, title, rope(ord(kind) + 50 ), d.toc[kind]])
1011
1011
1012
+ proc cssHref(outDir: AbsoluteDir, destFile: AbsoluteFile): Rope =
1013
+ rope($ relativeTo(outDir / RelativeFile" nimdoc.out.css" , destFile.splitFile().dir, '/' ))
1014
+
1012
1015
proc genOutFile(d: PDoc): Rope =
1013
1016
var
1014
1017
code, content: Rope
@@ -1042,12 +1045,11 @@ proc genOutFile(d: PDoc): Rope =
1042
1045
rope(getClockStr()), code, d.modDeprecationMsg])
1043
1046
if optCompileOnly notin d.conf.globalOptions:
1044
1047
# XXX what is this hack doing here? 'optCompileOnly' means raw output!?
1045
- code = ropeFormatNamedVars(d.conf, getConfigVar(d.conf, " doc.file" ), [" title " ,
1046
- " tableofcontents" , " moduledesc" , " date" , " time" ,
1048
+ code = ropeFormatNamedVars(d.conf, getConfigVar(d.conf, " doc.file" ), [
1049
+ " nimdoccss " , " title " , " tableofcontents" , " moduledesc" , " date" , " time" ,
1047
1050
" content" , " author" , " version" , " analytics" , " deprecationMsg" ],
1048
- [title.rope, toc, d.modDesc, rope(getDateStr()),
1049
- rope(getClockStr()), content, d.meta[metaAuthor].rope,
1050
- d.meta[metaVersion].rope, d.analytics.rope, d.modDeprecationMsg])
1051
+ [cssHref(d.conf.outDir, d.destFile), title.rope, toc, d.modDesc, rope(getDateStr()), rope(getClockStr()),
1052
+ content, d.meta[metaAuthor].rope, d.meta[metaVersion].rope, d.analytics.rope, d.modDeprecationMsg])
1051
1053
else :
1052
1054
code = content
1053
1055
result = code
@@ -1183,15 +1185,17 @@ proc commandTags*(cache: IdentCache, conf: ConfigRef) =
1183
1185
proc commandBuildIndex* (cache: IdentCache, conf: ConfigRef) =
1184
1186
var content = mergeIndexes(conf.projectFull.string ).rope
1185
1187
1186
- let code = ropeFormatNamedVars(conf, getConfigVar(conf, " doc.file" ), [" title" ,
1187
- " tableofcontents" , " moduledesc" , " date" , " time" ,
1188
- " content" , " author" , " version" , " analytics" ],
1189
- [" Index" .rope, nil , nil , rope(getDateStr()),
1190
- rope(getClockStr()), content, nil , nil , nil ])
1191
- # no analytics because context is not available
1192
1188
var outFile = RelativeFile" theindex"
1193
1189
if conf.outFile != RelativeFile" " :
1194
1190
outFile = conf.outFile
1195
1191
let filename = getOutFile(conf, outFile, HtmlExt)
1192
+
1193
+ let code = ropeFormatNamedVars(conf, getConfigVar(conf, " doc.file" ), [
1194
+ " nimdoccss" , " title" , " tableofcontents" , " moduledesc" , " date" , " time" ,
1195
+ " content" , " author" , " version" , " analytics" ],
1196
+ [cssHref(conf.outDir, filename), rope" Index" , nil , nil , rope(getDateStr()),
1197
+ rope(getClockStr()), content, nil , nil , nil ])
1198
+ # no analytics because context is not available
1199
+
1196
1200
if not writeRope(code, filename):
1197
1201
rawMessage(conf, errCannotOpenFile, filename.string )
0 commit comments