Skip to content

Commit f4ee7e1

Browse files
committed
fixup
1 parent fb2d89b commit f4ee7e1

File tree

1 file changed

+3
-60
lines changed

1 file changed

+3
-60
lines changed

tools/kochdocs.nim

Lines changed: 3 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import os, strutils, osproc, sets
44

55
const
66
gaCode* = " --doc.googleAnalytics:UA-48159761-1"
7-
# --warning[LockLevel]:off pending https://github.com/nim-lang/Nim/issues/13218
7+
# --warning[LockLevel]:off pending #13218
88
nimArgs = "--warning[LockLevel]:off --hint[Conf]:off --hint[Path]:off --hint[Processing]:off -d:boot --putenv:nimversion=$#" % system.NimVersion
99
gitUrl = "https://github.com/nim-lang/Nim"
1010
docHtmlOutput = "doc/html"
@@ -167,8 +167,6 @@ lib/pure/collections/tableimpl.nim
167167
lib/pure/collections/setimpl.nim
168168
""".splitWhitespace() # these don't produce any useful info even with `nim doc0`
169169

170-
import std/strformat
171-
172170
proc isRelativeTo(path, base: string): bool =
173171
# pending #13212 use os.isRelativeTo
174172
let path = path.normalizedPath
@@ -207,11 +205,11 @@ lib/system/widestrs.nim
207205

208206
for a in walkDirRec("lib"):
209207
if a.splitFile.ext != ".nim": continue
208+
if a.isRelativeTo("lib/pure/includes"): continue
209+
if a.isRelativeTo("lib/genode"): continue
210210
if a.isRelativeTo("lib/deprecated"):
211211
if a notin @["lib/deprecated/pure/ospaths.nim"]: # REMOVE
212212
continue
213-
if a.isRelativeTo("lib/pure/includes"): continue
214-
if a.isRelativeTo("lib/genode"): continue
215213
if a.isRelativeTo("lib/system"):
216214
if a notin goodSystem:
217215
continue
@@ -276,44 +274,7 @@ compiler/plugins/itersgen.nim
276274
if a in bad2: continue
277275
result.add a
278276

279-
proc runDocAsMegatest(files: seq[string])=
280-
proc quoted(a: string): string =
281-
result.addQuoted(a)
282-
let file = "lib/pure/alldoc.nim" # has to be under same project otherwise nim doc would skip
283-
var msg = ""
284-
for i in files:
285-
var i = i
286-
# these have special compile options, eg lib/nimrtl.nim.cfg
287-
if i in @["lib/nimrtl.nim"]: continue # Error: This file has to be compiled as a library!
288-
if i in @["lib/pure/nimprof.nim"]: continue # Profiling support is turned off
289-
if i in @["lib/pure/nimtracker.nim"]: continue # when not defined(memTracker) and not isMainModule:
290-
if i in @["lib/pure/concurrency/threadpool.nim"]: continue # Threadpool requires --threads:on option.
291-
if i in @["lib/pure/smtp.nim"]: continue # Error: SMTP module compiled without SSL support
292-
if i in file: continue # it's included; missing stuff
293-
294-
let msgi = "import $1" % i.quoted
295-
# let msgi = "from $1 import nil" % i.quoted
296-
msg.add "static: echo $1\n" % msgi.quoted
297-
msg.add msgi
298-
msg.add "\n"
299-
writeFile(file, msg)
300-
echo file
301-
# findNim()
302-
const nim = getCurrentCompilerExe()
303-
#[
304-
bin/nim doc --hint[Conf]:off --hint[Path]:off --hint[Processing]:off -d:boot --putenv:nimversion=1.1.1 --git.url:https://github.com/nim-lang/Nim -o:web/upload/1.1.1/xmltree.html --index:on lib/pure/xmltree.nim
305-
]#
306-
let dir = "/tmp/d46"
307-
let options = "-d:boot"
308-
let cmd = fmt"cd /Users/timothee/git_clone/nim/Nim_prs && {nim} doc {options} --path:. --errorMax:1 --project --index:on --git.url:https://github.com/nim-lang/Nim --putenv:nimversion=1.1.1 --outDir:{dir} {file}"
309-
echo cmd
310-
let (output, exitCode) = gorgeEx cmd
311-
echo (exitCode: exitCode)
312-
echo output
313-
doAssert false
314-
315277
const doc = getDocList()
316-
# runDocAsMegatest(doc)
317278

318279
proc sexec(cmds: openArray[string]) =
319280
## Serial queue wrapper around exec.
@@ -337,25 +298,7 @@ proc buildDocSamples(nimArgs, destPath: string) =
337298
exec(findNim() & " doc $# -o:$# $#" %
338299
[nimArgs, destPath / "docgen_sample.html", "doc" / "docgen_sample.nim"])
339300

340-
import std/times
341-
342301
proc buildDoc(nimArgs, destPath: string) =
343-
var
344-
commands: seq[string]
345-
let nim = findNim()
346-
for d in items(doc):
347-
commands.add nim & " doc $# --git.url:$# -o:$# --index:on $#" %
348-
[nimArgs, gitUrl,
349-
destPath / changeFileExt(splitFile(d).name, "html"), d]
350-
let t1 = cputime()
351-
mexec(commands)
352-
let t2 = cputime()
353-
echo ("D20200121T114847", t2 - t1, doc.len)
354-
doAssert false
355-
exec(nim & " buildIndex -o:$1/theindex.html $1" % [destPath])
356-
357-
when false:
358-
proc buildDoc(nimArgs, destPath: string) =
359302
# call nim for the documentation:
360303
var
361304
commands = newSeq[string](rst2html.len + len(doc0) + len(doc) + withoutIndex.len)

0 commit comments

Comments
 (0)