cleanup os related documentation links (#20663)

cleanup documentation links
This commit is contained in:
ringabout 2022-10-27 18:16:27 +08:00 • committed by GitHub
commit c341f20476
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 27 deletions

View file

@ -23,8 +23,6 @@ proc createDir*(dir: Path) {.inline, tags: [WriteDirEffect, ReadDirEffect].} =
## See also: ## See also:
## * `removeDir proc`_ ## * `removeDir proc`_
## * `existsOrCreateDir proc`_ ## * `existsOrCreateDir proc`_
## * `copyDir proc`_
## * `copyDirWithPermissions proc`_
## * `moveDir proc`_ ## * `moveDir proc`_
createDir(dir.string) createDir(dir.string)
@ -37,8 +35,6 @@ proc existsOrCreateDir*(dir: Path): bool {.inline, tags: [WriteDirEffect, ReadDi
## See also: ## See also:
## * `removeDir proc`_ ## * `removeDir proc`_
## * `createDir proc`_ ## * `createDir proc`_
## * `copyDir proc`_
## * `copyDirWithPermissions proc`_
## * `moveDir proc`_ ## * `moveDir proc`_
result = existsOrCreateDir(dir.string) result = existsOrCreateDir(dir.string)
@ -51,11 +47,9 @@ proc removeDir*(dir: Path, checkDir = false
## existed in the first place, unless `checkDir` = true. ## existed in the first place, unless `checkDir` = true.
## ##
## See also: ## See also:
## * `removeFile proc`_ ## * `removeFile proc <files.html#removeFile>`_
## * `existsOrCreateDir proc`_ ## * `existsOrCreateDir proc`_
## * `createDir proc`_ ## * `createDir proc`_
## * `copyDir proc`_
## * `copyDirWithPermissions proc`_
## * `moveDir proc`_ ## * `moveDir proc`_
removeDir(dir.string, checkDir) removeDir(dir.string, checkDir)
@ -68,9 +62,7 @@ proc moveDir*(source, dest: Path) {.inline, tags: [ReadIOEffect, WriteIOEffect].
## If this fails, `OSError` is raised. ## If this fails, `OSError` is raised.
## ##
## See also: ## See also:
## * `moveFile proc`_ ## * `moveFile proc <files.html#moveFile>`_
## * `copyDir proc`_
## * `copyDirWithPermissions proc`_
## * `removeDir proc`_ ## * `removeDir proc`_
## * `existsOrCreateDir proc`_ ## * `existsOrCreateDir proc`_
## * `createDir proc`_ ## * `createDir proc`_
@ -127,9 +119,6 @@ iterator walkDirRec*(dir: Path,
## ##
## ##
## See also: ## See also:
## * `walkPattern iterator`_
## * `walkFiles iterator`_
## * `walkDirs iterator`_
## * `walkDir iterator`_ ## * `walkDir iterator`_
for p in walkDirRec(dir.string, yieldFilter, followFilter, relative, for p in walkDirRec(dir.string, yieldFilter, followFilter, relative,
checkDir, onlyRegular): checkDir, onlyRegular):
@ -140,5 +129,5 @@ proc setCurrentDir*(newDir: Path) {.inline, tags: [].} =
## is raised if `newDir` cannot been set. ## is raised if `newDir` cannot been set.
## ##
## See also: ## See also:
## * `getCurrentDir proc`_ ## * `getCurrentDir proc <paths.html#getCurrentDir>`_
osdirs.setCurrentDir(newDir.string) osdirs.setCurrentDir(newDir.string)

View file

@ -19,9 +19,7 @@ proc removeFile*(file: Path) {.inline, tags: [WriteDirEffect].} =
## On Windows, ignores the read-only attribute. ## On Windows, ignores the read-only attribute.
## ##
## See also: ## See also:
## * `removeDir proc`_ ## * `removeDir proc <dirs.html#removeDir>`_
## * `copyFile proc`_
## * `copyFileWithPermissions proc`_
## * `moveFile proc`_ ## * `moveFile proc`_
removeFile(file.string) removeFile(file.string)
@ -38,8 +36,6 @@ proc moveFile*(source, dest: Path) {.inline,
## Can be used to `rename files`:idx:. ## Can be used to `rename files`:idx:.
## ##
## See also: ## See also:
## * `moveDir proc`_ ## * `moveDir proc <dirs.html#moveDir>`_
## * `copyFile proc`_
## * `copyFileWithPermissions proc`_
## * `removeFile proc`_ ## * `removeFile proc`_
moveFile(source.string, dest.string) moveFile(source.string, dest.string)

View file

@ -67,7 +67,7 @@ func splitPath*(path: Path): tuple[head, tail: Path] {.inline.} =
func splitFile*(path: Path): tuple[dir, name: Path, ext: string] {.inline.} = func splitFile*(path: Path): tuple[dir, name: Path, ext: string] {.inline.} =
## Splits a filename into `(dir, name, extension)` tuple. ## Splits a filename into `(dir, name, extension)` tuple.
## ##
## `dir` does not end in DirSep_ unless it's `/`. ## `dir` does not end in DirSep unless it's `/`.
## `extension` includes the leading dot. ## `extension` includes the leading dot.
## ##
## If `path` has no extension, `ext` is the empty string. ## If `path` has no extension, `ext` is the empty string.
@ -91,7 +91,7 @@ func isAbsolute*(path: Path): bool {.inline, raises: [].} =
proc relativePath*(path, base: Path, sep = DirSep): Path {.inline.} = proc relativePath*(path, base: Path, sep = DirSep): Path {.inline.} =
## Converts `path` to a path relative to `base`. ## Converts `path` to a path relative to `base`.
## ##
## The `sep` (default: DirSep_) is used for the path normalizations, ## The `sep` (default: DirSep) is used for the path normalizations,
## this can be useful to ensure the relative path only contains `'/'` ## this can be useful to ensure the relative path only contains `'/'`
## so that it can be used for URL constructions. ## so that it can be used for URL constructions.
## ##
@ -237,10 +237,10 @@ proc getCurrentDir*(): Path {.inline, tags: [].} =
## So the path returned by this proc is determined at run time. ## So the path returned by this proc is determined at run time.
## ##
## See also: ## See also:
## * `getHomeDir proc`_ ## * `getHomeDir proc <appdirs.html#getHomeDir>`_
## * `getConfigDir proc`_ ## * `getConfigDir proc <appdirs.html#getConfigDir>`_
## * `getTempDir proc`_ ## * `getTempDir proc <appdirs.html#getTempDir>`_
## * `setCurrentDir proc`_ ## * `setCurrentDir proc <dirs.html#setCurrentDir>`_
## * `currentSourcePath template <system.html#currentSourcePath.t>`_ ## * `currentSourcePath template <system.html#currentSourcePath.t>`_
## * `getProjectPath proc <macros.html#getProjectPath>`_ ## * `getProjectPath proc <macros.html#getProjectPath>`_
result = Path(ospaths2.getCurrentDir()) result = Path(ospaths2.getCurrentDir())
@ -275,7 +275,7 @@ proc expandTildeImpl(path: string): string {.
proc expandTilde*(path: Path): Path {.inline, proc expandTilde*(path: Path): Path {.inline,
tags: [ReadEnvEffect, ReadIOEffect].} = tags: [ReadEnvEffect, ReadIOEffect].} =
## Expands ``~`` or a path starting with ``~/`` to a full path, replacing ## Expands ``~`` or a path starting with ``~/`` to a full path, replacing
## ``~`` with `getHomeDir()`_ (otherwise returns ``path`` unmodified). ## ``~`` with `getHomeDir() <appdirs.html#getHomeDir>`_ (otherwise returns ``path`` unmodified).
## ##
## Windows: this is still supported despite the Windows platform not having this ## Windows: this is still supported despite the Windows platform not having this
## convention; also, both ``~/`` and ``~\`` are handled. ## convention; also, both ``~/`` and ``~\`` are handled.