Skip to content

Commit e46efef

Browse files
committed
Docs and PyPI
1 parent 8db9891 commit e46efef

File tree

22 files changed

+554
-102
lines changed

22 files changed

+554
-102
lines changed

.github/workflows/python-publish.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Upload Python Package
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
pypi-publish:
12+
name: Upload release to PyPI
13+
runs-on: ubuntu-latest
14+
environment: pypi
15+
permissions:
16+
id-token: write
17+
steps:
18+
- name: Check out repository
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Set up Python
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: "3.x"
27+
28+
- name: Install build dependencies
29+
run: python -m pip install --upgrade build
30+
31+
- name: Build package distribution
32+
run: python -m build --sdist
33+
34+
- name: Publish package distributions to PyPI
35+
uses: pypa/gh-action-pypi-publish@release/v1

.readthedocs.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: 2
2+
3+
build:
4+
os: ubuntu-24.04
5+
tools:
6+
python: "3.10"
7+
commands:
8+
- python -m pip install .
9+
- python -m pip install --no-cache-dir -r docs/requirements.txt
10+
- python -m sphinx -E -b html docs $READTHEDOCS_OUTPUT/html
11+
12+
sphinx:
13+
configuration: docs/conf.py

docs/_static/styles/my_theme.css

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
@import url("theme.css");
22
@import url("https://fonts.googleapis.com/css2?family=Mona+Sans:ital,wght@0,200..900;1,200..900&family=Geist:wght@100..900&&family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&family=Outfit:wght@100..900&display=swap");
33

4-
@media (min-width: 960px) {
4+
/*@media (min-width: 960px) {
55
.bd-page-width {
66
max-width: 120rem;
77
}
8-
}
8+
}*/
99

1010
#rtd-footer-container {
1111
margin-top: 0 !important;
@@ -59,6 +59,18 @@ body {
5959
max-width: 100%; /* default is 60em */
6060
}
6161

62-
.bd-sidebar-primary {
63-
width: 18%;
64-
}
62+
/*.bd-sidebar-primary {
63+
max-width: 20%;
64+
}*/
65+
66+
/* Ensure links in code blocks are underlined */
67+
.highlight a {
68+
text-decoration: underline;
69+
color: #394198; /* Adjust color as needed */
70+
}
71+
72+
/* For additional emphasis, change hover effect */
73+
.highlight a:hover {
74+
text-decoration: underline;
75+
color: #9090ff;
76+
}

docs/_templates/autoapi/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
API Reference
22
=============
33

4+
Start at :class:`barecat.Barecat` to explore the API.
5+
46
.. toctree::
57
:titlesonly:
68

docs/_templates/autoapi/python/class.rst

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
:html_theme.sidebar_secondary.remove: true
2+
13
{% if obj.display %}
24
{% if is_own_page %}
35
{{ obj.name }}
@@ -100,20 +102,47 @@ Classes
100102

101103

102104
{% endif %}
103-
{% set visible_methods = own_page_children|selectattr("type", "equalto", "method")|list %}
104-
{% if visible_methods %}
105-
Methods
106-
-------
105+
106+
{% set static_methods = own_page_children|selectattr("type", "equalto", "method")|selectattr("properties", "defined")|selectattr("properties", "equalto", ["staticmethod"])|list %}
107+
{% set class_methods = own_page_children|selectattr("type", "equalto", "method")|selectattr("properties", "defined")|selectattr("properties", "equalto", ["classmethod"])|list %}
108+
{% set instance_methods = own_page_children|selectattr("type", "equalto", "method")|rejectattr("properties", "equalto", ["staticmethod"])|rejectattr("properties", "equalto", ["classmethod"])|list %}
109+
110+
{% if instance_methods %}
111+
Instance Methods
112+
----------------
107113

108114
.. autoapisummary::
109115

110-
{% for method in visible_methods %}
116+
{% for method in instance_methods %}
111117
{{ method.id }}
112-
{% endfor %}
118+
{% endfor %}
113119

114120

115121
{% endif %}
122+
{% if class_methods %}
123+
Class Methods
124+
-------------
125+
126+
.. autoapisummary::
127+
128+
{% for method in class_methods %}
129+
{{ method.id }}
130+
{% endfor %}
116131

132+
133+
{% endif %}
134+
{% if static_methods %}
135+
Static Methods
136+
--------------
137+
138+
.. autoapisummary::
139+
140+
{% for method in static_methods %}
141+
{{ method.id }}
142+
{% endfor %}
143+
144+
145+
{% endif %}
117146
{% endif %}
118147
{% endif %}
119148

docs/_templates/autoapi/python/data.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
:html_theme.sidebar_secondary.remove: true
2+
13
{% if obj.display %}
24
{% if is_own_page %}
35
{{ obj.name }}

docs/_templates/autoapi/python/function.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
:html_theme.sidebar_secondary.remove: true
2+
13
{% if obj.display %}
24
{% if is_own_page %}
35
{{ obj.name }}

docs/_templates/autoapi/python/method.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
:html_theme.sidebar_secondary.remove: true
2+
13
{% if obj.display %}
24
{% if is_own_page %}
35
{{ obj.name }}

docs/_templates/autoapi/python/module.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
:html_theme.sidebar_secondary.remove: true
2+
13
{% if obj.display %}
24
{% if is_own_page %}
35
{{ obj.id }}

docs/_templates/autoapi/python/property.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
:html_theme.sidebar_secondary.remove: true
2+
13
{% if obj.display %}
24
{% if is_own_page %}
35
{{ obj.name }}

0 commit comments

Comments
 (0)