diff --git a/compiler/options.nim b/compiler/options.nim index 35e87ceb40dfd..288764e45a3f8 100644 --- a/compiler/options.nim +++ b/compiler/options.nim @@ -263,9 +263,7 @@ type implicitIncludes*: seq[string] # modules that are to be implicitly included docSeeSrcUrl*: string # if empty, no seeSrc will be generated. \ # The string uses the formatting variables `path` and `line`. - docRoot*: AbsoluteDir - # `nim doc --docRoot:foo --project --outdir:docs foo/sub/main.nim` - # genrates: docs/sub/main.html + docRoot*: AbsoluteDir ## see nim --fullhelp for --docRoot # the used compiler cIncludes*: seq[AbsoluteDir] # directories to search for included files @@ -662,12 +660,13 @@ template patchModule(conf: ConfigRef) {.dirty.} = let ov = conf.moduleOverrides[key] if ov.len > 0: result = AbsoluteFile(ov) -proc isRelativeTo(path: string, base: string): bool= - # PENDING #13212 - let path = path.normalizedPath - let base = base.normalizedPath - let ret = relativePath(path, base) - result = path.len > 0 and not ret.startsWith ".." +when (NimMajor, NimMinor) < (1, 1) or not declared(isRelativeTo): + proc isRelativeTo(path, base: string): bool = + # pending #13212 use os.isRelativeTo + let path = path.normalizedPath + let base = base.normalizedPath + let ret = relativePath(path, base) + result = path.len > 0 and not ret.startsWith ".." proc getRelativePathFromConfigPath*(conf: ConfigRef; f: AbsoluteFile): RelativeFile = let f = $f diff --git a/doc/advopt.txt b/doc/advopt.txt index 9dd59333cd2c5..87de986fd9c7a 100644 --- a/doc/advopt.txt +++ b/doc/advopt.txt @@ -67,6 +67,8 @@ Advanced options: --clib:LIBNAME link an additional C library (you should omit platform-specific extensions) --project document the whole project (doc2) + --docRoot:path nim doc --docRoot:foo --project --outdir:docs foo/sub/main.nim + generates: docs/sub/main.html --docSeeSrcUrl:url activate 'see source' for doc and doc2 commands (see doc.item.seesrc in config/nimdoc.cfg) --docInternal also generate documentation for non-exported symbols