Skip to content

Commit

Permalink
Merge pull request #42 from s-weigand/fix-docs-style
Browse files Browse the repository at this point in the history
Fix docs html styling problem with 'sphinx-copybutton'
  • Loading branch information
s-weigand committed Oct 6, 2019
2 parents 4a1743b + 364e811 commit 46c42c3
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,6 @@ docs/**/**/images/

# this is just a symlinks and needs no changing
docs/readme.md

# map files for the css, generated from the scss files
*.css.map
28 changes: 28 additions & 0 deletions docs/_static/css/copy-btn-overwrite.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions docs/_static/css/copy-btn-overwrite.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
div.nbinput div.input_area,
div.nboutput div.output_area {
padding: 0 !important;
}
div.nbinput,
div.nbinput div.prompt,
div.nbinput div.input_area,
div.nbinput div[class*="highlight"],
div.nbinput div[class*="highlight"] pre,
div.nboutput,
div.nbinput div.prompt,
div.nbinput div.output_area,
div.nboutput div[class*="highlight"],
div.nboutput div[class*="highlight"] pre {
padding: 0.2em !important;
}

a.copybtn {
padding: 0;
width: 0.8em;
height: 0.8em;
}

.prompt.highlight-none.notranslate {
a.copybtn {
display: none;
}
}
5 changes: 4 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
# html_static_path = ["_static"]
html_static_path = ["_static"]


# -- Options for HTMLHelp output ---------------------------------------
Expand Down Expand Up @@ -245,3 +245,6 @@
)
]


def setup(app):
app.add_stylesheet("css/copy-btn-overwrite.css")

0 comments on commit 46c42c3

Please sign in to comment.