Skip to content

Commit

Permalink
docgen: generate docs for modules imported in system.nim, fixes nim-l…
Browse files Browse the repository at this point in the history
  • Loading branch information
narimiran committed Apr 24, 2019
1 parent e233452 commit 5eebc7e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion compiler/docgen2.nim
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ type
TGen = object of PPassContext
doc: PDoc
module: PSym
config: ConfigRef
PGen = ref TGen

template shouldProcess(g): bool =
(g.module.owner.id == g.doc.conf.mainPackageId and optWholeProject in g.doc.conf.globalOptions) or
sfMainModule in g.module.flags
sfMainModule in g.module.flags or g.config.projectMainIdx == g.module.info.fileIndex

template closeImpl(body: untyped) {.dirty.} =
var g = PGen(p)
Expand Down Expand Up @@ -60,6 +61,7 @@ template myOpenImpl(ext: untyped) {.dirty.} =
var g: PGen
new(g)
g.module = module
g.config = graph.config
var d = newDocumentor(AbsoluteFile toFullPath(graph.config, FileIndex module.position),
graph.cache, graph.config, ext)
d.hasToc = true
Expand Down

0 comments on commit 5eebc7e

Please sign in to comment.