Skip to content

Commit

Permalink
Attempt adapting the Equinox documentation setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Ceyron committed Jun 20, 2024
1 parent 1476cd3 commit c1676f0
Show file tree
Hide file tree
Showing 13 changed files with 374 additions and 111 deletions.
1 change: 1 addition & 0 deletions docs/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ErrorDocument 404 /equinox/404.html
20 changes: 0 additions & 20 deletions docs/Makefile

This file was deleted.

20 changes: 20 additions & 0 deletions docs/_overrides/partials/source.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{% import "partials/language.html" as lang with context %}
<a href="{{ config.repo_url }}" title="{{ lang.t('source.link.title') }}" class="md-source" data-md-component="source">
<div class="md-source__icon md-icon">
{% set icon = config.theme.icon.repo or "fontawesome/brands/git-alt" %}
{% include ".icons/" ~ icon ~ ".svg" %}
</div>
<div class="md-source__repository">
{{ config.repo_name }}
</div>
</a>
{% if config.theme.twitter_url %}
<a href="{{ config.theme.twitter_url }}" title="Go to Twitter" class="md-source">
<div class="md-source__icon md-icon">
{% include ".icons/fontawesome/brands/twitter.svg" %}
</div>
<div class="md-source__repository">
{{ config.theme.twitter_name }}
</div>
</a>
{% endif %}
162 changes: 162 additions & 0 deletions docs/_static/custom_css.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
/* Fix /page#foo going to the top of the viewport and being hidden by the navbar */
html {
scroll-padding-top: 50px;
}

/* Fit the Twitter handle alongside the GitHub one in the top right. */

div.md-header__source {
width: revert;
max-width: revert;
}

a.md-source {
display: inline-block;
}

.md-source__repository {
max-width: 100%;
}

/* Emphasise sections of nav on left hand side */

nav.md-nav {
padding-left: 5px;
}

nav.md-nav--secondary {
border-left: revert !important;
}

.md-nav__title {
font-size: 0.9rem;
}

.md-nav__item--section > .md-nav__link {
font-size: 0.9rem;
}

/* Indent autogenerated documentation */

div.doc-contents {
padding-left: 25px;
border-left: 4px solid rgba(230, 230, 230);
}

/* Increase visibility of splitters "---" */

[data-md-color-scheme="default"] .md-typeset hr {
border-bottom-color: rgb(0, 0, 0);
border-bottom-width: 1pt;
}

[data-md-color-scheme="slate"] .md-typeset hr {
border-bottom-color: rgb(230, 230, 230);
}

/* More space at the bottom of the page */

.md-main__inner {
margin-bottom: 1.5rem;
}

/* Remove prev/next footer buttons */

.md-footer__inner {
display: none;
}

/* Change font sizes */

html {
/* Decrease font size for overall webpage
Down from 137.5% which is the Material default */
font-size: 110%;
}

.md-typeset .admonition {
/* Increase font size in admonitions */
font-size: 100% !important;
}

.md-typeset details {
/* Increase font size in details */
font-size: 100% !important;
}

.md-typeset h1 {
font-size: 1.6rem;
}

.md-typeset h2 {
font-size: 1.5rem;
}

.md-typeset h3 {
font-size: 1.3rem;
}

.md-typeset h4 {
font-size: 1.1rem;
}

.md-typeset h5 {
font-size: 0.9rem;
}

.md-typeset h6 {
font-size: 0.8rem;
}

/* Bugfix: remove the superfluous parts generated when doing:
??? Blah
::: library.something
*/

.md-typeset details .mkdocstrings > h4 {
display: none;
}

.md-typeset details .mkdocstrings > h5 {
display: none;
}

/* Change default colours for <a> tags */

[data-md-color-scheme="default"] {
--md-typeset-a-color: rgb(0, 189, 164) !important;
}
[data-md-color-scheme="slate"] {
--md-typeset-a-color: rgb(0, 189, 164) !important;
}

/* Highlight functions, classes etc. type signatures. Really helps to make clear where
one item ends and another begins. */

[data-md-color-scheme="default"] {
--doc-heading-color: #DDD;
--doc-heading-border-color: #CCC;
--doc-heading-color-alt: #F0F0F0;
}
[data-md-color-scheme="slate"] {
--doc-heading-color: rgb(25,25,33);
--doc-heading-border-color: rgb(25,25,33);
--doc-heading-color-alt: rgb(33,33,44);
--md-code-bg-color: rgb(38,38,50);
}

h4.doc-heading {
/* NOT var(--md-code-bg-color) as that's not visually distinct from other code blocks.*/
background-color: var(--doc-heading-color);
border: solid var(--doc-heading-border-color);
border-width: 1.5pt;
border-radius: 2pt;
padding: 0pt 5pt 2pt 5pt;
}
h5.doc-heading, h6.heading {
background-color: var(--doc-heading-color-alt);
border-radius: 2pt;
padding: 0pt 5pt 2pt 5pt;
}
16 changes: 16 additions & 0 deletions docs/_static/mathjax.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
window.MathJax = {
tex: {
inlineMath: [["\\(", "\\)"]],
displayMath: [["\\[", "\\]"]],
processEscapes: true,
processEnvironments: true
},
options: {
ignoreHtmlClass: ".*|",
processHtmlClass: "arithmatex"
}
};

document$.subscribe(() => {
MathJax.typesetPromise()
})
5 changes: 5 additions & 0 deletions docs/api/etdrk/etdrk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# ETDRK

::: exponax.etdrk.ETDRK0

::: exponax.etdrk.ETDRK1
3 changes: 3 additions & 0 deletions docs/api/stepper/linear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Linear Stepper

::: exponax.stepper.Advection
49 changes: 0 additions & 49 deletions docs/conf.py

This file was deleted.

6 changes: 0 additions & 6 deletions docs/index.rst

This file was deleted.

35 changes: 0 additions & 35 deletions docs/make.bat

This file was deleted.

15 changes: 14 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
sphinx==7.0.1
mkdocs==1.3.0 # Main documentation generator.
mkdocs-material==7.3.6 # Theme
pymdown-extensions==9.4 # Markdown extensions e.g. to handle LaTeX.
mkdocstrings==0.17.0 # Autogenerate documentation from docstrings.
mknotebooks==0.7.1 # Turn Jupyter Lab notebooks into webpages.
pytkdocs_tweaks==0.0.8 # Tweaks mkdocstrings to improve various aspects
mkdocs_include_exclude_files==0.0.1 # Tweak which files are included/excluded
jinja2==3.0.3 # Older version. After 3.1.0 seems to be incompatible with current versions of mkdocstrings.
pygments==2.14.0
nbconvert==6.5.0 # Fix https://github.com/patrick-kidger/equinox/issues/428

jax[cpu]
equinox
matplotlib
Empty file removed docs/static/.empty
Empty file.
Loading

0 comments on commit c1676f0

Please sign in to comment.