@@ -186,13 +186,13 @@ function build_seq(docdefs)
186186
187187 tmp = open (" _TEMP.jl" , " r" )
188188 sor = open (" S_INDEX.jl" , " r" )
189- target = joinpath (srcdir, " Sequences .jl" )
189+ target = joinpath (srcdir, " _Sequences .jl" )
190190 olm = open (target, " w" )
191191 header (olm)
192192 println (olm, " __precompile__()" )
193193
194194 println (olm, " module Sequences" )
195- println (olm, " using Nemo, IterTools, HTTP" )
195+ println (olm, " using Nemo, IterTools, HTTP, DocStringExtensions " )
196196
197197 for l in eachline (sor, keep= true )
198198 print (olm, l)
@@ -282,6 +282,11 @@ function build_perf()
282282 o = open (path, " w" )
283283
284284 header (o)
285+ println (o, " tstdir = realpath(joinpath(dirname(@__FILE__)))" )
286+ println (o, " srcdir = joinpath(dirname(tstdir), \" src\" )" )
287+ println (o, " tstdir ∉ LOAD_PATH && push!(LOAD_PATH, tstdir)" )
288+ println (o, " srcdir ∉ LOAD_PATH && push!(LOAD_PATH, srcdir)" )
289+
285290 println (o, " module perftests" )
286291 println (o, " using Sequences, Dates, InteractiveUtils" )
287292
@@ -377,8 +382,63 @@ function make_modules()
377382 close (ind)
378383end
379384
385+ function nextline (srcfile)
386+
387+ while ! eof (srcfile)
388+ n = readline (srcfile)
389+ n == " " && continue
390+ # startswith(n, "#") && continue
391+ return n
392+ end
393+ return nothing
394+ end
395+
396+ function addsig (srcfile, docfile)
397+
398+ while true
399+
400+ n = nextline (srcfile)
401+ n == nothing && return
402+ while ! startswith (n, " \"\"\" " )
403+ println (docfile, n)
404+ n = nextline (srcfile)
405+ n == nothing && return
406+ end
407+
408+ if startswith (n, " \"\"\" " )
409+ println (docfile, n)
410+ n = nextline (srcfile)
411+ n == nothing && return
412+ while ! startswith (n, " \"\"\" " )
413+ println (docfile, n)
414+ n = nextline (srcfile)
415+ n == nothing && return
416+ end
417+
418+ println (docfile, " \$ (SIGNATURES)" )
419+ println (docfile, n)
420+ end
421+ end
422+ end
423+
424+ function addsignature ()
425+
426+ docdir = realpath (joinpath (dirname (@__FILE__ )))
427+ pkgdir = dirname (docdir)
428+ srcdir = joinpath (pkgdir, " src" )
429+ srcfile = open (joinpath (srcdir, " _Sequences.jl" ), " r" )
430+ docfile = open (joinpath (docdir, " Sequences.jl" ), " w" )
431+
432+ addsig (srcfile, docfile)
433+
434+ close (srcfile)
435+ close (docfile)
436+ rm (" _Sequences.jl" )
437+ end
438+
380439function build_all (docdefs= false )
381440 build_seq (docdefs)
441+ addsignature ()
382442
383443 build_test ()
384444 build_perf ()
0 commit comments