Skip to content
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

Documentation fixes #108

Merged
merged 1 commit into from
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions doc/_static/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,8 @@ dl dd:not(:last-child) {
font-size: var(--toc-font-size);
text-align: center;
}

/* Align the copy button in the middle of the first line */
.highlight button.copybtn {
top: 0.25rem;
}
47 changes: 47 additions & 0 deletions doc/_static/css/notebooks.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/* This stylesheet is applied to nbsphinx notebooks only */

/* Hide execution count */
/* https://nbsphinx.readthedocs.io/en/latest/custom-css.html#For-a-Single-Notebook */
.nbinput .prompt,
.nboutput .prompt {
display: none;
}

/* Fix hidden rows in output of dataframes and pint quantities in dark mode */
/* Make colors hardcoded in nbsphinx/_static/nbsphinx-code-cells.css_t aware of the theme */
:root {
--nbsphinx-table-and-thead-border-color: black;
--nbsphinx-tbody-tr-nth-child-odd-color: #f5f5f5;
}

body[data-theme='dark'] {
--nbsphinx-table-and-thead-border-color: white;
--nbsphinx-tbody-tr-nth-child-odd-color: #5f5f5f;
}

@media (prefers-color-scheme: dark) {
body:not([data-theme="light"]) {
--nbsphinx-table-and-thead-border-color: white;
--nbsphinx-tbody-tr-nth-child-odd-color: #5f5f5f;
}
}

.jp-RenderedHTMLCommon table,
div.rendered_html table {
color: var(--nbsphinx-table-and-thead-border-color);
}

.jp-RenderedHTMLCommon thead,
div.rendered_html thead {
border-bottom: 1px solid var(--nbsphinx-table-and-thead-border-color);
}

.jp-RenderedHTMLCommon tbody tr:nth-child(odd),
div.rendered_html tbody tr:nth-child(odd) {
background: var(--nbsphinx-tbody-tr-nth-child-odd-color);
}

/* Disable copy button in output */
div.output_area > div > button.copybtn {
display: none;
}
9 changes: 3 additions & 6 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#
# import os
# import sys
from pathlib import Path

# sys.path.insert(0, os.path.abspath("../roseau/"))

Expand Down Expand Up @@ -133,15 +134,11 @@

# -- Options for intersphinx -------------------------------------------------
nbsphinx_execute = "never"
# Hide execution count https://nbsphinx.readthedocs.io/en/latest/custom-css.html#For-a-Single-Notebook
nbsphinx_prolog = """
nbsphinx_prolog = f"""
.. raw:: html

<style>
.nbinput .prompt,
.nboutput .prompt {
display: none;
}
{" ".join(Path("_static/css/notebooks.css").read_text().splitlines(keepends=True))}
</style>
"""

Expand Down
2 changes: 1 addition & 1 deletion doc/notebooks/Getting_Started.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@
"Roseau Load Flow uses the [Pint](https://pint.readthedocs.io/en/stable/) `Quantity` objects to\n",
"present the data in unit-agnostic way for the user. All input data (load powers, source voltages,\n",
"etc.) are expected to be either given in SI units or using the pint Quantity interface for non-SI\n",
"units (example below). The `length` parameter of the `Line` class that is an exception where the\n",
"units (example below). The `length` parameter of the `Line` class is an exception where the\n",
"default unit is Kilometers.\n",
"\n",
"Example, create a load with powers expressed in kVA:\n",
Expand Down