Skip to content

Commit 17a7007

Browse files
authored
Merge pull request #3 from PeterLuschny/master
AddSignaturesToDocStrings
2 parents c6c0a4b + c1afa5a commit 17a7007

7 files changed

Lines changed: 666 additions & 30 deletions

File tree

Project.toml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,14 @@
11
name = "Sequences"
22
uuid = "b4b868b0-69a7-11e9-2db0-173b4e8e576c"
3-
authors = ["OLMS <seq@olms.onl>"]
43
version = "0.1.0"
54

65
[deps]
7-
AbstractAlgebra = "c3fe647b-3220-5bb0-a1ea-a7954cac585d"
8-
Atom = "c52e3926-4ff0-5f6e-af25-54175e0327b1"
9-
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
106
Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"
117
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
8+
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
129
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
13-
DocumenterTools = "35a29f4d-8980-5a13-9543-d66fff28ecb8"
14-
Gumbo = "708ec375-b3d6-5a57-a7ce-8257bf98657a"
1510
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
16-
IJulia = "7073ff75-c697-5162-941a-fcdaad2a7d2a"
1711
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
1812
IterTools = "c8e1da08-722c-5040-9ed9-7db0dc04731e"
19-
Juno = "e5e0dc1b-0480-54bc-9374-aad01c23163d"
20-
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
2113
Nemo = "2edaba10-b0f1-5616-af89-8c11ac63239a"
22-
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
23-
Primes = "27ebfcd6-29c5-5fa9-bf4b-fb8fc14df3ae"
24-
StringBuilders = "db12335b-fddc-5e1b-b0ee-42071d21ae50"
2514
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
26-
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"

docs/src/modules.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Modules
22

3-
[Abundant](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/Abundant.jl)   🔶  [AndreNumbers](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/AndreNumbers.jl)   🔶  [BellNumbers](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/BellNumbers.jl)   🔶  [BernoulliNumbers](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/BernoulliNumbers.jl)   🔶  [BinaryInteger](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/BinaryInteger.jl)   🔶  [BinaryQF](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/BinaryQF.jl)   🔶  [CarmichaelNumbers](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/CarmichaelNumbers.jl)   🔶  [ClausenNumbers](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/ClausenNumbers.jl)   🔶  [CombinationsIterator](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/CombinationsIterator.jl)   🔶  [Compositions](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/Compositions.jl)   🔶  [Counts](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/Counts.jl)   🔶  [DedekindEta](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/DedekindEta.jl)   🔶  [Deleham](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/Deleham.jl)   🔶  [Fibonacci](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/Fibonacci.jl)   🔶  [FigurativeNumbers](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/FigurativeNumbers.jl)   🔶  [GaussFactorialRecords](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/GaussFactorialRecords.jl)   🔶  [GeneralizedBinomial](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/GeneralizedBinomial.jl)   🔶  [HighlyAbundant](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/HighlyAbundant.jl)   🔶  [Hyper1F1](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/Hyper1F1.jl)   🔶  [JacobiTheta](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/JacobiTheta.jl)   🔶  [Kolakoski](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/Kolakoski.jl)   🔶  [NarayanaCows](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/NarayanaCows.jl)   🔶  [NumberTheory](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/NumberTheory.jl)   🔶  [OEISUtils](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/OEISUtils.jl)   🔶  [OrthoPolynomials](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/OrthoPolynomials.jl)   🔶  [Partitions](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/Partitions.jl)   🔶  [PrimesIterator](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/PrimesIterator.jl)   🔶  [PrimeSwingFactorial](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/PrimeSwingFactorial.jl)   🔶  [Products](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/Products.jl)   🔶  [QueensProblems](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/QueensProblems.jl)   🔶  [RecordSearch](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/RecordSearch.jl)   🔶  [RiordanSquares](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/RiordanSquares.jl)   🔶  [SelfConvolutive](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/SelfConvolutive.jl)   🔶  [SeqUtils](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/SeqUtils.jl)   🔶  [SeriesExpansion](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/SeriesExpansion.jl)   🔶  [StirlingLahNumbers](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/StirlingLahNumbers.jl)   🔶  [SwingFactorial](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/SwingFactorial.jl)   🔶  [Triangles](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/Triangles.jl)   🔶  [UlamNumbers](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/UlamNumbers.jl)   🔶  [ZumkellerNumbers](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/ZumkellerNumbers.jl)   🔶  
3+
[Abundant](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/Abundant.jl)   🔶  [AndreNumbers](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/AndreNumbers.jl)   🔶  [BellNumbers](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/BellNumbers.jl)   🔶  [BernoulliNumbers](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/BernoulliNumbers.jl)   🔶  [BinaryInteger](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/BinaryInteger.jl)   🔶  [BinaryQF](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/BinaryQF.jl)   🔶  [CarmichaelNumbers](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/CarmichaelNumbers.jl)   🔶  [ClausenNumbers](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/ClausenNumbers.jl)   🔶  [CombinationsIterator](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/CombinationsIterator.jl)   🔶  [Compositions](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/Compositions.jl)   🔶  [Counts](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/Counts.jl)   🔶  [DedekindEta](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/DedekindEta.jl)   🔶  [Deleham](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/Deleham.jl)   🔶  [Fibonacci](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/Fibonacci.jl)   🔶  [FigurativeNumbers](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/FigurativeNumbers.jl)   🔶  [GaussFactorialRecords](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/GaussFactorialRecords.jl)   🔶  [GeneralizedBinomial](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/GeneralizedBinomial.jl)   🔶  [HighlyAbundant](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/HighlyAbundant.jl)   🔶  [Hyper1F1](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/Hyper1F1.jl)   🔶  [JacobiTheta](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/JacobiTheta.jl)   🔶  [Kolakoski](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/Kolakoski.jl)   🔶  [NarayanaCows](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/NarayanaCows.jl)   🔶  [NumberTheory](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/NumberTheory.jl)   🔶  [OEISUtils](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/OEISUtils.jl)   🔶  [OrthoPolynomials](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/OrthoPolynomials.jl)   🔶  [Partitions](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/Partitions.jl)   🔶  [PrimesIterator](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/PrimesIterator.jl)   🔶  [PrimeSwingFactorial](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/PrimeSwingFactorial.jl)   🔶  [Products](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/Products.jl)   🔶  [QueensProblems](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/QueensProblems.jl)   🔶  [RecordSearch](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/RecordSearch.jl)   🔶  [RiordanSquares](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/RiordanSquares.jl)   🔶  [SelfConvolutive](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/SelfConvolutive.jl)   🔶  [SeqUtils](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/SeqUtils.jl)   🔶  [SeriesExpansion](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/SeriesExpansion.jl)   🔶  [StirlingLahNumbers](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/StirlingLahNumbers.jl)   🔶  [SwingFactorial](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/SwingFactorial.jl)   🔶  [S_INDEX](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/S_INDEX.jl)   🔶  [Triangles](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/Triangles.jl)   🔶  [UlamNumbers](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/UlamNumbers.jl)   🔶  [ZumkellerNumbers](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/ZumkellerNumbers.jl)   🔶  

src/BuildSequences.jl

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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)
378383
end
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+
380439
function build_all(docdefs=false)
381440
build_seq(docdefs)
441+
addsignature()
382442

383443
build_test()
384444
build_perf()

0 commit comments

Comments
 (0)