Skip to content
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

Documentation for v0.12 #209

Merged
merged 30 commits into from
Jan 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
5575fb4
Initial doc commit
LeMyst Sep 4, 2021
1b03928
Doc for v0.12
LeMyst Sep 4, 2021
361b4ee
Create .readthedocs.yaml
LeMyst Sep 4, 2021
8f31346
Merge branch 'rewrite-wbi' into docs-v012
LeMyst Sep 5, 2021
5250811
Update conf.py
LeMyst Sep 5, 2021
b922661
Add sphinx-autodoc-typehints
LeMyst Sep 19, 2021
1f56935
Merge branch 'rewrite-wbi' into docs-v012
LeMyst Sep 26, 2021
b611b39
Change package installation method
LeMyst Sep 26, 2021
6745e12
Merge branch 'rewrite-wbi' into docs-v012
LeMyst Sep 27, 2021
6b8b9b6
Merge branch 'rewrite-wbi' into docs-v012
LeMyst Oct 24, 2021
aaf45ea
Change pylint for docs
LeMyst Oct 24, 2021
9c22901
Update setup.cfg
LeMyst Oct 28, 2021
289608c
Update requirements.txt
LeMyst Oct 28, 2021
cb94156
Add doc template files
LeMyst Nov 1, 2021
e5467df
Update doc source files
LeMyst Nov 1, 2021
2e1eb72
Improve Sphinx Generation
LeMyst Nov 1, 2021
449f257
Merge branch 'rewrite-wbi' into docs-v012
LeMyst Dec 5, 2021
f2bce0d
Add dependencies to setup.py
LeMyst Dec 5, 2021
469e339
Merge branch 'rewrite-wbi' into docs-v012
LeMyst Dec 20, 2021
e95cc96
Improve docs
LeMyst Dec 21, 2021
4020771
Fix mypy error
LeMyst Dec 26, 2021
06b5fb3
Update doc
LeMyst Dec 26, 2021
afbdbda
Update some docs
LeMyst Dec 28, 2021
b2acff9
Merge branch 'rewrite-wbi' into docs-v012
LeMyst Dec 29, 2021
a6faf4b
Update wbi_login doc
LeMyst Dec 29, 2021
9005863
Update language_values.py
LeMyst Jan 1, 2022
6c92cfe
Merge branch 'rewrite-wbi' into docs-v012
LeMyst Jan 2, 2022
1f0ef3c
Improve doc
LeMyst Jan 2, 2022
fdf4563
Merge branch 'rewrite-wbi' into docs-v012
LeMyst Jan 6, 2022
f4ae28f
Merge branch 'rewrite-wbi' into docs-v012
LeMyst Jan 9, 2022
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
15 changes: 13 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,29 @@
version: 2
updates:

# Maintain dependencies for pip
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
assignees:
- "LeMyst"
open-pull-requests-limit: 10

# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
assignees:
- "LeMyst"
open-pull-requests-limit: 10

# Maintain dependencies for pip
# Maintain dependencies for documentation
- package-ecosystem: "pip"
directory: "/"
directory: "/docs/"
schedule:
interval: "daily"
assignees:
- "LeMyst"
open-pull-requests-limit: 10
23 changes: 23 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# .readthedocs.yaml
# 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
formats:
- pdf

# Optionally set the version of Python and requirements required to build your docs
python:
version: "3.8"
install:
- method: pip
path: .
extra_requirements:
- docs
19 changes: 19 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
5 changes: 5 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Sphinx-apidoc

```shell
sphinx-apidoc.exe -e -f -o docs\source .\wikibaseintegrator\ -t docs\source\_templates
```
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
6 changes: 6 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Sphinx~=4.2.0
readthedocs-sphinx-ext~=2.1.4
sphinx-rtd-theme~=1.0.0
git+https://github.com/LeMyst/sphinx-github-changelog.git@1.0.8-Sphinx-4.2.0#egg=sphinx_github_changelog
m2r2~=0.3.1
sphinx-autodoc-typehints~=1.12.0
9 changes: 9 additions & 0 deletions docs/source/_templates/module.rst_t
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{%- if show_headings %}
{{- [basename] | join(' ') | e | heading }}

{% endif -%}
.. automodule:: {{ qualname }}
{%- for option in automodule_options %}
:{{ option }}:
{%- endfor %}

48 changes: 48 additions & 0 deletions docs/source/_templates/package.rst_t
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{%- macro automodule(modname, options) -%}
.. automodule:: {{ modname }}
{%- for option in options %}
:{{ option }}:
{%- endfor %}
{%- endmacro %}

{%- macro toctree(docnames) -%}
.. toctree::
:maxdepth: {{ maxdepth }}
{% for docname in docnames %}
{{ docname }}
{%- endfor %}
{%- endmacro %}

{%- if is_namespace %}
{{- [pkgname, "namespace"] | join(" ") | e | heading }}
{% else %}
{{- [pkgname] | join(" ") | e | heading }}
{% endif %}

{%- if is_namespace %}
.. py:module:: {{ pkgname }}
{% endif %}

{%- if subpackages %}
Subpackages
-----------

{{ toctree(subpackages) }}
{% endif %}

{%- if submodules %}
{%- if subpackages %}
Submodules
----------
{%- endif %}
{% if separatemodules %}
{{ toctree(submodules) }}
{% else %}
{%- for submodule in submodules %}
{% if show_headings %}
{{- [submodule, "module"] | join(" ") | e | heading(2) }}
{% endif %}
{{ automodule(submodule, automodule_options) }}
{% endfor %}
{%- endif %}
{%- endif %}
7 changes: 7 additions & 0 deletions docs/source/_templates/toc.rst_t
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{{ header | heading }}

.. toctree::
:maxdepth: {{ maxdepth }}
{% for docname in docnames %}
{{ docname }}
{%- endfor %}
9 changes: 9 additions & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.. _changelog:

Changelog
*********

.. changelog::
:changelog-url: https://wikibaseintegrator.readthedocs.io/en/stable/#changelog
:github: https://github.com/LeMyst/WikibaseIntegrator/releases/
:pypi: https://pypi.org/project/wikibaseintegrator/
120 changes: 120 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# -*- coding: utf-8 -*-
#
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys

from datetime import datetime

sys.path.insert(0, os.path.abspath('../..'))

# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.mathjax',
'sphinx.ext.viewcode',
'sphinx_rtd_theme',
'sphinx_github_changelog',
'm2r2',
'sphinx_autodoc_typehints']

# Provide a GitHub API token:
# Pass the SPHINX_GITHUB_CHANGELOG_TOKEN environment variable to your build
# OR
# sphinx_github_changelog_token = ""

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
source_suffix = {'.rst': 'restructuredtext'}

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = u'WikibaseIntegrator'
copyright = u'%d, LeMyst' % datetime.now().year
author = u'LeMyst and WikibaseIntegrator contributors'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = u'0.12.0'
# The full version, including alpha/beta/rc tags.
release = u'0.12.0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = 'en'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = []

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False

autodoc_typehints = 'both'
autodoc_default_options = {
'special-members': '__init__',
'members': True,
'undoc-members': True,
'inherited-members': True,
'show-inheritance': True,
'exclude-members': 'subclasses'
}

# -- Options for HTML output ----------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'

html_theme_options = {
'style_external_links': False,
# Toc options
'collapse_navigation': False
}

html_context = {
'display_github': True,
'github_user': 'LeMyst',
'github_repo': 'WikibaseIntegrator',
'github_version': 'master',
"conf_py_path": "/docs/"
}


def skip(app, what, name, obj, would_skip, options):
if name == "__init__":
return False
if name == "sparql_query":
return True
return would_skip


def setup(app):
app.connect("autodoc-skip-member", skip)
33 changes: 33 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.. _index:

WikibaseIntegrator
==================

.. toctree::
:maxdepth: 5

wikibaseintegrator

..
README
======

.. mdinclude:: ../../README.md


Changelog
=========

.. toctree::
:maxdepth: 5
:caption: Miscellaneous

changelog


Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
7 changes: 7 additions & 0 deletions docs/source/modules.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
wikibaseintegrator
==================

.. toctree::
:maxdepth: 4

wikibaseintegrator
7 changes: 7 additions & 0 deletions docs/source/wikibaseintegrator.datatypes.basedatatype.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
wikibaseintegrator.datatypes.basedatatype
=========================================

.. automodule:: wikibaseintegrator.datatypes.basedatatype
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions docs/source/wikibaseintegrator.datatypes.commonsmedia.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
wikibaseintegrator.datatypes.commonsmedia
=========================================

.. automodule:: wikibaseintegrator.datatypes.commonsmedia
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions docs/source/wikibaseintegrator.datatypes.externalid.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
wikibaseintegrator.datatypes.externalid
=======================================

.. automodule:: wikibaseintegrator.datatypes.externalid
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions docs/source/wikibaseintegrator.datatypes.extra.edtf.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
wikibaseintegrator.datatypes.extra.edtf
=======================================

.. automodule:: wikibaseintegrator.datatypes.extra.edtf
:members:
:undoc-members:
:show-inheritance:
Loading