ali-ramadhan / DocumenterCitations.jl

DocumenterCitations.jl uses Bibliography.jl to add support for BibTeX citations and references in documentation pages generated by Documenter.jl.
https://ali-ramadhan.github.io/DocumenterCitations.jl/dev
MIT License
65 stars 10 forks source link

Documentation build breaks when using @contents block #33

Closed guilgautier closed 3 years ago

guilgautier commented 3 years ago

Hi there,

Thanks for your nice work !

I've had some troubles understanding a build break, and found out that when using

  ```@contents
  Pages = ["references.md"]```

or less carefully

  ```@contents```

results in a documentation build break

 ~/.julia/dev/DocumenterCitations.jl !master 

$ julia docs/make.jl
[ Info: SetupBuildDirectory: setting up build directory.
[ Info: Doctest: running doctests.
[ Info: ExpandTemplates: expanding markdown templates.
[ Info: Expanding bibliography.
[ Info: Expanding bibliography entry: useful_proof.
[ Info: Expanding bibliography entry: CK1994.
[ Info: Expanding bibliography entry: Heun1900.
[ Info: Expanding bibliography entry: Mayer2012.
[ Info: CrossReferences: building cross-references.
[ Info: Citations: building citations.
[ Info: Expanding citation: Mayer2012.
[ Info: Expanding citation: useful_proof.
[ Info: Expanding citation: Heun1900.
[ Info: Expanding citation: Mayer2012.
[ Info: CheckDocument: running document checks.
[ Info: Populate: populating indices.
ERROR: LoadError: MethodError: no method matching header_level(::BibInternal.Entry)
Closest candidates are:
  header_level(::Markdown.Header{N}) where N at /Users/user/.julia/packages/Documenter/6vUwN/src/Utilities/Utilities.jl:315
Stacktrace:
 [1] populate!(::Documenter.Documents.ContentsNode, ::Documenter.Documents.Document) at /Users/user/.julia/packages/Documenter/6vUwN/src/Documents.jl:428
 [2] populate!(::Documenter.Documents.Document) at /Users/user/.julia/packages/Documenter/6vUwN/src/Documents.jl:390
 [3] runner(::Type{Documenter.Builder.Populate}, ::Documenter.Documents.Document) at /Users/user/.julia/packages/Documenter/6vUwN/src/Builder.jl:248
 [4] dispatch(::Type{Documenter.Builder.DocumentPipeline}, ::Documenter.Documents.Document) at /Users/user/.julia/packages/Documenter/6vUwN/src/Utilities/Selectors.jl:170
 [5] #2 at /Users/user/.julia/packages/Documenter/6vUwN/src/Documenter.jl:247 [inlined]
 [6] cd(::Documenter.var"#2#3"{Documenter.Documents.Document}, ::String) at ./file.jl:104
 [7] #makedocs#1 at /Users/user/.julia/packages/Documenter/6vUwN/src/Documenter.jl:246 [inlined]
 [8] top-level scope at /Users/user/.julia/dev/DocumenterCitations.jl/docs/make.jl:6
 [9] include(::Function, ::Module, ::String) at ./Base.jl:380
 [10] include(::Module, ::String) at ./Base.jl:368
 [11] exec_options(::Base.JLOptions) at ./client.jl:296
 [12] _start() at ./client.jl:506
in expression starting at /Users/user/.julia/dev/DocumenterCitations.jl/docs/make.jl:6
fingolfin commented 3 years ago

Looks like the same error as in #24?

guilgautier commented 3 years ago

Yes indeed! I'll propose the above dirty fix in #24, namely Remove the file where the @bibliography block is called (here reference.md), from the list of Pages involved in all @contents block.