@@ -4,7 +4,7 @@ import os, strutils, osproc, sets
4
4
5
5
const
6
6
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
8
8
nimArgs = " --warning[LockLevel]:off --hint[Conf]:off --hint[Path]:off --hint[Processing]:off -d:boot --putenv:nimversion=$#" % system.NimVersion
9
9
gitUrl = " https://github.com/nim-lang/Nim"
10
10
docHtmlOutput = " doc/html"
@@ -167,8 +167,6 @@ lib/pure/collections/tableimpl.nim
167
167
lib/pure/collections/setimpl.nim
168
168
""" .splitWhitespace() # these don't produce any useful info even with `nim doc0`
169
169
170
- import std/ strformat
171
-
172
170
proc isRelativeTo(path, base: string ): bool =
173
171
# pending #13212 use os.isRelativeTo
174
172
let path = path.normalizedPath
@@ -207,11 +205,11 @@ lib/system/widestrs.nim
207
205
208
206
for a in walkDirRec(" lib" ):
209
207
if a.splitFile.ext != " .nim" : continue
208
+ if a.isRelativeTo(" lib/pure/includes" ): continue
209
+ if a.isRelativeTo(" lib/genode" ): continue
210
210
if a.isRelativeTo(" lib/deprecated" ):
211
211
if a notin @ [" lib/deprecated/pure/ospaths.nim" ]: # REMOVE
212
212
continue
213
- if a.isRelativeTo(" lib/pure/includes" ): continue
214
- if a.isRelativeTo(" lib/genode" ): continue
215
213
if a.isRelativeTo(" lib/system" ):
216
214
if a notin goodSystem:
217
215
continue
@@ -276,44 +274,7 @@ compiler/plugins/itersgen.nim
276
274
if a in bad2: continue
277
275
result .add a
278
276
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
-
315
277
const doc = getDocList()
316
- # runDocAsMegatest(doc)
317
278
318
279
proc sexec(cmds: openArray [string ]) =
319
280
# # Serial queue wrapper around exec.
@@ -337,25 +298,7 @@ proc buildDocSamples(nimArgs, destPath: string) =
337
298
exec(findNim() & " doc $# -o:$# $#" %
338
299
[nimArgs, destPath / " docgen_sample.html" , " doc" / " docgen_sample.nim" ])
339
300
340
- import std/ times
341
-
342
301
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 ) =
359
302
# call nim for the documentation:
360
303
var
361
304
commands = newSeq[string ](rst2html.len + len(doc0) + len(doc) + withoutIndex.len)
0 commit comments