Skip to content

Latest commit

 

History

History
30 lines (25 loc) · 1.11 KB

styling.md

File metadata and controls

30 lines (25 loc) · 1.11 KB

CSS Styling

For optimal rendering of the bibliography, place a file citations.css in the docs/src/assets folder of your project, containing, e.g.,

using Markdown
css_file = joinpath(@__DIR__, "..", "src", "assets", "citations.css")
if isfile(css_file)
    Markdown.parse("""
    ```css
    $(read(css_file, String))
    ```
    """)
end

The HTML generated by DocumenterCitations also uses CSS classes canonical and noncanonical to distinguish between [canonical](@ref canonical) and [non-canonical](@ref noncanonical) blocks. While these are not used in the above citations.css, a custom citations.css could implement different formatting for the two types of bibliographies.

The citations.css file must be listed as an asset for Documenter.HTML in docs/make.jl:

makedocs(;
    format = Documenter.HTML(
        # ...
        assets=String["assets/citations.css"],
    ),
    plugins=[bib],
    # ...
)