fixes #20526; use nimPreviewSlimSystem for documentation build (#20714)

* fixes #20526; use `nimPreviewSlimSystem` for `koch docs`

* fixes documentation errors

* fixes remaning issues
This commit is contained in:
ringabout
2022-11-01 19:53:14 +08:00
committed by GitHub
parent 07cf4486bc
commit 75ece74bdd
16 changed files with 39 additions and 5 deletions

View File

@@ -676,7 +676,7 @@ when isMainModule:
case normalize(op.key)
of "boot": boot(op.cmdLineRest)
of "clean": clean(op.cmdLineRest)
of "doc", "docs": buildDocs(op.cmdLineRest & paCode, localDocsOnly, localDocsOut)
of "doc", "docs": buildDocs(op.cmdLineRest & " --d:nimPreviewSlimSystem " & paCode, localDocsOnly, localDocsOut)
of "doc0", "docs0":
# undocumented command for Araq-the-merciful:
buildDocs(op.cmdLineRest & gaCode)

View File

@@ -26,6 +26,9 @@ when defined(nimPreviewSlimSystem):
import std/syncio
when defined(windows):
when defined(nimPreviewSlimSystem):
import std/syncio
proc readLineFromStdin*(prompt: string): string {.
tags: [ReadIOEffect, WriteIOEffect].} =
## Reads a line from stdin.

View File

@@ -200,6 +200,9 @@ batchable: false
# block. Perhaps something can be done about this - some way of re-allocating
# the state and transferring the old...
when defined(nimPreviewSlimSystem):
import std/assertions
when not defined(js) and (defined(hotcodereloading) or
defined(createNimHcr) or
defined(testNimHcr)):

View File

@@ -61,7 +61,7 @@ import
from algorithm import binarySearch
when defined(nimPreviewSlimSystem):
import std/assertions
import std/[assertions, syncio]
type

View File

@@ -7,6 +7,9 @@
# distribution, for details about the copyright.
#
when defined(nimPreviewSlimSystem):
import std/syncio
# Get the platform-dependent flags.
# Structure describing an inotify event.
type

View File

@@ -14,6 +14,9 @@
import posix, parsecfg, os
import std/private/since
when defined(nimPreviewSlimSystem):
import std/syncio
type Uname* = object
sysname*, nodename*, release*, version*, machine*: string

View File

@@ -27,7 +27,7 @@ import asyncdispatch, os
when defined(nimPreviewSlimSystem):
import std/[assertions, syncio]
when defined(windows):
when defined(windows) or defined(nimdoc):
import std/widestrs
# TODO: Fix duplication introduced by PR #4683.

View File

@@ -84,6 +84,11 @@
import asyncdispatch, asyncnet, nativesockets, strutils, parseutils, os, times
from net import BufferSize, SslContext
when defined(nimPreviewSlimSystem):
import std/syncio
when defined(ssl):
from net import SslHandshakeType, newContext, SslCVerifyMode
var defaultSslContext {.threadvar.}: SslContext

View File

@@ -33,6 +33,9 @@ import os
import lists
include system/timers
when defined(nimPreviewSlimSystem):
import std/assertions
const defaultStackSize = 512 * 1024
const useOrcArc = defined(gcArc) or defined(gcOrc)

View File

@@ -23,6 +23,9 @@ when defined(nimHasUsed):
import hashes, algorithm, strutils, tables, sets
when defined(nimPreviewSlimSystem):
import std/syncio
when not defined(memProfiler):
include "system/timers"

View File

@@ -150,7 +150,7 @@ import
strutils, lexbase, streams, unicode
when defined(nimPreviewSlimSystem):
import std/assertions
import std/[assertions, syncio]
# the parser treats ``<br />`` as ``<br></br>``

View File

@@ -20,6 +20,9 @@
from std/oserrors import raiseOSError, osLastError
when defined(nimPreviewSlimSystem):
import std/assertions
template distance*(lhs, rhs: pointer): int =
cast[int](rhs) - cast[int](lhs)

View File

@@ -46,6 +46,9 @@
import net, strutils, strtabs, base64, os, strutils
import asyncnet, asyncdispatch
when defined(nimPreviewSlimSystem):
import std/assertions
export Port
type

View File

@@ -9,7 +9,7 @@ when defined(windows):
from strutils import replace
when defined(nimPreviewSlimSystem):
import std/assertions
import std/[assertions, objectdollar]
when defined(nimHasEffectsOf):

View File

@@ -884,6 +884,8 @@ when not defined(nimDisableCertificateValidation) and not defined(windows):
{.pop.}
when isMainModule:
when defined(nimPreviewSlimSystem):
import std/assertions
# A simple certificate test
let certbytes = readFile("certificate.der")
let cert = d2i_X509(certbytes)

View File

@@ -14,6 +14,9 @@ import
import std/private/decode_helpers
when defined(nimPreviewSlimSystem):
import std/[assertions, formatfloat]
type
SexpEventKind* = enum ## enumeration of all events that may occur when parsing
sexpError, ## an error occurred during parsing