Added --docInternal option to allow 'nim doc' to include non-exported symbols
This commit is contained in:
parent
2655f242a8
commit
7fcf51248b
4 changed files with 8 additions and 1 deletions
|
|
@ -746,6 +746,8 @@ proc processSwitch*(switch, arg: string, pass: TCmdLinePass, info: TLineInfo;
|
||||||
else:
|
else:
|
||||||
conf.cppCustomNamespace = "Nim"
|
conf.cppCustomNamespace = "Nim"
|
||||||
defineSymbol(conf.symbols, "cppCompileToNamespace", conf.cppCustomNamespace)
|
defineSymbol(conf.symbols, "cppCompileToNamespace", conf.cppCustomNamespace)
|
||||||
|
of "docinternal":
|
||||||
|
processOnOffSwitchG(conf, {optDocInternal}, arg, pass, info)
|
||||||
else:
|
else:
|
||||||
if strutils.find(switch, '.') >= 0: options.setConfigVar(conf, switch, arg)
|
if strutils.find(switch, '.') >= 0: options.setConfigVar(conf, switch, arg)
|
||||||
else: invalidCmdLineOption(conf, pass, switch, info)
|
else: invalidCmdLineOption(conf, pass, switch, info)
|
||||||
|
|
|
||||||
|
|
@ -464,7 +464,10 @@ proc isVisible(d: PDoc; n: PNode): bool =
|
||||||
# we cannot generate code for forwarded symbols here as we have no
|
# we cannot generate code for forwarded symbols here as we have no
|
||||||
# exception tracking information here. Instead we copy over the comment
|
# exception tracking information here. Instead we copy over the comment
|
||||||
# from the proc header.
|
# from the proc header.
|
||||||
result = {sfExported, sfFromGeneric, sfForward}*n.sym.flags == {sfExported}
|
if optDocInternal in d.conf.globalOptions:
|
||||||
|
result = {sfFromGeneric, sfForward}*n.sym.flags == {}
|
||||||
|
else:
|
||||||
|
result = {sfExported, sfFromGeneric, sfForward}*n.sym.flags == {sfExported}
|
||||||
if result and containsOrIncl(d.emitted, n.sym.id):
|
if result and containsOrIncl(d.emitted, n.sym.id):
|
||||||
result = false
|
result = false
|
||||||
elif n.kind == nkPragmaExpr:
|
elif n.kind == nkPragmaExpr:
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,7 @@ type # please make sure we have under 32 options
|
||||||
optExcessiveStackTrace # fully qualified module filenames
|
optExcessiveStackTrace # fully qualified module filenames
|
||||||
optShowAllMismatches # show all overloading resolution candidates
|
optShowAllMismatches # show all overloading resolution candidates
|
||||||
optWholeProject # for 'doc2': output any dependency
|
optWholeProject # for 'doc2': output any dependency
|
||||||
|
optDocInternal # generate documentation for non-exported symbols
|
||||||
optMixedMode # true if some module triggered C++ codegen
|
optMixedMode # true if some module triggered C++ codegen
|
||||||
optListFullPaths # use full paths in toMsgFilename, toFilename
|
optListFullPaths # use full paths in toMsgFilename, toFilename
|
||||||
optNoNimblePath
|
optNoNimblePath
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,7 @@ Advanced options:
|
||||||
--project document the whole project (doc2)
|
--project document the whole project (doc2)
|
||||||
--docSeeSrcUrl:url activate 'see source' for doc and doc2 commands
|
--docSeeSrcUrl:url activate 'see source' for doc and doc2 commands
|
||||||
(see doc.item.seesrc in config/nimdoc.cfg)
|
(see doc.item.seesrc in config/nimdoc.cfg)
|
||||||
|
--docInternal also generate documentation for non-exported symbols
|
||||||
--lineDir:on|off generation of #line directive on|off
|
--lineDir:on|off generation of #line directive on|off
|
||||||
--embedsrc:on|off embeds the original source code as comments
|
--embedsrc:on|off embeds the original source code as comments
|
||||||
in the generated output
|
in the generated output
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue