From 33bfbf6d8514c576a215aef64fd4bb2d59e43b88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Fri, 8 Nov 2024 16:49:38 +0100 Subject: [PATCH] Biblio with DocumenterBibliography (#390) * Biblio with DocumenterBibliography * Remove extra line * Use const * Fix * Fix * Fix * Fix format --- docs/Project.toml | 2 ++ docs/make.jl | 15 ++++++++++++++- docs/src/assets/citations.css | 17 +++++++++++++++++ docs/src/bibliography.md | 4 ++++ docs/src/examples/solvers/Path planning.jl | 8 ++------ docs/src/references.bib | 20 ++++++++++++++++++++ 6 files changed, 59 insertions(+), 7 deletions(-) create mode 100644 docs/src/assets/citations.css create mode 100644 docs/src/bibliography.md create mode 100644 docs/src/references.bib diff --git a/docs/Project.toml b/docs/Project.toml index 70c6e5a11..afc538ba2 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -4,6 +4,7 @@ Clarabel = "61c947e1-3e6d-4ee4-985a-eec8c727bd6e" Colors = "5ae59095-9a9b-59fe-a467-6f913c188581" Dionysos = "d92c97cf-b87d-42c1-a9c0-25df00b4d958" Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" +DocumenterCitations = "daee34ce-89f3-4625-b898-19384cb65244" FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b" GLPK = "60bf3e95-4087-53dc-ae20-288a0d20c6a6" Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6" @@ -33,4 +34,5 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [compat] Documenter = "1" +DocumenterCitations = "1" Libtiff_jll = "4.4.0" diff --git a/docs/make.jl b/docs/make.jl index 16e239b47..268b45e1d 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,5 +1,6 @@ using Dionysos using Documenter, Literate +import DocumenterCitations const EXAMPLES_SOLVERS_DIR = joinpath(@__DIR__, "src", "examples", "solvers") const EXAMPLES_UTILS_DIR = joinpath(@__DIR__, "src", "examples", "utils") @@ -46,20 +47,32 @@ const _PAGES = [ end, "Developer Docs" => ["Set up" => "developers/setup.md", "Git" => "developers/git.md"], + "Bibliography" => "bibliography.md", ] +const BIBLIO = DocumenterCitations.CitationBibliography( + joinpath(@__DIR__, "src", "references.bib"); + style = :authoryear, +) + makedocs(; sitename = "Dionysos", # See https://github.com/JuliaDocs/Documenter.jl/issues/868 format = Documenter.HTML(; prettyurls = get(ENV, "CI", nothing) == "true", - assets = ["assets/extra_styles.css"], + assets = ["assets/extra_styles.css", "assets/citations.css"], ), pages = _PAGES, # The following ensures that we only include the docstrings from # this module for functions defined in Base that we overwrite. # It also errors in case we don't include a docstring in the docs modules = [Dionysos], + plugins = [ + DocumenterCitations.CitationBibliography( + joinpath(@__DIR__, "src", "references.bib"); + style = :authoryear, + ), + ], ) deploydocs(; repo = "github.com/dionysos-dev/Dionysos.jl.git", push_preview = true) diff --git a/docs/src/assets/citations.css b/docs/src/assets/citations.css new file mode 100644 index 000000000..b0c63267f --- /dev/null +++ b/docs/src/assets/citations.css @@ -0,0 +1,17 @@ +.citation dl { + display: grid; + grid-template-columns: max-content auto; } +.citation dt { + grid-column-start: 1; } +.citation dd { + grid-column-start: 2; + margin-bottom: 0.75em; } +.citation ul { + padding: 0 0 2.25em 0; + margin: 0; + list-style: none !important;} +.citation ul li { + text-indent: -2.25em; + margin: 0.33em 0.5em 0.5em 2.25em;} +.citation ol li { + padding-left:0.75em;} diff --git a/docs/src/bibliography.md b/docs/src/bibliography.md new file mode 100644 index 000000000..a987675ae --- /dev/null +++ b/docs/src/bibliography.md @@ -0,0 +1,4 @@ +# Bibliography + +```@bibliography +``` diff --git a/docs/src/examples/solvers/Path planning.jl b/docs/src/examples/solvers/Path planning.jl index 968d1a995..0b022b71d 100644 --- a/docs/src/examples/solvers/Path planning.jl +++ b/docs/src/examples/solvers/Path planning.jl @@ -4,7 +4,7 @@ using Test #src #md # [![Binder](https://mybinder.org/badge_logo.svg)](@__BINDER_ROOT_URL__/generated/Path planning.ipynb) #md # [![nbviewer](https://img.shields.io/badge/show-nbviewer-579ACA.svg)](@__NBVIEWER_ROOT_URL__/generated/Path planning.ipynb) # -# This example was borrowed from [1, IX. Examples, A] whose dynamics comes from the model given in [2, Ch. 2.4]. +# This example was borrowed from [reissig2016feedback; IX. Examples, A](@cite) whose dynamics comes from the model given in [aastrom2007feedback; Ch. 2.4](@cite). # This is a **reachability problem** for a **continuous system**. # # Let us consider the 3-dimensional state space control system of the form @@ -24,7 +24,7 @@ using Test #src # In order to study the concrete system and its symbolic abstraction in a unified framework, we will solve the problem # for the sampled system with a sampling time $\tau$. # For the construction of the relations in the abstraction, it is necessary to over-approximate attainable sets of -# a particular cell. In this example, we consider the used of a growth bound function [1, VIII.2, VIII.5] which is one of the possible methods to over-approximate +# a particular cell. In this example, we consider the used of a growth bound function [reissig2016feedback; VIII.2, VIII.5](@cite) which is one of the possible methods to over-approximate # attainable sets of a particular cell based on the state reach by its center. # # For this reachability problem, the abstraction controller is built by solving a fixed-point equation which consists in computing the pre-image @@ -162,7 +162,3 @@ plot!( # We display the concrete trajectory plot!(control_trajectory; ms = 0.5) - -# ### References -# 1. G. Reissig, A. Weber and M. Rungger, "Feedback Refinement Relations for the Synthesis of Symbolic Controllers," in IEEE Transactions on Automatic Control, vol. 62, no. 4, pp. 1781-1796. -# 2. K. J. Aström and R. M. Murray, Feedback systems. Princeton University Press, Princeton, NJ, 2008. diff --git a/docs/src/references.bib b/docs/src/references.bib new file mode 100644 index 000000000..95b2890ad --- /dev/null +++ b/docs/src/references.bib @@ -0,0 +1,20 @@ +@article{reissig2016feedback, + title={Feedback refinement relations for the synthesis of symbolic controllers}, + author={Reissig, Gunther and Weber, Alexander and Rungger, Matthias}, + journal={IEEE Transactions on Automatic Control}, + volume={62}, + number={4}, + pages={1781--1796}, + year={2016}, + publisher={IEEE}, + doi={10.1109/CDC.2014.7039364} +} + +@article{aastrom2007feedback, + title={Feedback systems}, + author={{\AA}str{\"o}m, Karl Johan and Murray, Richard M}, + journal={An Introduction for Scientists and Engineers, Karl Johan Astr{\"o}m and Richard M Murray}, + pages={27--64}, + year={2007}, + publisher={Citeseer} +}