-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add skeleton of mkdocs #526
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #526 +/- ##
==========================================
+ Coverage 94.98% 95.00% +0.01%
==========================================
Files 24 24
Lines 3290 3301 +11
Branches 702 651 -51
==========================================
+ Hits 3125 3136 +11
Misses 96 96
Partials 69 69
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For math to be rendered, do you just need to add the relevant config and javascript?
requirements/mkdocs.yml
Outdated
dependencies: | ||
- python = 3.12 | ||
- pip | ||
- pip: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
most of the mkdocs stuff can be installed from conda-forge
so I would move them out of pip where possible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -0,0 +1,39 @@ | |||
# Calliope: energy system modelling made simple | |||
|
|||
!!! note |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem necessary. RTD allows for version warnings: https://docs.readthedocs.io/en/stable/versions.html#version-warning
Then you don't need to track version in the mkdocs config and don't need to worry about making it dynamic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, but I think it's still nice to show the version in the built docs if that's possible without too much effort.
docs/index.md
Outdated
|
||
This is the documentation for version {{ version }} ([Version history](version_history.md)). See the [main project website at www.callio.pe](https://www.callio.pe/) for more general information, including a gallery of models built with Calliope, and other useful information. | ||
|
||
Calliope focuses on flexibility, high spatial and temporal resolution, the ability to execute many runs based on the same base model, and a clear separation of framework (code) and model (data). Its primary focus is on planning energy systems at scales ranging from urban districts to entire continents. In an optional operational mode it can also test a pre-defined system under different operational conditions. Calliope's built-in tools allow interactive exploration of results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to follow the convention of one sentence per line so that future git diffs are simpler. Here's a proponent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
docs/pre_build/generate_math.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is showing up as brand new. Have any changes been made from the other version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor changes. I'll move the old file to the new location in a next commit so that the changes are visible.
docs/version_history.md
Outdated
@@ -0,0 +1,5 @@ | |||
# Version history | |||
|
|||
{% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--8<-- CHANGELOG.md
if using pymdownx.snippets
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried that, but the on_page_markdown
hook in changelog_highlight.py
doesn't work with snippets and I'm not sure why. Possibly because the snippets pre-processor runs after that. So I propose to stick to this as-is for now.
Not enough if you want the fenced blocks to work (```math ...). The easiest solution might just be to replace those with the From https://facelessuser.github.io/pymdown-extensions/extensions/arithmatex/#alternative-math-blocks I gather something like this ought to work but it doesn't so far:
|
* Removed `ruamel.yaml`, `myst-parser` and `nbconvert` from requirements
First skeleton of mkdocs
Open issues:
custom_math.py
could also run throughgen-files
but because it is quite slow, I think it's better to run it in a seprate pre_build step. Already including those generated markdown files let's build time increase from ~1 second to around 10 seconds, so there is some issue with them anyway. The idea for now would be to runpython ./pre_build/generate_math.py
and any other pre-build steps manually (and in the case of readthedocs, add this as pre-build steps in the readthedocs configuration).extra: version: 0.7.0
in the configuration should come from the installed calliope module, not be hardcoded in the config fileThe idea would be to sort out any issues with the basic setup here, merge this basic setup, then revise and move over the remaining documentation step-by-step, thus also moving from the old
doc
to the newdocs
directory.Reviewer checklist: