@@ -3,79 +3,30 @@ sdt_path = dirname(dirname(Base.current_project()))
33push! (LOAD_PATH , sdt_path)
44using SpeciesDistributionToolkit
55
6- # Load the rest of the build environment
6+ # These packages are required to build the documentation website
77using Documenter
8- using DocumenterVitepress
98using DocumenterCitations
10- using GeoJSON
9+ using DocumenterVitepress
10+
11+ # These packages are used to generate the cards (for datasets) and pages (for the manual)
1112using Literate
1213using Markdown
1314using InteractiveUtils
1415using Dates
1516using PrettyTables
16- import Downloads
17-
18- # Download the bibliography from paperpile public URL
19- const bibfile = joinpath (@__DIR__ , " src" , " references.bib" )
20- const paperpile_url = " https://paperpile.com/eb/nimbzsGosN"
21- if isfile (bibfile)
22- rm (bibfile)
23- end
24- Downloads. download (paperpile_url, bibfile)
25-
26- # Cleanup the bibliography file to make DocumenterCitations happy despite their
27- # refusal to acknowledge modern field names. The people will partu like it's
28- # 1971 and they will like it.
29- lines = readlines (bibfile)
30- open (bibfile, " w" ) do bfile
31- for line in lines
32- if contains (line, " journaltitle" )
33- println (bfile, replace (line, " journaltitle" => " journal" ))
34- elseif contains (line, " date" )
35- yrmatch = match (r" {(\d {4})" , line)
36- if ! isnothing (yrmatch)
37- println (bfile, " year = {$(yrmatch[1 ]) }," )
38- end
39- println (bfile, line)
40- else
41- println (bfile, line)
42- end
43- end
44- end
45- # Look how they massacred my boy
46-
47- bib = CitationBibliography (
48- bibfile;
49- style = :authoryear ,
50- )
51-
52- # Generate a report card for each known dataset
53- include (" dataset_report.jl" )
54- include (" polygon_report.jl" )
55-
56- # Additional functions to process the text when handled by Literate
57- include (" processing.jl" )
5817
59- # Changelogs
60- include (" changelogs.jl" )
18+ # We will maintain the path to the root of the documentation here. This is
19+ # important to ensure that the script building the documentation works.
20+ const docpath = dirname (@__FILE__ )
6121
62- # Render the tutorials and how-to using Literate
63- for folder in [" howto" , " tutorials" ]
64- fpath = joinpath (@__DIR__ , " src" , folder)
65- files_to_build = filter (endswith (" .jl" ), readdir (fpath; join = true ))
66- for docfile in files_to_build
67- if ~ isfile (replace (docfile, r" .jl$" => " .md" ))
68- Literate. markdown (
69- docfile, fpath;
70- flavor = Literate. DocumenterFlavor (),
71- config = Dict (" credit" => false , " execute" => true ),
72- preprocess = pre!,
73- postprocess = post!,
74- )
75- end
76- end
77- end
22+ # Steps required before the build
23+ include (joinpath (" steps" , " bibliography.jl" )) # References for the doc
24+ include (joinpath (" steps" , " changelogs.jl" )) # CHANGELOG files on the website
25+ include (joinpath (" steps" , " datasets.jl" )) # Prepare the datasets vignettes
26+ include (joinpath (" steps" , " polygons.jl" )) # Prepare the polygons vignettes
27+ include (joinpath (" steps" , " manual.jl" )) # Compile the manual (this is the big one!)
7828
29+ # This MAKES the docs - this is required to succeed before we can deploy the docs
7930makedocs (;
8031 sitename = " Species Distribution Toolkit" ,
8132 format = MarkdownVitepress (;
0 commit comments