Skip to content

Commit

Permalink
wip: monkeypatch documenter into printing blocks and timings
Browse files Browse the repository at this point in the history
  • Loading branch information
benlorenz committed Jul 24, 2023
1 parent aa3573e commit f15191a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
julia-version:
- '1.9'
- '~1.10.0-0'
- 'nightly'
os:
- ubuntu-latest

Expand Down Expand Up @@ -58,12 +59,12 @@ jobs:
julia --project=docs --color=yes -e '
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.add(url="https://github.com/benlorenz/Documenter.jl", rev="bl/printblockandtime027")
Pkg.instantiate()'
- name: "Run doctests"
run: |
julia --project=docs --depwarn=error --color=yes -e'
using Documenter
include("docs/documenter_helpers.jl")
using Oscar
DocMeta.setdocmeta!(Oscar, :DocTestSetup, :(using Oscar; Oscar.AbstractAlgebra.set_current_module(@__MODULE__)); recursive = true)
doctest(Oscar)'
Expand Down
7 changes: 7 additions & 0 deletions docs/documenter_helpers.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@


function Documenter.DocTests.eval_repl(block, sandbox::Module, meta::Dict, doc::Documenter.Documents.Document, page)
src_lines = Documenter.Utilities.find_block_in_file(block.code, meta[:CurrentFile])
println("page: $(Documenter.Utilities.locrepr(meta[:CurrentFile], src_lines))")
@time invoke(Documenter.DocTests.eval_repl, Tuple{Any,Any,Dict,Documenter.Documents.Document,Any}, block, sandbox, meta, doc, page)
end
2 changes: 2 additions & 0 deletions docs/make_work.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ module BuildDoc

using Documenter, DocumenterCitations

include("documenter_helpers.jl")

# Overwrite printing to make the header not full of redundant nonsense
# Turns
# Hecke.Order - Method
Expand Down

0 comments on commit f15191a

Please sign in to comment.