Skip to content

Commit

Permalink
Fix broken links in docs (nim-lang#16336)
Browse files Browse the repository at this point in the history
* Fix broken links in docs

* Fix rand HSlice links
  • Loading branch information
elliotwaite authored and mildred committed Jan 11, 2021
1 parent 1a8bbb9 commit e350558
Show file tree
Hide file tree
Showing 21 changed files with 126 additions and 120 deletions.
2 changes: 1 addition & 1 deletion doc/docgen.rst
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ symbols in the `system module <system.html>`_.
* ``proc len[T](x: seq[T]): int {.magic: "LengthSeq", noSideEffect.}`` **=>**
`#len,seq[T] <system.html#len,seq[T]>`_
* ``iterator pairs[T](a: seq[T]): tuple[key: int, val: T] {.inline.}`` **=>**
`#pairs.i,seq[T] <system.html#pairs.i,seq[T]>`_
`#pairs.i,seq[T] <iterators.html#pairs.i,seq[T]>`_
* ``template newException[](exceptn: typedesc; message: string;
parentException: ref Exception = nil): untyped`` **=>**
`#newException.t,typedesc,string,ref.Exception
Expand Down
4 changes: 2 additions & 2 deletions doc/manual.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1778,7 +1778,7 @@ dereferencing operations for reference types:
Automatic dereferencing can be performed for the first argument of a routine
call, but this is an experimental feature and is described `here
<manual_experimental.html#type-bound-operations>`_.
<manual_experimental.html#automatic-dereferencing>`_.

In order to simplify structural type checking, recursive tuples are not valid:

Expand Down Expand Up @@ -3653,7 +3653,7 @@ Creating closures in loops
Since closures capture local variables by reference it is often not wanted
behavior inside loop bodies. See `closureScope
<system.html#closureScope.t,untyped>`_ and `capture
<sugar.html#capture.m,openArray[typed],untyped>`_ for details on how to change this behavior.
<sugar.html#capture.m,varargs[typed],untyped>`_ for details on how to change this behavior.

Anonymous Procs
---------------
Expand Down
4 changes: 2 additions & 2 deletions doc/tut1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1315,11 +1315,11 @@ Sequence variables are initialized with ``@[]``.
The ``for`` statement can be used with one or two variables when used with a
sequence. When you use the one variable form, the variable will hold the value
provided by the sequence. The ``for`` statement is looping over the results
from the `items() <system.html#items.i,seq[T]>`_ iterator from the `system
from the `items() <iterators.html#items.i,seq[T]>`_ iterator from the `system
<system.html>`_ module. But if you use the two-variable form, the first
variable will hold the index position and the second variable will hold the
value. Here the ``for`` statement is looping over the results from the
`pairs() <system.html#pairs.i,seq[T]>`_ iterator from the `system
`pairs() <iterators.html#pairs.i,seq[T]>`_ iterator from the `system
<system.html>`_ module. Examples:

.. code-block:: nim
Expand Down
2 changes: 1 addition & 1 deletion lib/js/dom.nim
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ type
timing*: PerformanceTiming

Range* {.importc.} = ref object
## see `docs{https://developer.mozilla.org/en-US/docs/Web/API/Range}`_
## see `docs<https://developer.mozilla.org/en-US/docs/Web/API/Range>`_
collapsed*: bool
commonAncestorContainer*: Node
endContainer*: Node
Expand Down
2 changes: 1 addition & 1 deletion lib/pure/asyncdispatch.nim
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ template implementSetInheritable() {.dirty.} =
## Returns ``true`` on success.
##
## This procedure is not guaranteed to be available for all platforms.
## Test for availability with `declared()`_.
## Test for availability with `declared() <system.html#declared,untyped>`_.
fd.FileHandle.setInheritable(inheritable)

when defined(windows) or defined(nimdoc):
Expand Down
20 changes: 10 additions & 10 deletions lib/pure/collections/sets.nim
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ type
HashSet*[A] {.myShallow.} = object ## \
## A generic hash set.
##
## Use `init proc <#init,HashSet[A],int>`_ or `initHashSet proc <#initHashSet,int>`_
## Use `init proc <#init,HashSet[A]>`_ or `initHashSet proc <#initHashSet,int>`_
## before calling other procs on it.
data: KeyValuePairSeq[A]
counter: int
Expand All @@ -76,8 +76,8 @@ type
OrderedSet*[A] {.myShallow.} = object ## \
## A generic hash set that remembers insertion order.
##
## Use `init proc <#init,OrderedSet[A],int>`_ or `initOrderedSet proc
## <#initOrderedSet,int>`_ before calling other procs on it.
## Use `init proc <#init,OrderedSet[A]>`_ or `initOrderedSet proc
## <#initOrderedSet>`_ before calling other procs on it.
data: OrderedKeyValuePairSeq[A]
counter, first, last: int
SomeSet*[A] = HashSet[A] | OrderedSet[A]
Expand All @@ -104,7 +104,7 @@ proc init*[A](s: var HashSet[A], initialSize = defaultInitialSize) =
## existing values and calling `excl() <#excl,HashSet[A],A>`_ on them.
##
## See also:
## * `initHashSet proc <#initHashSet,int>`_
## * `initHashSet proc <#initHashSet>`_
## * `toHashSet proc <#toHashSet,openArray[A]>`_
runnableExamples:
var a: HashSet[int]
Expand All @@ -113,7 +113,7 @@ proc init*[A](s: var HashSet[A], initialSize = defaultInitialSize) =
initImpl(s, initialSize)

proc initHashSet*[A](initialSize = defaultInitialSize): HashSet[A] =
## Wrapper around `init proc <#init,HashSet[A],int>`_ for initialization of
## Wrapper around `init proc <#init,HashSet[A]>`_ for initialization of
## hash sets.
##
## Returns an empty hash set you can assign directly in ``var`` blocks in a
Expand Down Expand Up @@ -209,7 +209,7 @@ proc toHashSet*[A](keys: openArray[A]): HashSet[A] =
## Duplicates are removed.
##
## See also:
## * `initHashSet proc <#initHashSet,int>`_
## * `initHashSet proc <#initHashSet>`_
runnableExamples:
let
a = toHashSet([5, 3, 2])
Expand Down Expand Up @@ -601,7 +601,7 @@ proc toSet*[A](keys: openArray[A]): HashSet[A] {.deprecated:
proc isValid*[A](s: HashSet[A]): bool {.deprecated:
"Deprecated since v0.20; sets are initialized by default".} =
## Returns `true` if the set has been initialized (with `initHashSet proc
## <#initHashSet,int>`_ or `init proc <#init,HashSet[A],int>`_).
## <#initHashSet>`_ or `init proc <#init,HashSet[A]>`_).
##
## **Examples:**
##
Expand Down Expand Up @@ -640,7 +640,7 @@ proc init*[A](s: var OrderedSet[A], initialSize = defaultInitialSize) =
## existing values and calling `excl() <#excl,HashSet[A],A>`_ on them.
##
## See also:
## * `initOrderedSet proc <#initOrderedSet,int>`_
## * `initOrderedSet proc <#initOrderedSet>`_
## * `toOrderedSet proc <#toOrderedSet,openArray[A]>`_
runnableExamples:
var a: OrderedSet[int]
Expand All @@ -649,7 +649,7 @@ proc init*[A](s: var OrderedSet[A], initialSize = defaultInitialSize) =
initImpl(s, initialSize)

proc initOrderedSet*[A](initialSize = defaultInitialSize): OrderedSet[A] =
## Wrapper around `init proc <#init,OrderedSet[A],int>`_ for initialization of
## Wrapper around `init proc <#init,OrderedSet[A]>`_ for initialization of
## ordered hash sets.
##
## Returns an empty ordered hash set you can assign directly in ``var`` blocks
Expand All @@ -674,7 +674,7 @@ proc toOrderedSet*[A](keys: openArray[A]): OrderedSet[A] =
## Duplicates are removed.
##
## See also:
## * `initOrderedSet proc <#initOrderedSet,int>`_
## * `initOrderedSet proc <#initOrderedSet>`_
runnableExamples:
let
a = toOrderedSet([5, 3, 2])
Expand Down
54 changes: 27 additions & 27 deletions lib/pure/collections/tables.nim
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
##
## The same could have been achieved by manually iterating over a container
## and increasing each key's value with `inc proc
## <#inc,CountTable[A],A,Positive>`_:
## <#inc,CountTable[A],A,int>`_:
##
## .. code-block::
## import tables
Expand Down Expand Up @@ -230,13 +230,13 @@ type
## `data` and `counter` are internal implementation details which
## can't be accessed.
##
## For creating an empty Table, use `initTable proc<#initTable,int>`_.
## For creating an empty Table, use `initTable proc<#initTable>`_.
data: KeyValuePairSeq[A, B]
counter: int
TableRef*[A, B] = ref Table[A, B] ## Ref version of `Table<#Table>`_.
##
## For creating a new empty TableRef, use `newTable proc
## <#newTable,int>`_.
## <#newTable>`_.

const
defaultInitialSize* = 32
Expand Down Expand Up @@ -293,7 +293,7 @@ proc initTable*[A, B](initialSize = defaultInitialSize): Table[A, B] =
##
## See also:
## * `toTable proc<#toTable,openArray[]>`_
## * `newTable proc<#newTable,int>`_ for creating a `TableRef`
## * `newTable proc<#newTable>`_ for creating a `TableRef`
runnableExamples:
let
a = initTable[int, string]()
Expand Down Expand Up @@ -322,7 +322,7 @@ proc toTable*[A, B](pairs: openArray[(A, B)]): Table[A, B] =
## ``pairs`` is a container consisting of ``(key, value)`` tuples.
##
## See also:
## * `initTable proc<#initTable,int>`_
## * `initTable proc<#initTable>`_
## * `newTable proc<#newTable,openArray[]>`_ for a `TableRef` version
runnableExamples:
let a = [('a', 5), ('b', 9)]
Expand Down Expand Up @@ -771,7 +771,7 @@ iterator allValues*[A, B](t: Table[A, B]; key: A): B {.deprecated:
## Iterates over any value in the table ``t`` that belongs to the given ``key``.
##
## Used if you have a table with duplicate keys (as a result of using
## `add proc<#add,Table[A,B],A,B>`_).
## `add proc<#add,Table[A,B],A,sinkB>`_).
##
runnableExamples:
import sequtils, algorithm
Expand Down Expand Up @@ -801,7 +801,7 @@ proc newTable*[A, B](initialSize = defaultInitialSize): <//>TableRef[A, B] =
## See also:
## * `newTable proc<#newTable,openArray[]>`_ for creating a `TableRef`
## from a collection of `(key, value)` pairs
## * `initTable proc<#initTable,int>`_ for creating a `Table`
## * `initTable proc<#initTable>`_ for creating a `Table`
runnableExamples:
let
a = newTable[int, string]()
Expand All @@ -816,7 +816,7 @@ proc newTable*[A, B](pairs: openArray[(A, B)]): <//>TableRef[A, B] =
## ``pairs`` is a container consisting of ``(key, value)`` tuples.
##
## See also:
## * `newTable proc<#newTable,int>`_
## * `newTable proc<#newTable>`_
## * `toTable proc<#toTable,openArray[]>`_ for a `Table` version
runnableExamples:
let a = [('a', 5), ('b', 9)]
Expand Down Expand Up @@ -845,7 +845,7 @@ proc `[]`*[A, B](t: TableRef[A, B], key: A): var B =
## a default value (e.g. zero for int) if the key doesn't exist
## * `getOrDefault proc<#getOrDefault,TableRef[A,B],A,B>`_ to return
## a custom value if the key doesn't exist
## * `[]= proc<#[]=,TableRef[A,B],A,B>`_ for inserting a new
## * `[]= proc<#[]=,TableRef[A,B],A,sinkB>`_ for inserting a new
## (key, value) pair in the table
## * `hasKey proc<#hasKey,TableRef[A,B],A>`_ for checking if a key is in
## the table
Expand Down Expand Up @@ -1008,7 +1008,7 @@ proc add*[A, B](t: TableRef[A, B], key: A, val: sink B) {.deprecated:
##
## **This can introduce duplicate keys into the table!**
##
## Use `[]= proc<#[]=,TableRef[A,B],A,B>`_ for inserting a new
## Use `[]= proc<#[]=,TableRef[A,B],A,sinkB>`_ for inserting a new
## (key, value) pair in the table without introducing duplicates.
t[].add(key, val)

Expand Down Expand Up @@ -1228,14 +1228,14 @@ type
## Hash table that remembers insertion order.
##
## For creating an empty OrderedTable, use `initOrderedTable proc
## <#initOrderedTable,int>`_.
## <#initOrderedTable>`_.
data: OrderedKeyValuePairSeq[A, B]
counter, first, last: int
OrderedTableRef*[A, B] = ref OrderedTable[A, B] ## Ref version of
## `OrderedTable<#OrderedTable>`_.
##
## For creating a new empty OrderedTableRef, use `newOrderedTable proc
## <#newOrderedTable,int>`_.
## <#newOrderedTable>`_.


# ------------------------------ helpers ---------------------------------
Expand Down Expand Up @@ -1294,7 +1294,7 @@ proc initOrderedTable*[A, B](initialSize = defaultInitialSize): OrderedTable[A,
##
## See also:
## * `toOrderedTable proc<#toOrderedTable,openArray[]>`_
## * `newOrderedTable proc<#newOrderedTable,int>`_ for creating an
## * `newOrderedTable proc<#newOrderedTable>`_ for creating an
## `OrderedTableRef`
runnableExamples:
let
Expand Down Expand Up @@ -1324,7 +1324,7 @@ proc toOrderedTable*[A, B](pairs: openArray[(A, B)]): OrderedTable[A, B] =
## ``pairs`` is a container consisting of ``(key, value)`` tuples.
##
## See also:
## * `initOrderedTable proc<#initOrderedTable,int>`_
## * `initOrderedTable proc<#initOrderedTable>`_
## * `newOrderedTable proc<#newOrderedTable,openArray[]>`_ for an
## `OrderedTableRef` version
runnableExamples:
Expand All @@ -1347,7 +1347,7 @@ proc `[]`*[A, B](t: OrderedTable[A, B], key: A): B =
## a default value (e.g. zero for int) if the key doesn't exist
## * `getOrDefault proc<#getOrDefault,OrderedTable[A,B],A,B>`_ to return
## a custom value if the key doesn't exist
## * `[]= proc<#[]=,OrderedTable[A,B],A,B>`_ for inserting a new
## * `[]= proc<#[]=,OrderedTable[A,B],A,sinkB>`_ for inserting a new
## (key, value) pair in the table
## * `hasKey proc<#hasKey,OrderedTable[A,B],A>`_ for checking if a
## key is in the table
Expand All @@ -1369,7 +1369,7 @@ proc `[]`*[A, B](t: var OrderedTable[A, B], key: A): var B =
## a default value (e.g. zero for int) if the key doesn't exist
## * `getOrDefault proc<#getOrDefault,OrderedTable[A,B],A,B>`_ to return
## a custom value if the key doesn't exist
## * `[]= proc<#[]=,OrderedTable[A,B],A,B>`_ for inserting a new
## * `[]= proc<#[]=,OrderedTable[A,B],A,sinkB>`_ for inserting a new
## (key, value) pair in the table
## * `hasKey proc<#hasKey,OrderedTable[A,B],A>`_ for checking if a
## key is in the table
Expand Down Expand Up @@ -1495,7 +1495,7 @@ proc add*[A, B](t: var OrderedTable[A, B], key: A, val: sink B) {.deprecated:
##
## **This can introduce duplicate keys into the table!**
##
## Use `[]= proc<#[]=,OrderedTable[A,B],A,B>`_ for inserting a new
## Use `[]= proc<#[]=,OrderedTable[A,B],A,sinkB>`_ for inserting a new
## (key, value) pair in the table without introducing duplicates.
addImpl(enlarge)

Expand Down Expand Up @@ -1796,7 +1796,7 @@ proc newOrderedTable*[A, B](initialSize = defaultInitialSize): <//>OrderedTableR
## See also:
## * `newOrderedTable proc<#newOrderedTable,openArray[]>`_ for creating
## an `OrderedTableRef` from a collection of `(key, value)` pairs
## * `initOrderedTable proc<#initOrderedTable,int>`_ for creating an
## * `initOrderedTable proc<#initOrderedTable>`_ for creating an
## `OrderedTable`
runnableExamples:
let
Expand All @@ -1811,7 +1811,7 @@ proc newOrderedTable*[A, B](pairs: openArray[(A, B)]): <//>OrderedTableRef[A, B]
## ``pairs`` is a container consisting of ``(key, value)`` tuples.
##
## See also:
## * `newOrderedTable proc<#newOrderedTable,int>`_
## * `newOrderedTable proc<#newOrderedTable>`_
## * `toOrderedTable proc<#toOrderedTable,openArray[]>`_ for an
## `OrderedTable` version
runnableExamples:
Expand All @@ -1835,7 +1835,7 @@ proc `[]`*[A, B](t: OrderedTableRef[A, B], key: A): var B =
## a default value (e.g. zero for int) if the key doesn't exist
## * `getOrDefault proc<#getOrDefault,OrderedTableRef[A,B],A,B>`_ to return
## a custom value if the key doesn't exist
## * `[]= proc<#[]=,OrderedTableRef[A,B],A,B>`_ for inserting a new
## * `[]= proc<#[]=,OrderedTableRef[A,B],A,sinkB>`_ for inserting a new
## (key, value) pair in the table
## * `hasKey proc<#hasKey,OrderedTableRef[A,B],A>`_ for checking if
## a key is in the table
Expand Down Expand Up @@ -1981,7 +1981,7 @@ proc add*[A, B](t: OrderedTableRef[A, B], key: A, val: sink B) {.deprecated:
##
## **This can introduce duplicate keys into the table!**
##
## Use `[]= proc<#[]=,OrderedTableRef[A,B],A,B>`_ for inserting a new
## Use `[]= proc<#[]=,OrderedTableRef[A,B],A,sinkB>`_ for inserting a new
## (key, value) pair in the table without introducing duplicates.
t[].add(key, val)

Expand Down Expand Up @@ -2208,15 +2208,15 @@ type
## Hash table that counts the number of each key.
##
## For creating an empty CountTable, use `initCountTable proc
## <#initCountTable,int>`_.
## <#initCountTable>`_.
data: seq[tuple[key: A, val: int]]
counter: int
isSorted: bool
CountTableRef*[A] = ref CountTable[A] ## Ref version of
## `CountTable<#CountTable>`_.
##
## For creating a new empty CountTableRef, use `newCountTable proc
## <#newCountTable,int>`_.
## <#newCountTable>`_.


# ------------------------------ helpers ---------------------------------
Expand Down Expand Up @@ -2260,7 +2260,7 @@ proc initCountTable*[A](initialSize = defaultInitialSize): CountTable[A] =
##
## See also:
## * `toCountTable proc<#toCountTable,openArray[A]>`_
## * `newCountTable proc<#newCountTable,int>`_ for creating a
## * `newCountTable proc<#newCountTable>`_ for creating a
## `CountTableRef`
initImpl(result, initialSize)

Expand Down Expand Up @@ -2294,7 +2294,7 @@ proc `[]=`*[A](t: var CountTable[A], key: A, val: int) =
##
## See also:
## * `[] proc<#[],CountTable[A],A>`_ for retrieving a value of a key
## * `inc proc<#inc,CountTable[A],A,Positive>`_ for incrementing a
## * `inc proc<#inc,CountTable[A],A,int>`_ for incrementing a
## value of a key
assert(not t.isSorted, "CountTable must not be used after sorting")
assert val >= 0
Expand Down Expand Up @@ -2617,7 +2617,7 @@ proc newCountTable*[A](initialSize = defaultInitialSize): <//>CountTableRef[A] =
## See also:
## * `newCountTable proc<#newCountTable,openArray[A]>`_ for creating
## a `CountTableRef` from a collection
## * `initCountTable proc<#initCountTable,int>`_ for creating a
## * `initCountTable proc<#initCountTable>`_ for creating a
## `CountTable`
new(result)
result[] = initCountTable[A](initialSize)
Expand All @@ -2635,7 +2635,7 @@ proc `[]`*[A](t: CountTableRef[A], key: A): int =
## See also:
## * `getOrDefault<#getOrDefault,CountTableRef[A],A,int>`_ to return
## a custom value if the key doesn't exist
## * `inc proc<#inc,CountTableRef[A],A>`_ to inc even if missing
## * `inc proc<#inc,CountTableRef[A],A,int>`_ to inc even if missing
## * `[]= proc<#[]%3D,CountTableRef[A],A,int>`_ for inserting a new
## (key, value) pair in the table
## * `hasKey proc<#hasKey,CountTableRef[A],A>`_ for checking if a key
Expand Down
2 changes: 1 addition & 1 deletion lib/pure/concurrency/threadpool.nim
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ template spawnX*(call) =
## Spawns a new task if a CPU core is ready, otherwise executes the
## call in the calling thread.
##
## Usually it is advised to use `spawn proc <#spawn,typed>`_ in order to
## Usually it is advised to use `spawn proc <#spawn,sinktyped>`_ in order to
## not block the producer for an unknown amount of time.
##
## ``call`` has to be proc call ``p(...)`` where ``p`` is gcsafe and has a
Expand Down
Loading

0 comments on commit e350558

Please sign in to comment.