Skip to content

Commit 1be8f95

Browse files
committed
circle
1 parent 8249313 commit 1be8f95

File tree

4 files changed

+58
-8
lines changed

4 files changed

+58
-8
lines changed

.circleci/config.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
version: 2
2+
jobs:
3+
build_docs:
4+
docker:
5+
- image: circleci/python:3.6-stretch
6+
steps:
7+
# Get our data and merge with upstream
8+
- run: sudo apt-get update
9+
- checkout
10+
11+
- restore_cache:
12+
keys:
13+
- cache-pip
14+
15+
- run: pip install --user .[sphinx]
16+
17+
- save_cache:
18+
key: cache-pip
19+
paths:
20+
- ~/.cache/pip
21+
22+
# Build the docs
23+
- run:
24+
name: Build docs to store
25+
command: |
26+
cd docs
27+
make html
28+
29+
- store_artifacts:
30+
path: docs/_build/html/
31+
destination: html
32+
33+
34+
workflows:
35+
version: 2
36+
default:
37+
jobs:
38+
- build_docs

setup.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
import os
2-
2+
from pathlib import Path
33
from setuptools import setup, find_packages
4-
from sphinx_togglebutton import __version__
4+
5+
version = [
6+
line
7+
for line in Path("sphinx_togglebutton/__init__.py").read_text().split()
8+
if "__version__" in line
9+
]
10+
version = version[0].split(" = ")[-1]
511

612
with open("./README.rst", "r") as ff:
713
readme_text = ff.read()
814

915
setup(
1016
name="sphinx-togglebutton",
11-
version=__version__,
17+
version=version,
1218
description="Add a toggle button to items on a page.",
1319
long_description=readme_text,
1420
long_description_content_type="text/x-rst",
@@ -20,7 +26,7 @@
2026
package_data={
2127
"sphinx_togglebutton": ["_static/togglebutton.css", "_static/togglebutton.js"]
2228
},
23-
install_requires=["setuptools", "wheel", "sphinx"],
24-
extras_require={"sphinx": ["sphinx", "myst_nb"]},
29+
install_requires=["setuptools", "wheel", "sphinx", "docutils"],
30+
extras_require={"sphinx": ["myst_nb"]},
2531
classifiers=["License :: OSI Approved :: MIT License"],
2632
)

sphinx_togglebutton/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""A small sphinx extension to add "toggle" buttons to items."""
22
import os
3-
import sphinx
43
from docutils.parsers.rst import Directive, directives
54
from docutils import nodes
65

sphinx_togglebutton/_static/togglebutton.css

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,20 @@
1111
padding: 0px !important;
1212
}
1313

14+
/* Toggle buttons inside admonitions so we see the title */
15+
.toggle-body {
16+
position: relative;
17+
}
18+
1419
.toggle-body .admonition-title:after {
1520
content: "";
1621
}
1722

1823
.toggle-body button.toggle-button {
1924
margin-right: 0.5em;
2025
right: 0em;
26+
position: absolute;
27+
top: .3em;
2128
}
2229

2330
/* These should be totally hidden since they're inside an admonition */
@@ -47,8 +54,8 @@ button.toggle-button {
4754
button.toggle-button.toggle-button-hidden:before {
4855
content: "Click to show";
4956
position: absolute;
50-
left: -7em;
51-
bottom: .5em;
57+
left: -6.5em;
58+
bottom: .4em;
5259
}
5360

5461
/* Plus / minus toggles */

0 commit comments

Comments
 (0)