Skip to content

Commit 379e177

Browse files
authored
Merge pull request #47 from Embarcadero/add-sphinx-docs
Added the Sphinx docs and configuration to host the docs on GitHub pages
2 parents 1eafc9a + 9f77e05 commit 379e177

File tree

136 files changed

+13057
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+13057
-0
lines changed

.github/workflows/sphinx-build.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Docs
2+
on:
3+
# Manual run
4+
workflow_dispatch:
5+
permissions:
6+
contents: write
7+
jobs:
8+
docs:
9+
runs-on: windows-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- uses: actions/setup-python@v3
13+
- name: Install dependencies
14+
run: |
15+
pip install sphinx sphinx_rtd_theme
16+
pip install --exists-action=w --no-cache-dir -r docs/requirements.txt
17+
pip install --exists-action=w --no-cache-dir -r docs/rtd-requirements.txt
18+
- name: Sphinx build
19+
run: |
20+
sphinx-build docs/source _build
21+
dir
22+
- name: Deploy
23+
uses: peaceiris/actions-gh-pages@v3
24+
# if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
25+
with:
26+
publish_branch: gh-pages
27+
github_token: ${{ secrets.GITHUB_TOKEN }}
28+
publish_dir: _build/
29+
force_orphan: true

.readthedocs.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# .readthedocs.yml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4+
5+
# Required
6+
version: 2
7+
8+
# Build documentation in the docs/ directory with Sphinx
9+
sphinx:
10+
configuration: docs/source/conf.py
11+
12+
# Optionally build your docs in additional formats such as PDF and ePub
13+
formats: all

docs/requirements.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
delphivcl
2+
furo
3+
myst-parser
4+
sphinx
5+
sphinx-copybutton
6+
sphinxext-opengraph

docs/rtd-requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
sphinxcontrib-programoutput

docs/source/_static/DelphiVCL4Python-sidebar-dark.svg

Lines changed: 1 addition & 0 deletions
Loading

docs/source/_static/DelphiVCL4Python-sidebar.svg

Lines changed: 1 addition & 0 deletions
Loading

docs/source/_static/custom.css

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
@media (prefers-color-scheme: dark) {
2+
span.nc {
3+
text-decoration: none !important;
4+
}
5+
}
6+
7+
p.rubric{
8+
text-transform: capitalize;
9+
font-size: 1.25rem;
10+
font-weight: bold;
11+
}
12+
13+
.sig-param{
14+
color: var(--color-content-foreground);
15+
}
16+
17+
dl.c .field-list dt, dl.cpp .field-list dt, dl.js .field-list dt, dl.py .field-list dt {
18+
text-transform: capitalize;
19+
font-weight: bold;
20+
font-size: var(--font-size--normal);
21+
}
22+
23+
h4, h5, h6{
24+
text-transform: none;
25+
}
26+
27+
.sidebar-tree a.internal.reference {
28+
display: table-cell;
29+
}

docs/source/_static/favicon.ico

270 KB
Binary file not shown.

docs/source/_static/responsiveSvg.js

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
2+
window.addEventListener("load", function () {
3+
const styleElements = []
4+
const colorSchemeQuery = window.matchMedia('(prefers-color-scheme: dark)');
5+
const diagrams = document.querySelectorAll("object.inheritance.graphviz");
6+
7+
for (let diagram of diagrams) {
8+
style = document.createElement('style');
9+
styleElements.push(style);
10+
console.log(diagram);
11+
diagram.contentDocument.firstElementChild.appendChild(style);
12+
}
13+
14+
function setColorScheme(e) {
15+
let colors, additions = "";
16+
if (e.matches) {
17+
// Dark
18+
colors = {
19+
text: "#e07a5f",
20+
box: "#383838",
21+
edge: "#d0d0d0",
22+
background: "#131416"
23+
};
24+
} else {
25+
// Light
26+
colors = {
27+
text: "#e07a5f",
28+
box: "#fff",
29+
edge: "#413c3c",
30+
background: "#ffffff"
31+
};
32+
additions = `
33+
.node polygon {
34+
filter: drop-shadow(0 1px 3px #0002);
35+
}
36+
`
37+
}
38+
for (let style of styleElements) {
39+
style.innerHTML = `
40+
svg {
41+
background-color: ${colors.background};
42+
}
43+
44+
.node text {
45+
fill: ${colors.text};
46+
}
47+
48+
.node polygon {
49+
fill: ${colors.box};
50+
}
51+
52+
.edge polygon {
53+
fill: ${colors.edge};
54+
stroke: ${colors.edge};
55+
}
56+
57+
.edge path {
58+
stroke: ${colors.edge};
59+
}
60+
${additions}
61+
`;
62+
}
63+
}
64+
65+
setColorScheme(colorSchemeQuery);
66+
colorSchemeQuery.addEventListener("change", setColorScheme);
67+
});
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{{ name | escape | underline}}
2+
3+
Qualified name: ``{{ fullname | escape }}``
4+
5+
.. currentmodule:: {{ module }}
6+
7+
.. autoclass:: {{ objname }}
8+
:show-inheritance:
9+
:members:
10+
11+
{% block methods %}
12+
{%- if methods %}
13+
.. rubric:: {{ _('Methods') }}
14+
15+
.. autosummary::
16+
:nosignatures:
17+
{% for item in methods if item != '__init__' and item not in inherited_members %}
18+
~{{ name }}.{{ item }}
19+
{%- endfor %}
20+
{%- endif %}
21+
{%- endblock %}
22+
23+
{% block attributes %}
24+
{%- if attributes %}
25+
.. rubric:: {{ _('Attributes') }}
26+
27+
.. autosummary::
28+
{% for item in attributes %}
29+
~{{ name }}.{{ item }}
30+
{%- endfor %}
31+
{%- endif %}
32+
{% endblock %}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{{ name | escape | underline }}
2+
3+
.. currentmodule:: {{ fullname }}
4+
5+
.. automodule:: {{ fullname }}
6+
7+
{% block attributes %}
8+
{% if attributes %}
9+
.. rubric:: Module Attributes
10+
11+
.. autosummary::
12+
{% for item in attributes %}
13+
{{ item }}
14+
{%- endfor %}
15+
{% endif %}
16+
{% endblock %}
17+
18+
{% block classes %}
19+
{% if classes %}
20+
.. rubric:: Classes
21+
22+
.. autosummary::
23+
:toctree: .
24+
:nosignatures:
25+
{% for class in classes %}
26+
{{ class }}
27+
{% endfor %}
28+
{% endif %}
29+
{% endblock %}
30+
31+
{% block functions %}
32+
{% if functions %}
33+
.. rubric:: {{ _('Functions') }}
34+
35+
{% for item in functions %}
36+
.. autofunction:: {{ item }}
37+
{%- endfor %}
38+
{% endif %}
39+
{% endblock %}
40+
41+
{% block exceptions %}
42+
{% if exceptions %}
43+
.. rubric:: {{ _('Exceptions') }}
44+
45+
.. autosummary::
46+
{% for item in exceptions %}
47+
{{ item }}
48+
{%- endfor %}
49+
{% endif %}
50+
{% endblock %}
51+
52+
{% block modules %}
53+
{% if modules %}
54+
.. rubric:: Modules
55+
56+
.. autosummary::
57+
:toctree:
58+
:recursive:
59+
{% for item in modules %}
60+
{{ item }}
61+
{%- endfor %}
62+
{% endif %}
63+
{% endblock %}

docs/source/_templates/logo-text.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<img src="{{ pathto('_static/DelphiVCL4Python-sidebar.svg', 1) }}" alt="DelphiVCL logo" width="100%">
2+
<a href="{{ homepage() }}" class="text-logo">{{ theme_project_nav_name or shorttitle }}</a>

docs/source/changelog.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#########
2+
Changelog
3+
#########
4+
5+
6+
.. toctree::
7+
8+
changelog/0.1.40-changelog
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
*******
2+
v0.1.40
3+
*******
4+
5+
:Date: April 14, 2022
6+
7+
Contributors
8+
============
9+
10+
11+
* Lucas M Belo
12+
13+
14+
The patches included in this release have been reviewed by
15+
the following contributors.
16+
17+
* Lucas M Belo
18+
* Priyatham
19+
20+
21+
Fixed bugs
22+
----------
23+
24+
TNumberBox was misbehaving for which a bugfix is patched.
25+

0 commit comments

Comments
 (0)