Skip to content

Commit

Permalink
added support for sphinx
Browse files Browse the repository at this point in the history
  • Loading branch information
Kataglyphis committed Jul 15, 2024
1 parent bd614ec commit 8cb12c0
Show file tree
Hide file tree
Showing 10 changed files with 160 additions and 5 deletions.
27 changes: 27 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Run Bandit",
"type": "shell",
"command": "bandit",
"args": [
"-r",
"--exclude",
"venv,env",
"."
],
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"reveal": "always",
"panel": "shared"
}
}
]
}
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
<a href="https://jonasheinle.de"><img src="images/glm_logo.png" alt="VulkanEngine" width="200"></a>
</h1> -->

<h4 align="center">Download files via webdav easily <a href="https://jonasheinle.de" target="_blank"></a>.</h4>
<h4 align="center">Download files via webdav easily. Use it to communicate to cloud storage provider (e.g. Nextcloud, ownCloud, Magenta, Synology NAS,
QNAPS NAS) and automate your personal storage tasks.
<a href="https://jonasheinle.de" target="_blank"></a>.</h4>

<!-- [![Linux build](https://github.com/Kataglyphis/GraphicsEngineVulkan/actions/workflows/Linux.yml/badge.svg)](https://github.com/Kataglyphis/GraphicsEngineVulkan/actions/workflows/Linux.yml)
[![Windows build](https://github.com/Kataglyphis/GraphicsEngineVulkan/actions/workflows/Windows.yml/badge.svg)](https://github.com/Kataglyphis/GraphicsEngineVulkan/actions/workflows/Windows.yml)
Expand Down
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
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)
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

%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.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

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

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

:end
popd
36 changes: 36 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

import os
import sys

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

project = "WebDavClient"
copyright = "2024, Jonas Heinle"
author = "Jonas Heinle"
release = "0.0.1"

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.napoleon", # For Google and NumPy style docstrings
"sphinx.ext.viewcode", # To include links to the source code
]

templates_path = ["_templates"]
exclude_patterns = []


# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = "alabaster"
html_static_path = ["_static"]
26 changes: 26 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.. WebDavClient documentation master file, created by
sphinx-quickstart on Mon Jul 15 07:27:38 2024.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
WebDavClient documentation
==========================

Add your content using ``reStructuredText`` syntax. See the
`reStructuredText <https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html>`_
documentation for details.


.. toctree::
:maxdepth: 2
:caption: Contents:

webdavclient

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

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

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

.. automodule:: webdavclient
:members:
:undoc-members:
:show-inheritance:
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ authors = [
]
description = "This package contains modules to easily communicate to a host via WebDav."
readme = "README.md"
requires-python = ">=3.10"
requires-python = ">=3.11"
keywords=["webdav", "cloud"]
classifiers = [
"Development Status :: 1 - Production/Stable",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.11",
]

dependencies=["loguru","requests"]
Expand All @@ -31,10 +31,10 @@ Homepage = "https://github.com/Kataglyphis/WebDavClient"

[tool.black]
line-length = 88
target-version = ['py312']
target-version = ['py311']

[tool.mypy]
python_version = "3.12"
python_version = "3.11"
warn_return_any = true
warn_unused_configs = true
exclude = [
Expand Down
1 change: 1 addition & 0 deletions requirements/dev_requirements.txt → requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
black
mypy
bandit
1 change: 1 addition & 0 deletions requirements/docs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sphinx

0 comments on commit 8cb12c0

Please sign in to comment.