diff options
author | Araq <rumpf_a@web.de> | 2014-07-15 09:30:58 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2014-07-15 09:30:58 +0200 |
commit | 0743f78012e954f5295df7923ccabd472a5a7502 (patch) | |
tree | 5d681c9835f01019e8ae83e14c0cd49d1a6c0d38 /compiler/docgen.nim | |
parent | 7fa399f51c39e6661876223009d5003cd2e0cf99 (diff) | |
parent | 18ded6c23d72cd21fa0aa10ff61dc6f9af40832c (diff) | |
download | Nim-0743f78012e954f5295df7923ccabd472a5a7502.tar.gz |
Merge branch 'master' of https://github.com/Araq/Nimrod
Diffstat (limited to 'compiler/docgen.nim')
-rw-r--r-- | compiler/docgen.nim | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/compiler/docgen.nim b/compiler/docgen.nim index 6948c4979..4c9803401 100644 --- a/compiler/docgen.nim +++ b/compiler/docgen.nim @@ -541,8 +541,14 @@ proc genOutFile(d: PDoc): PRope = if toc != nil: toc = ropeFormatNamedVars(getConfigVar("doc.toc"), ["content"], [toc]) for i in countup(low(TSymKind), high(TSymKind)): app(code, d.section[i]) - if d.meta[metaTitle].len != 0: title = d.meta[metaTitle] - else: title = "Module " & extractFilename(changeFileExt(d.filename, "")) + + # Extract the title. Non API modules generate an entry in the index table. + if d.meta[metaTitle].len != 0: + title = d.meta[metaTitle] + setIndexTerm(d[], "", title) + else: + # Modules get an automatic title for the HTML, but no entry in the index. + title = "Module " & extractFilename(changeFileExt(d.filename, "")) let bodyname = if d.hasToc: "doc.body_toc" else: "doc.body_no_toc" content = ropeFormatNamedVars(getConfigVar(bodyname), ["title", |