Skip to content

Commit

Permalink
Configure readthedocs builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
joaander committed May 18, 2024
1 parent a459602 commit 0a4ad20
Show file tree
Hide file tree
Showing 5 changed files with 210 additions and 5 deletions.
9 changes: 9 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 2
build:
os: "ubuntu-22.04"
commands:
- mkdir -p bin
- curl -sSL "https://github.com/rust-lang/mdBook/releases/download/v0.4.37/mdbook-v0.4.37-x86_64-unknown-linux-gnu.tar.gz" | tar -xvz --directory "bin"
- mkdir -p $READTHEDOCS_OUTPUT/html
- echo "site-url = \"/$READTHEDOCS_LANGUAGE/$READTHEDOCS_VERSION/\"" >> doc/book.toml
- bin/mdbook build doc --dest-dir=$READTHEDOCS_OUTPUT/html
1 change: 0 additions & 1 deletion DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,5 @@ status may take a long time, so it should display a progress bar.
without applying the additional submission filters.
- **workspace**: The location on the file system that contains **directories**.

# TODO: readthedocs builds
# TODO: logo
# TODO: Expand include to apply any to the array and allow condition or all elements.
8 changes: 5 additions & 3 deletions doc/book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ multilingual = false
src = "src"
title = "Row documentation"

[output.html]
git-repository-url = "https://github.com/glotzerlab/row"

[build]
create-missing = false

# Uncomment to enable link checking in docs. Normally these checks are only performed in CI.
# You also need to install https://github.com/Michael-F-Bryan/mdbook-linkcheck.
# [output.linkcheck]
# follow-web-links = true

# [output.html] must be the last table so that .readthedocs.yaml can easily add a key to it
[output.html]
git-repository-url = "https://github.com/glotzerlab/row"
additional-css = ["rtd.css"]
187 changes: 187 additions & 0 deletions doc/rtd.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
/* Read the Docs promotional block, only applicable to RTD.org
To support sphinx_rtd_theme, a `wy-menu` element is added. Other themes are
targeted using the theme identifier and use custom elements instead of a CSS
framework html structure.
*/

div.ethical-sidebar,
div.ethical-footer {
display: block !important;
}
.ethical-sidebar,
.ethical-footer {
padding: 0.5em;
margin: 1em 0;
}
.ethical-sidebar img,
.ethical-footer img {
width: 120px;
height: 90px;
display: inline-block;
}
.ethical-sidebar .ethical-callout,
.ethical-footer .ethical-callout {
padding-top: 1em;
clear: both;
}
.ethical-sidebar .ethical-pixel,
.ethical-footer .ethical-pixel,
.ethical-fixedfooter .ethical-pixel {
display: none !important;
}
.ethical-sidebar .ethical-text,
.ethical-footer .ethical-text {
margin-top: 1em;
}
.ethical-sidebar .ethical-image-link,
.ethical-footer .ethical-image-link {
border: 0;
}

.ethical-sidebar,
.ethical-footer {
background-color: #eee;
border: 1px solid #ccc;
border-radius: 5px;
color: #0a0a0a;
font-size: 14px;
line-height: 20px;
}

/* Techstack badging */
.ethical-sidebar ul {
margin: 0 !important;
padding-left: 0;
list-style: none;
}
.ethical-sidebar ul li {
display: inline-block;
background-color: lightskyblue;
color: black;
padding: 0.25em 0.4em;
font-size: 75%;
font-weight: 700;
margin: 0.25em;
border-radius: 0.25rem;
text-align: center;
vertical-align: baseline;
white-space: nowrap;
line-height: 1.41;
}
.ethical-sidebar ul li:not(:last-child) {
margin-right: .25rem;
}

.ethical-sidebar a,
.ethical-sidebar a:visited,
.ethical-sidebar a:hover,
.ethical-sidebar a:active,
.ethical-footer a,
.ethical-footer a:visited,
.ethical-footer a:hover,
.ethical-footer a:active {
color: #0a0a0a;
text-decoration: none !important;
border-bottom: 0 !important;
}

.ethical-callout a {
color: #707070 !important;
text-decoration: none !important;
}

/* Sidebar promotions */
.ethical-sidebar {
text-align: center;
max-width: 300px;
margin-left: auto;
margin-right: auto;
}

/* Footer promotions */
.ethical-footer {
text-align: left;

font-size: 14px;
line-height: 20px;
}
.ethical-footer img {
float: right;
margin-left: 25px;
}
.ethical-footer .ethical-callout {
text-align: center;
}
.ethical-footer small {
font-size: 10px;
}

/* Fixed footer promotions */
.ethical-fixedfooter {
box-sizing: border-box;
position: fixed;
bottom: 0;
left: 0;
z-index: 100;
background-color: #eee;
border-top: 1px solid #bfbfbf;
font-size: 12px;
line-height: 1.5;
padding: 0.5em 1.5em;
text-align: center;
color: #404040;
width: 100%; /* Fallback for Opera Mini */
width: 100vw;
}
@media (min-width: 769px) {
/* Improve viewing on non-mobile */
.ethical-fixedfooter {
font-size: 13px;
padding: 1em 1.5em;
}
}
.ethical-fixedfooter .ethical-text:before {
margin-right: 4px;
padding: 2px 6px;
border-radius: 3px;
background-color: #4caf50;
color: #fff;
content: "Sponsored";
}
.ethical-fixedfooter .ethical-callout {
color: #999;
padding-left: 6px;
white-space: nowrap;
}
.ethical-fixedfooter a,
.ethical-fixedfooter a:hover,
.ethical-fixedfooter a:active,
.ethical-fixedfooter a:visited {
color: #404040;
text-decoration: none;
}
.ethical-fixedfooter .ethical-close {
position: absolute;
top: 0;
right: 5px;
font-size: 20px;
line-height: 20px;
}

/* Use mdbook theme colors. */

.ethical-sidebar {
border: none;
box-shadow: none;
background: var(--sidebar-bg);
}

.ethical-sidebar:hover {
background: var(--sidebar-non-existant);
}

.ethical-sidebar a {
color: var(--sidebar-fg);
}
10 changes: 9 additions & 1 deletion doc/theme/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,14 @@
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
<div class="sidebar-scrollbox">
{{#toc}}{{/toc}}
<div
id="sidebar-ad-placement"
class="flat"
data-ea-publisher="readthedocs"
data-ea-type="readthedocs-sidebar"
data-ea-manual="true"
style="width: 70%; margin: 0 auto;"
></div>
</div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle">
<div class="sidebar-resize-indicator"></div>
Expand Down Expand Up @@ -216,7 +224,7 @@

<!-- Page footer -->
<hr>
<div class="left">
<div class="left" style="width: 75%">
<p>Development of <b>row</b> is led by the <a href="https://glotzerlab.engin.umich.edu">Glotzer Group</a> at the <a href="https://umich.edu">University of Michigan</a>.
<p>Copyright &#169; 2024 The Regents of the University of Michigan.
</div>
Expand Down

0 comments on commit 0a4ad20

Please sign in to comment.