link compile-time options together in docs (#16879)
* link similar compiler option proc together * fixup links * fix formatting and links * example formatting * drop declared * link to compilesettings * only link define pragmas once * drop another declared * backlink to compileOptions from compilesettings * remove newline
This commit is contained in:
parent
4b2054a7bf
commit
f87b9866af
2 changed files with 35 additions and 4 deletions
|
|
@ -43,14 +43,26 @@ type
|
||||||
|
|
||||||
proc querySetting*(setting: SingleValueSetting): string {.
|
proc querySetting*(setting: SingleValueSetting): string {.
|
||||||
compileTime, noSideEffect.} = discard
|
compileTime, noSideEffect.} = discard
|
||||||
## Can be used to get a string compile-time option. Example:
|
## Can be used to get a string compile-time option.
|
||||||
|
##
|
||||||
|
## See also:
|
||||||
|
## * `compileOption <system.html#compileOption,string>`_ for `on|off` options
|
||||||
|
## * `compileOption <system.html#compileOption,string,string>`_ for enum options
|
||||||
|
##
|
||||||
|
## Example:
|
||||||
##
|
##
|
||||||
## .. code-block:: Nim
|
## .. code-block:: Nim
|
||||||
## const nimcache = querySetting(SingleValueSetting.nimcacheDir)
|
## const nimcache = querySetting(SingleValueSetting.nimcacheDir)
|
||||||
|
|
||||||
proc querySettingSeq*(setting: MultipleValueSetting): seq[string] {.
|
proc querySettingSeq*(setting: MultipleValueSetting): seq[string] {.
|
||||||
compileTime, noSideEffect.} = discard
|
compileTime, noSideEffect.} = discard
|
||||||
## Can be used to get a multi-string compile-time option. Example:
|
## Can be used to get a multi-string compile-time option.
|
||||||
|
##
|
||||||
|
## See also:
|
||||||
|
## * `compileOption <system.html#compileOption,string>`_ for `on|off` options
|
||||||
|
## * `compileOption <system.html#compileOption,string,string>`_ for enum options
|
||||||
|
##
|
||||||
|
## Example:
|
||||||
##
|
##
|
||||||
## .. code-block:: Nim
|
## .. code-block:: Nim
|
||||||
## const nimblePaths = compileSettingSeq(MultipleValueSetting.nimblePaths)
|
## const nimblePaths = compileSettingSeq(MultipleValueSetting.nimblePaths)
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,14 @@ include "system/basic_types"
|
||||||
|
|
||||||
proc compileOption*(option: string): bool {.
|
proc compileOption*(option: string): bool {.
|
||||||
magic: "CompileOption", noSideEffect.}
|
magic: "CompileOption", noSideEffect.}
|
||||||
## Can be used to determine an `on|off` compile-time option. Example:
|
## Can be used to determine an `on|off` compile-time option.
|
||||||
|
##
|
||||||
|
## See also:
|
||||||
|
## * `compileOption <#compileOption,string,string>`_ for enum options
|
||||||
|
## * `defined <#defined,untyped>`_
|
||||||
|
## * `std/compilesettings module <compilesettings.html>`_
|
||||||
|
##
|
||||||
|
## Example:
|
||||||
##
|
##
|
||||||
## .. code-block:: Nim
|
## .. code-block:: Nim
|
||||||
## when compileOption("floatchecks"):
|
## when compileOption("floatchecks"):
|
||||||
|
|
@ -65,7 +72,14 @@ proc compileOption*(option: string): bool {.
|
||||||
|
|
||||||
proc compileOption*(option, arg: string): bool {.
|
proc compileOption*(option, arg: string): bool {.
|
||||||
magic: "CompileOptionArg", noSideEffect.}
|
magic: "CompileOptionArg", noSideEffect.}
|
||||||
## Can be used to determine an enum compile-time option. Example:
|
## Can be used to determine an enum compile-time option.
|
||||||
|
##
|
||||||
|
## See also:
|
||||||
|
## * `compileOption <#compileOption,string>`_ for `on|off` options
|
||||||
|
## * `defined <#defined,untyped>`_
|
||||||
|
## * `std/compilesettings module <compilesettings.html>`_
|
||||||
|
##
|
||||||
|
## Example:
|
||||||
##
|
##
|
||||||
## .. code-block:: Nim
|
## .. code-block:: Nim
|
||||||
## when compileOption("opt", "size") and compileOption("gc", "boehm"):
|
## when compileOption("opt", "size") and compileOption("gc", "boehm"):
|
||||||
|
|
@ -95,6 +109,11 @@ proc defined*(x: untyped): bool {.magic: "Defined", noSideEffect, compileTime.}
|
||||||
## Special compile-time procedure that checks whether `x` is
|
## Special compile-time procedure that checks whether `x` is
|
||||||
## defined.
|
## defined.
|
||||||
##
|
##
|
||||||
|
## See also:
|
||||||
|
## * `compileOption <#compileOption,string>`_ for `on|off` options
|
||||||
|
## * `compileOption <#compileOption,string,string>`_ for enum options
|
||||||
|
## * `define pragmas <manual.html#implementation-specific-pragmas-compileminustime-define-pragmas>`_
|
||||||
|
##
|
||||||
## `x` is an external symbol introduced through the compiler's
|
## `x` is an external symbol introduced through the compiler's
|
||||||
## `-d:x switch <nimc.html#compiler-usage-compileminustime-symbols>`_ to enable
|
## `-d:x switch <nimc.html#compiler-usage-compileminustime-symbols>`_ to enable
|
||||||
## build time conditionals:
|
## build time conditionals:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue