Skip to content

Added the Sphinx docs and configuration to host the docs on GitHub pages #47

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/sphinx-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Docs
on:
# Manual run
workflow_dispatch:
permissions:
contents: write
jobs:
docs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- name: Install dependencies
run: |
pip install sphinx sphinx_rtd_theme
pip install --exists-action=w --no-cache-dir -r docs/requirements.txt
pip install --exists-action=w --no-cache-dir -r docs/rtd-requirements.txt
- name: Sphinx build
run: |
sphinx-build docs/source _build
dir
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
# if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: _build/
force_orphan: true
13 changes: 13 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/source/conf.py

# Optionally build your docs in additional formats such as PDF and ePub
formats: all
6 changes: 6 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
delphivcl
furo
myst-parser
sphinx
sphinx-copybutton
sphinxext-opengraph
1 change: 1 addition & 0 deletions docs/rtd-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sphinxcontrib-programoutput
1 change: 1 addition & 0 deletions docs/source/_static/DelphiVCL4Python-sidebar-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/source/_static/DelphiVCL4Python-sidebar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions docs/source/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
@media (prefers-color-scheme: dark) {
span.nc {
text-decoration: none !important;
}
}

p.rubric{
text-transform: capitalize;
font-size: 1.25rem;
font-weight: bold;
}

.sig-param{
color: var(--color-content-foreground);
}

dl.c .field-list dt, dl.cpp .field-list dt, dl.js .field-list dt, dl.py .field-list dt {
text-transform: capitalize;
font-weight: bold;
font-size: var(--font-size--normal);
}

h4, h5, h6{
text-transform: none;
}

.sidebar-tree a.internal.reference {
display: table-cell;
}
Binary file added docs/source/_static/favicon.ico
Binary file not shown.
67 changes: 67 additions & 0 deletions docs/source/_static/responsiveSvg.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@

window.addEventListener("load", function () {
const styleElements = []
const colorSchemeQuery = window.matchMedia('(prefers-color-scheme: dark)');
const diagrams = document.querySelectorAll("object.inheritance.graphviz");

for (let diagram of diagrams) {
style = document.createElement('style');
styleElements.push(style);
console.log(diagram);
diagram.contentDocument.firstElementChild.appendChild(style);
}

function setColorScheme(e) {
let colors, additions = "";
if (e.matches) {
// Dark
colors = {
text: "#e07a5f",
box: "#383838",
edge: "#d0d0d0",
background: "#131416"
};
} else {
// Light
colors = {
text: "#e07a5f",
box: "#fff",
edge: "#413c3c",
background: "#ffffff"
};
additions = `
.node polygon {
filter: drop-shadow(0 1px 3px #0002);
}
`
}
for (let style of styleElements) {
style.innerHTML = `
svg {
background-color: ${colors.background};
}

.node text {
fill: ${colors.text};
}

.node polygon {
fill: ${colors.box};
}

.edge polygon {
fill: ${colors.edge};
stroke: ${colors.edge};
}

.edge path {
stroke: ${colors.edge};
}
${additions}
`;
}
}

setColorScheme(colorSchemeQuery);
colorSchemeQuery.addEventListener("change", setColorScheme);
});
32 changes: 32 additions & 0 deletions docs/source/_templates/autosummary/class.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{ name | escape | underline}}

Qualified name: ``{{ fullname | escape }}``

.. currentmodule:: {{ module }}

.. autoclass:: {{ objname }}
:show-inheritance:
:members:

{% block methods %}
{%- if methods %}
.. rubric:: {{ _('Methods') }}

.. autosummary::
:nosignatures:
{% for item in methods if item != '__init__' and item not in inherited_members %}
~{{ name }}.{{ item }}
{%- endfor %}
{%- endif %}
{%- endblock %}

{% block attributes %}
{%- if attributes %}
.. rubric:: {{ _('Attributes') }}

.. autosummary::
{% for item in attributes %}
~{{ name }}.{{ item }}
{%- endfor %}
{%- endif %}
{% endblock %}
63 changes: 63 additions & 0 deletions docs/source/_templates/autosummary/module.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{{ name | escape | underline }}

.. currentmodule:: {{ fullname }}

.. automodule:: {{ fullname }}

{% block attributes %}
{% if attributes %}
.. rubric:: Module Attributes

.. autosummary::
{% for item in attributes %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block classes %}
{% if classes %}
.. rubric:: Classes

.. autosummary::
:toctree: .
:nosignatures:
{% for class in classes %}
{{ class }}
{% endfor %}
{% endif %}
{% endblock %}

{% block functions %}
{% if functions %}
.. rubric:: {{ _('Functions') }}

{% for item in functions %}
.. autofunction:: {{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block exceptions %}
{% if exceptions %}
.. rubric:: {{ _('Exceptions') }}

.. autosummary::
{% for item in exceptions %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block modules %}
{% if modules %}
.. rubric:: Modules

.. autosummary::
:toctree:
:recursive:
{% for item in modules %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
2 changes: 2 additions & 0 deletions docs/source/_templates/logo-text.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<img src="{{ pathto('_static/DelphiVCL4Python-sidebar.svg', 1) }}" alt="DelphiVCL logo" width="100%">
<a href="{{ homepage() }}" class="text-logo">{{ theme_project_nav_name or shorttitle }}</a>
8 changes: 8 additions & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#########
Changelog
#########


.. toctree::

changelog/0.1.40-changelog
25 changes: 25 additions & 0 deletions docs/source/changelog/0.1.40-changelog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
*******
v0.1.40
*******

:Date: April 14, 2022

Contributors
============


* Lucas M Belo


The patches included in this release have been reviewed by
the following contributors.

* Lucas M Belo
* Priyatham


Fixed bugs
----------

TNumberBox was misbehaving for which a bugfix is patched.

Loading