Skip to content

Commit 54234b4

Browse files
Datserismortenpi
andauthored
[WIP] JuliaDynamics documentation theme (#127)
* Basid doc theme * try to add font * Put variables before main import * work in progress, too tired for tonight! * color changes * link color and hovering (and try to make travis work) * consistent main colors * faster build [CHANGE THIS LATER!] * try on e more time to build on travis!!!! * try to build on travis on final time * slightly darker header color * make selection part white * decrease saturation, choose less colors, select=white * make sidebar text black * make other package links documetner accessible * Fix shadow * Use mp/theming branch of Documenter Contains updates to sidebar color handling. * imrpove colros and shadows * make hyperlinks darker and more bluish * Update Documenter $code-background can now be overridden. * Remove right border from sidebar * Customize code blocks * Customize search box * ad awesome colors everywhere * nice correct searchbar * make mainwhite be pure white * use color of theme in textbox hovering * final tweaks, make hyperlink more green and more dark * Update Documenter Allow sidebar font sizes to be changed. * add possibility of different font size for sidebar * lighter hover color * try to use dark theme. * Dark theme based on light * add some customization on the dark theme * User correct dark theme structure * separatefiles into composable header * a lot of progress on dark theme; admonitions left to do * final dark+white theme + code syntax * fix admonitions * fix code bg in admonitions dark * Fix docstring shadow codeblocks * move scss files to a central repo * use raw path * ignore manifest * new documenter version * reverse testing * allow manifest * delete manifest * ignore manifest Co-authored-by: Morten Piibeleht <morten.piibeleht@gmail.com>
1 parent bf84dc8 commit 54234b4

6 files changed

Lines changed: 57 additions & 37 deletions

File tree

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,12 @@ $RECYCLE.BIN/
416416
## Acknowledgements
417417
# Many thanks to `https://gitignore.io/`, written and maintained by Joe Blau, which contributed much material to this gitignore file.
418418

419+
docs/build
420+
docs/data
421+
docs/src/assets/themes/*.css
419422
test/testdir
420423
src/update*
421424
test project
425+
juliadynamics-light.scss
426+
juliadynamics-dark.scss
427+
*.scss

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ matrix:
2323
os: linux
2424
script:
2525
- julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd()));
26-
Pkg.instantiate()'
26+
Pkg.instantiate();'
2727
- julia --project=docs/ docs/make.jl
2828
after_success: skip
2929
notifications:

docs/Project.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ BSON = "fbb218c0-5317-5bc6-957e-2ee96dd4b1f0"
33
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
44
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
55
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
6+
DocumenterTools = "35a29f4d-8980-5a13-9543-d66fff28ecb8"
67
DrWatson = "634d3b9d-ee7a-5ddf-bec9-22491ea816e1"
78
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
89
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
910
Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
1011
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
12+
13+
[compat]
14+
Documenter = "0.24.6"

docs/make.jl

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,26 @@
11
using Pkg
22
Pkg.activate(@__DIR__)
33
CI = get(ENV, "CI", nothing) == "true" || get(ENV, "GITHUB_TOKEN", nothing) !== nothing
4+
CI && Pkg.instantiate()
45
using DrWatson
56
using Documenter, DataFrames, Parameters, Dates, BSON, JLD2
7+
using DocumenterTools: Themes
68

79
# %%
10+
# download the themes
11+
for file in ("juliadynamics-lightdefs.scss", "juliadynamics-darkdefs.scss", "juliadynamics-style.scss")
12+
download("https://raw.githubusercontent.com/JuliaDynamics/doctheme/master/$file", joinpath(@__DIR__, file))
13+
end
14+
# create the themes
15+
for w in ("light", "dark")
16+
header = read(joinpath(@__DIR__, "juliadynamics-style.scss"), String)
17+
theme = read(joinpath(@__DIR__, "juliadynamics-$(w)defs.scss"), String)
18+
write(joinpath(@__DIR__, "juliadynamics-$(w).scss"), header*"\n"*theme)
19+
end
20+
# compile the themes
21+
Themes.compile(joinpath(@__DIR__, "juliadynamics-light.scss"), joinpath(@__DIR__, "src/assets/themes/documenter-light.css"))
22+
Themes.compile(joinpath(@__DIR__, "juliadynamics-dark.scss"), joinpath(@__DIR__, "src/assets/themes/documenter-dark.css"))
23+
824
isdir(datadir()) && rm(datadir(); force = true, recursive = true)
925

1026
makedocs(modules = [DrWatson],
@@ -13,7 +29,10 @@ authors = "George Datseris and contributors.",
1329
doctest = false,
1430
format = Documenter.HTML(
1531
prettyurls = CI,
16-
assets = ["assets/logo.ico"],
32+
assets = [
33+
"assets/logo.ico",
34+
asset("https://fonts.googleapis.com/css?family=Quicksand|Montserrat|Source+Code+Pro|Lora&display=swap", class=:css),
35+
],
1736
),
1837
pages = [
1938
"Introduction" => "index.md",

docs/src/index.md

Lines changed: 23 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![DrWatson](https://github.com/JuliaDynamics/JuliaDynamics/blob/master/videos/drwatson/DrWatson-banner.png?raw=true)
1+
![DrWatson](https://github.com/JuliaDynamics/JuliaDynamics/blob/master/videos/drwatson/DrWatson-banner-nobg.png?raw=true)
22

33
---
44

@@ -8,14 +8,9 @@ It helps people manage their scientific projects (or any project for that matter
88
Specifically, it is a Julia package created to help people "deal" with their simulations, simulation parameters, where are files saved, experimental data, scripts, existing simulations, project source code, establishing reproducibility, and in general their scientific projects.
99

1010
See the [Functionality](@ref) section to get an impression of what you can do with DrWatson. To install, simply type `] add DrWatson` in your Julia session.
11+
DrWatson is part of [JuliaDynamics](https://juliadynamics.github.io/JuliaDynamics/), check out our [website](https://juliadynamics.github.io/JuliaDynamics/) for more cool stuff!
1112

12-
!!! info "JuliaDynamics"
13-
DrWatson is part of [JuliaDynamics](https://juliadynamics.github.io/JuliaDynamics/), check out our [website](https://juliadynamics.github.io/JuliaDynamics/) for more cool stuff!
14-
15-
!!! info "Poster for DrWatson"
16-
If you prefer having a concise and visual summary of DrWatson we have prepared a poster for it! Check out the [Poster](@ref) section!
17-
18-
!!! tip "Star us on GitHub!"
13+
!!! note "Star us on GitHub!"
1914
If you like DrWatson the please consider starring the [GitHub repository](https://github.com/JuliaDynamics/DrWatson.jl). This gives as an accurate lower bound of the number of people the software has helped!
2015

2116
## Rationale
@@ -61,9 +56,6 @@ DrWatson follows these simple principles:
6156

6257
This is why we believe DrWatson can help you focus on the science and not worry about project code management.
6358

64-
## Poster
65-
![poster DrWatson](https://github.com/JuliaDynamics/JuliaDynamics/blob/master/videos/drwatson/DrWatson-poster-1.0.0.jpg?raw=true)
66-
6759
## Inspirations
6860

6961
https://drivendata.github.io/cookiecutter-data-science/#cookiecutter-data-science
@@ -81,27 +73,27 @@ https://experimentator.readthedocs.io/en/latest/
8173
## Other useful packages
8274

8375
### Efficient code writing
84-
* https://github.com/mauro3/Parameters.jl
85-
* https://github.com/docopt/DocOpt.jl
86-
* https://github.com/vtjnash/Glob.jl
76+
* <https://github.com/mauro3/Parameters.jl>
77+
* <https://github.com/docopt/DocOpt.jl>
78+
* <https://github.com/vtjnash/Glob.jl>
8779

8880
### Notebooks
89-
* IJulia.jl
90-
* Weave.jl
81+
* <https://github.com/JuliaLang/IJulia.jl>
82+
* <https://github.com/JunoLab/Weave.jl>
9183

9284
### Documenting your code
93-
* Literate.jl
94-
* Documenter.jl
85+
* <https://github.com/JuliaDocs/Documenter.jl>
86+
* <https://github.com/fredrikekre/Literate.jl>
9587

9688
### Debugging, writing code
97-
* Juno
98-
* Revise.jl
99-
* Debugger.jl
89+
* <https://junolab.org/>
90+
* <https://github.com/timholy/Revise.jl>
91+
* <https://github.com/JuliaDebug/Debugger.jl>
10092

10193
### Performance measures
102-
* ProgressMeter.jl
103-
* BenchmarkTools.jl
104-
* https://github.com/KristofferC/TimerOutputs.jl
94+
* <https://github.com/JuliaCI/BenchmarkTools.jl>
95+
* <https://github.com/timholy/ProgressMeter.jl>
96+
* <https://github.com/KristofferC/TimerOutputs.jl>
10597
* ProfileViews.jl (similar available in Juno with `@profiler`)
10698

10799
### Saving Data
@@ -110,15 +102,15 @@ https://experimentator.readthedocs.io/en/latest/
110102
* CSV.jl
111103

112104
### Data management & data bases
113-
* https://github.com/helgee/RemoteFiles.jl
114-
* https://github.com/JuliaDynamics/CaosDB.jl
115-
* https://juliadb.org/
116-
* https://github.com/SebastianM-C/StorageGraphs.jl
105+
* <https://github.com/helgee/RemoteFiles.jl>
106+
* <https://github.com/JuliaDynamics/CaosDB.jl>
107+
* <https://juliadb.org/>
108+
* <https://github.com/SebastianM-C/StorageGraphs.jl>
117109

118110
### Tabular data
119-
* https://juliadata.github.io/DataFrames.jl/stable/
120-
* https://www.queryverse.org/
111+
* <https://juliadata.github.io/DataFrames.jl/stable/>
112+
* <https://www.queryverse.org/>
121113

122114
### Traversing folders
123115
* Base.Filesystem
124-
* https://github.com/Keno/AbstractTrees.jl/blob/master/examples/fstree.jl
116+
* <https://github.com/Keno/AbstractTrees.jl/blob/master/examples/fstree.jl>

docs/src/save.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@ This page discusses numerous tools that can significantly improve process of sav
33

44
These tools are also used in the examples demonstrated in the [Real World Examples](@ref) page. After reading the proper documentation here it might be worth it to have a look there as well!
55

6-
!!! info "Saving and loading files"
7-
In DrWatson we save and load files with the functions `wsave(filename, data)` and `wload(filename)`. These functions are further used in the tools below, like e.g. [`tagsave`](@ref) and can be overloaded for your own specific datatype.
6+
In DrWatson we save and load files with the functions `wsave(filename, data)` and `wload(filename)`. These functions are further used in the tools below, like e.g. [`tagsave`](@ref) and can be overloaded for your own specific datatype.
87

9-
In addition, `wsave` **ensures** that `mkpath` is always called on the path you are trying to save your file at. We all know how unpleasant it is to run a 2-hour simulation and save no data because `FileIO.save` complains that the path you are trying to save does not exist...
8+
In addition, `wsave` **ensures** that `mkpath` is always called on the path you are trying to save your file at. We all know how unpleasant it is to run a 2-hour simulation and save no data because `FileIO.save` complains that the path you are trying to save at does not exist...
109

11-
To overload the saving part, add a new method to `DrWatson._wsave(filename, ::YourType)` (notice the `_`). By overloading `_wsave` you get all the extra functionality of [`tagsave`](@ref), [`safesave`](@ref), etc., for free for your own types (`tagsave` requires that you save your data as a dictionary).
10+
To overload the saving part, add a new method to `DrWatson._wsave(filename, ::YourType)` (notice the `_`). By overloading `_wsave` you get all the extra functionality of [`tagsave`](@ref), [`safesave`](@ref), etc., for free for your own types (`tagsave` requires that you save your data as a dictionary).
1211

1312
!!! warning "Saving and loading fallback"
1413
By default we fallback to `FileIO.save` and `FileIO.load` for and types.

0 commit comments

Comments
 (0)