stdlib organization & documentation improvements (#20971)
* stdlib organization & documentation improvements * fix CI * Update doc/lib.md Co-authored-by: Juan Carlos <juancarlospaco@gmail.com> * fix ci, remove jshttpcore, export in jsfetch instead * fix alphabetical order violations * add cmdline, db_odbc Co-authored-by: Juan Carlos <juancarlospaco@gmail.com>
This commit is contained in:
parent
5d469686b0
commit
739e1badb6
26 changed files with 167 additions and 53 deletions
|
|
@ -1,3 +1,6 @@
|
|||
## Exports [asyncmacro](asyncmacro.html) and [asyncfutures](asyncfutures.html) for native backends,
|
||||
## and [asyncjs](asyncjs.html) on the JS backend.
|
||||
|
||||
when defined(js):
|
||||
import asyncjs
|
||||
export asyncjs
|
||||
|
|
|
|||
|
|
@ -1983,7 +1983,8 @@ proc send*(socket: AsyncFD, data: string,
|
|||
return retFuture
|
||||
|
||||
# -- Await Macro
|
||||
include asyncmacro
|
||||
import asyncmacro
|
||||
export asyncmacro
|
||||
|
||||
proc readAll*(future: FutureStream[string]): owned(Future[string]) {.async.} =
|
||||
## Returns a future that will complete when all the string data from the
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
# distribution, for details about the copyright.
|
||||
#
|
||||
|
||||
## `asyncdispatch` module depends on the `asyncmacro` module to work properly.
|
||||
## Implements the `async` and `multisync` macros for `asyncdispatch`.
|
||||
|
||||
import macros, strutils, asyncfutures
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,6 @@ runnableExamples:
|
|||
## * `fenv module <fenv.html>`_ for handling of floating-point rounding
|
||||
## and exceptions (overflow, zero-divide, etc.)
|
||||
## * `random module <random.html>`_ for a fast and tiny random number generator
|
||||
## * `mersenne module <mersenne.html>`_ for the Mersenne Twister random number generator
|
||||
## * `stats module <stats.html>`_ for statistical analysis
|
||||
## * `strformat module <strformat.html>`_ for formatting floats for printing
|
||||
## * `system module <system.html>`_ for some very basic and trivial math operators
|
||||
|
|
|
|||
|
|
@ -66,7 +66,6 @@ runnableExamples:
|
|||
## See also
|
||||
## ========
|
||||
## * `std/sysrand module <sysrand.html>`_ for a cryptographically secure pseudorandom number generator
|
||||
## * `mersenne module <mersenne.html>`_ for the Mersenne Twister random number generator
|
||||
## * `math module <math.html>`_ for basic math routines
|
||||
## * `stats module <stats.html>`_ for statistical analysis
|
||||
## * `list of cryptographic and hashing modules <lib.html#pure-libraries-hashing>`_
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
## :Authors: Zahary Karadjov
|
||||
##
|
||||
## This module provides utilities for reserving a portions of the
|
||||
## This module provides utilities for reserving portions of the
|
||||
## address space of a program without consuming physical memory.
|
||||
## It can be used to implement a dynamically resizable buffer that
|
||||
## is guaranteed to remain in the same memory location. The buffer
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
## This module implements helpers for determining special directories used by apps.
|
||||
|
||||
from std/private/osappdirs import nil
|
||||
import std/paths
|
||||
import std/envvars
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
# see `semLowerLetVarCustomPragma` for compiler support that enables these
|
||||
# lowerings
|
||||
## This module implements syntax sugar for some declarations.
|
||||
|
||||
import macros
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
## This module implements directory handling.
|
||||
|
||||
from paths import Path, ReadDirEffect, WriteDirEffect
|
||||
|
||||
from std/private/osdirs import dirExists, createDir, existsOrCreateDir, removeDir,
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
#
|
||||
|
||||
|
||||
## The `std/envvars` module implements environment variables handling.
|
||||
## The `std/envvars` module implements environment variable handling.
|
||||
import std/oserrors
|
||||
|
||||
type
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@
|
|||
# distribution, for details about the copyright.
|
||||
#
|
||||
|
||||
## This module allows adding hooks to program exit.
|
||||
|
||||
import locks
|
||||
|
||||
type
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
## This module implements file handling.
|
||||
|
||||
from paths import Path, ReadDirEffect, WriteDirEffect
|
||||
|
||||
from std/private/osfiles import fileExists, removeFile,
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@
|
|||
# distribution, for details about the copyright.
|
||||
#
|
||||
|
||||
## This module implements formatting floats as strings.
|
||||
|
||||
when defined(nimPreviewSlimSystem):
|
||||
import std/assertions
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
## This module implements AST generation using captured variables for macros.
|
||||
|
||||
import macros
|
||||
|
||||
type GenAstOpt* = enum
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
when not defined(js):
|
||||
{.fatal: "Module jsfetch is designed to be used with the JavaScript backend.".}
|
||||
|
||||
import std/[asyncjs, jsheaders, jsformdata]
|
||||
import std/[asyncjs, jsformdata, jsheaders]
|
||||
export jsformdata, jsheaders
|
||||
from std/httpcore import HttpMethod
|
||||
from std/jsffi import JsObject
|
||||
|
||||
|
|
@ -116,7 +117,7 @@ func `$`*(self: Request | Response | FetchOptions): string = $toCstring(self)
|
|||
|
||||
|
||||
runnableExamples("-r:off"):
|
||||
import std/[asyncjs, jsconsole, jsheaders, jsformdata]
|
||||
import std/[asyncjs, jsconsole, jsformdata, jsheaders]
|
||||
from std/httpcore import HttpMethod
|
||||
from std/jsffi import JsObject
|
||||
from std/sugar import `=>`
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
##[
|
||||
This module implements a hookable (de)serialization for arbitrary types.
|
||||
This module implements a hookable (de)serialization for arbitrary types using JSON.
|
||||
Design goal: avoid importing modules where a custom serialization is needed;
|
||||
see strtabs.fromJsonHook,toJsonHook for an example.
|
||||
]##
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
## This module implements a generic `$` operator to convert objects to strings.
|
||||
|
||||
import std/private/miscdollars
|
||||
|
||||
proc `$`*[T: object](x: T): string =
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
## This module implements path handling.
|
||||
|
||||
import std/private/osseps
|
||||
export osseps
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
## This module implements symlink (symbolic link) handling.
|
||||
|
||||
from paths import Path, ReadDirEffect
|
||||
|
||||
from std/private/ossymlinks import symlinkExists, createSymlink, expandSymlink
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
# distribution, for details about the copyright.
|
||||
#
|
||||
|
||||
# Nim support for C/C++'s `wide strings`:idx:.
|
||||
## Nim support for C/C++'s `wide strings`:idx:.
|
||||
|
||||
#when not declared(ThisIsSystem):
|
||||
# {.error: "You must not import this module explicitly".}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue