Do not generate Source/Edit without git in config
This commit is contained in:
parent
6b38b37b4f
commit
606aab9cdf
1 changed files with 8 additions and 6 deletions
|
|
@ -462,12 +462,14 @@ proc genItem(d: PDoc, n, nameNode: PNode, k: TSymKind) =
|
||||||
var path = n.info.toFullPath
|
var path = n.info.toFullPath
|
||||||
if path.startsWith(cwd):
|
if path.startsWith(cwd):
|
||||||
path = path[cwd.len+1 .. ^1].replace('\\', '/')
|
path = path[cwd.len+1 .. ^1].replace('\\', '/')
|
||||||
var commit = getConfigVar("git.commit")
|
let gitUrl = getConfigVar("git.url")
|
||||||
if commit.len == 0: commit = "master"
|
if gitUrl.len > 0:
|
||||||
dispA(seeSrcRope, "$1", "", [ropeFormatNamedVars(docItemSeeSrc,
|
var commit = getConfigVar("git.commit")
|
||||||
["path", "line", "url", "commit"], [rope path,
|
if commit.len == 0: commit = "master"
|
||||||
rope($n.info.line), rope getConfigVar("git.url"),
|
dispA(seeSrcRope, "$1", "", [ropeFormatNamedVars(docItemSeeSrc,
|
||||||
rope commit])])
|
["path", "line", "url", "commit"], [rope path,
|
||||||
|
rope($n.info.line), rope gitUrl,
|
||||||
|
rope commit])])
|
||||||
|
|
||||||
add(d.section[k], ropeFormatNamedVars(getConfigVar("doc.item"),
|
add(d.section[k], ropeFormatNamedVars(getConfigVar("doc.item"),
|
||||||
["name", "header", "desc", "itemID", "header_plain", "itemSym",
|
["name", "header", "desc", "itemID", "header_plain", "itemSym",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue