Skip to content

Commit

Permalink
Merge pull request #3260 from agriyakhetarpal/docs-pdf-fix
Browse files Browse the repository at this point in the history
Re-enable PDF builds for Read the Docs
  • Loading branch information
Saransh-cpp authored Aug 10, 2023
2 parents a80bca5 + cac25b1 commit aebe311
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 47 deletions.
1 change: 1 addition & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ sphinx:
fail_on_warning: false

formats:
- pdf
- epub
- htmlzip

Expand Down
55 changes: 16 additions & 39 deletions docs/_static/pybamm.css
Original file line number Diff line number Diff line change
@@ -1,41 +1,11 @@
@import url("https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,400;0,700;0,900;1,400;1,700;1,900&family=Open+Sans:ital,wght@0,400;0,600;1,400;1,600&display=swap");

.navbar-brand img {
height: 50px;
}
/* Font */

.navbar-brand {
height: 50px;
}
@import url("https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,400;0,700;0,900;1,400;1,700;1,900&family=Open+Sans:ital,wght@0,400;0,600;1,400;1,600&display=swap");

body {
font-family: "Open Sans", sans-serif;
}

pre,
code {
font-size: 100%;
line-height: 155%;
}

h1 {
font-family: "Lato", sans-serif;
color: #013243;
/* warm black */
}

h2 {
color: #4d77cf;
/* han blue */
letter-spacing: -0.03em;
}

h3 {
color: #013243;
/* warm black */
letter-spacing: -0.03em;
}

/* Main page overview cards */

.sd-card {
Expand Down Expand Up @@ -81,18 +51,18 @@ h3 {
}

/* Dark theme tweaking */

html[data-theme="dark"] .sd-card img[src*=".svg"] {
filter: invert(0.82) brightness(0.8) contrast(1.2);
}

/* Main index page overview cards */

html[data-theme="dark"] .sd-card {
background-color: var(--pst-color-background);
}

html[data-theme="dark"] .sd-shadow-sm {
box-shadow: 0 0.1rem 1rem rgba(250, 250, 250, 0.6) !important;
}
/* Inheritance diagram dropdown options */

html[data-theme="dark"] .sd-card .sd-card-header {
background-color: var(--pst-color-background);
Expand All @@ -103,12 +73,12 @@ html[data-theme="dark"] .sd-card .sd-card-footer {
background-color: var(--pst-color-background);
}

html[data-theme="dark"] h1 {
color: var(--pst-color-primary);
details.sd-dropdown {
box-shadow: none !important;
}

html[data-theme="dark"] h3 {
color: #0a6774;
.sd-summary-content blockquote {
border-left: 0 !important;
}

/* Overrides for sphinx-hoverxref since it does not support a native dark theme, see */
Expand Down Expand Up @@ -139,6 +109,12 @@ html[data-theme="dark"] h3 {

@import url("https://cdn.jsdelivr.net/npm/@docsearch/css@3");

/* Remove the default PST search */

div.search-button__wrapper.show {
visibility: hidden;
}

.DocSearch-Modal {
margin: 150px auto auto;
background: var(--pst-color-background);
Expand All @@ -158,6 +134,7 @@ kbd.DocSearch-Commands-Key {
.DocSearch-Button-Key {
width: 24px;
}

/* Do not add custom padding for keyboard buttons */

kbd:not(.compound) {
Expand Down
21 changes: 13 additions & 8 deletions docs/sphinxext/inheritance_diagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,21 @@ def add_diagram(app, what, name, obj, options, lines):
# do nothing if it is not a derived class
return

# Append the inheritance diagram to the docstring
# Append the inheritance diagram to the docstring. Note: we do this
# for HTML output only because SVG output creates multiple PDFs which
# are not supported by Read the Docs.
# https://github.com/readthedocs/readthedocs.org/issues/2045
lines.append("\n")
lines.append(".. dropdown:: View inheritance diagram for this model")
lines.append(" :animate: fade-in-slide-down")
lines.append(" :icon: eye\n")
lines.append(" :class-title: sd-align-major-center sd-fs-6 \n")
lines.append(" :class-container: sd-text-info \n")
lines.append(".. only:: not latex\n")
lines.append("\n")
lines.append(" .. inheritance-diagram:: " + cls_name)
lines.append(" :parts: 2\n")
lines.append(" .. dropdown:: View inheritance diagram for this model")
lines.append(" :animate: fade-in-slide-down")
lines.append(" :icon: eye\n")
lines.append(" :class-title: sd-align-major-center sd-fs-6 \n")
lines.append(" :class-container: sd-text-info \n")
lines.append("\n")
lines.append(" .. inheritance-diagram:: " + cls_name)
lines.append(" :parts: 2\n")
lines.append("\n")


Expand Down

0 comments on commit aebe311

Please sign in to comment.