diff options
author | Timothee Cour <timothee.cour2@gmail.com> | 2018-07-30 05:02:18 -0700 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-07-30 14:02:18 +0200 |
commit | c0f78ec0121c2578759e1b7cff561b75a58e3f97 (patch) | |
tree | 9a69bae15f82ac51b6794950407176f220e7a745 /compiler | |
parent | f2ddd995393bc485880d3e56b277bad6448ad0c3 (diff) | |
download | Nim-c0f78ec0121c2578759e1b7cff561b75a58e3f97.tar.gz |
fixes #8419 fixes #8420 ; workaround #6071 workaround nim-lang/website#98 (#8423)
add --git.devel option to override doc generated "edit" links; add --nimCompiler option to nimweb
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/docgen.nim | 9 | ||||
-rw-r--r-- | compiler/options.nim | 4 |
2 files changed, 6 insertions, 7 deletions
diff --git a/compiler/docgen.nim b/compiler/docgen.nim index 75b599ae9..63883af5c 100644 --- a/compiler/docgen.nim +++ b/compiler/docgen.nim @@ -517,12 +517,11 @@ proc genItem(d: PDoc, n, nameNode: PNode, k: TSymKind) = path = path[cwd.len+1 .. ^1].replace('\\', '/') let gitUrl = getConfigVar(d.conf, "git.url") if gitUrl.len > 0: - var commit = getConfigVar(d.conf, "git.commit") - if commit.len == 0: commit = "master" + let commit = getConfigVar(d.conf, "git.commit", "master") + let develBranch = getConfigVar(d.conf, "git.devel", "devel") dispA(d.conf, seeSrcRope, "$1", "", [ropeFormatNamedVars(d.conf, docItemSeeSrc, - ["path", "line", "url", "commit"], [rope path, - rope($n.info.line), rope gitUrl, - rope commit])]) + ["path", "line", "url", "commit", "devel"], [rope path, + rope($n.info.line), rope gitUrl, rope commit, rope develBranch])]) add(d.section[k], ropeFormatNamedVars(d.conf, getConfigVar(d.conf, "doc.item"), ["name", "header", "desc", "itemID", "header_plain", "itemSym", diff --git a/compiler/options.nim b/compiler/options.nim index 7cca40321..fcbb98fe6 100644 --- a/compiler/options.nim +++ b/compiler/options.nim @@ -406,8 +406,8 @@ proc mainCommandArg*(conf: ConfigRef): string = proc existsConfigVar*(conf: ConfigRef; key: string): bool = result = hasKey(conf.configVars, key) -proc getConfigVar*(conf: ConfigRef; key: string): string = - result = conf.configVars.getOrDefault key +proc getConfigVar*(conf: ConfigRef; key: string, default = ""): string = + result = conf.configVars.getOrDefault(key, default) proc setConfigVar*(conf: ConfigRef; key, val: string) = conf.configVars[key] = val |