-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b878415
commit 318c996
Showing
19 changed files
with
288 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Sphinx opts | ||
SPHINXOPTS ?= | ||
SPHINXBUILD ?= sphinx-build | ||
SOURCEDIR = . | ||
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
NTFYAction | ||
========== | ||
|
||
.. autoclass:: ntfpy.NTFYAction | ||
:members: | ||
|
||
NTFYBroadcastAction | ||
------------------- | ||
|
||
.. autoclass:: ntfpy.NTFYBroadcastAction | ||
:members: | ||
|
||
NTFYHttpAction | ||
-------------- | ||
|
||
.. autoclass:: ntfpy.NTFYHttpAction | ||
:members: | ||
|
||
NTFYViewAction | ||
-------------- | ||
|
||
.. autoclass:: ntfpy.NTFYViewAction | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
NTFYUrlAttachment | ||
----------------- | ||
|
||
.. autoclass:: ntfpy.NTFYUrlAttachment | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
NTFYClient | ||
---------- | ||
|
||
.. autoclass:: ntfpy.NTFYClient | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
API Reference | ||
============= | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
actions | ||
attachments | ||
client | ||
messages | ||
server | ||
user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
NTFYMessage | ||
=========== | ||
|
||
.. autoclass:: ntfpy.NTFYMessage | ||
:members: | ||
|
||
NTFYPushMessage | ||
--------------- | ||
|
||
.. autoclass:: ntfpy.NTFYPushMessage | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
NTFYServer | ||
---------- | ||
|
||
.. autoclass:: ntfpy.NTFYServer | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
NTFYUser | ||
-------- | ||
|
||
.. autoclass:: ntfpy.NTFYUser | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.. _changelog: | ||
|
||
Changelog | ||
========= | ||
|
||
.. _vp0p0p10: | ||
|
||
v0.0.10 | ||
------- | ||
|
||
New Features | ||
~~~~~~~~~~~~ | ||
|
||
- Added ``NTFYPushMessage`` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# Sphinx Doc Builder Config | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html | ||
|
||
import sys | ||
import os | ||
|
||
sys.path.insert(0, os.path.abspath("../src/")) | ||
sys.path.append(os.path.abspath("extensions")) | ||
|
||
# Project Info | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information | ||
|
||
project = "ntfpy" | ||
copyright = "2022, Nevalicjus" | ||
author = "Nevalicjus" | ||
release = "0.0.10" | ||
|
||
# General | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration | ||
|
||
extensions = [ | ||
"sphinx.ext.autodoc", | ||
"sphinx.ext.extlinks", | ||
"sphinx.ext.napoleon", | ||
"sphinx.ext.intersphinx", | ||
"sphinx_copybutton", | ||
"resourcelinks" | ||
] | ||
|
||
templates_path = ["_templates"] | ||
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] | ||
source_suffix = ".rst" | ||
locale_dirs = ["locale/"] | ||
|
||
# HTML Options | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output | ||
|
||
html_theme = "domdf_sphinx_theme" | ||
html_static_path = ["_static"] | ||
|
||
html_show_sphinx = False | ||
html_logo = "./images/ntfpy-50x50.png" | ||
html_favicon = "./images/ntfpy.ico" | ||
|
||
htmlhelp_basename = "ntfpydoc" | ||
|
||
# Extension Options | ||
|
||
resource_links = { | ||
"discord": "https://n3v.xyz/support", | ||
"issues": "https://github.com/nevalicjus/ntfpy/issues", | ||
"examples": "https://github.com/nevalicjus/ntfpy/tree/main/examples" | ||
} | ||
|
||
intersphinx_mapping = { | ||
"py": ("https://docs.python.org/3", None), | ||
"req": ("https://requests.readthedocs.io/en/latest/", None) | ||
} | ||
|
||
autodoc_default_options = { | ||
"member-order": "bysource", | ||
"undoc-members": True, | ||
"exclude-members": "__weakref__,__dict__,__str__,__module__,__annotations__", | ||
"autosummary": True | ||
} | ||
|
||
napoleon_use_ivar = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
from typing import Any, Dict, List, Tuple | ||
|
||
from docutils import nodes, utils | ||
from docutils.nodes import Node, system_message | ||
from docutils.parsers.rst.states import Inliner | ||
|
||
import sphinx | ||
from sphinx.application import Sphinx | ||
from sphinx.util.nodes import split_explicit_title | ||
from sphinx.util.typing import RoleFunction | ||
|
||
|
||
def make_link_role(resource_links: Dict[str, str]) -> RoleFunction: | ||
def role( | ||
typ: str, | ||
rawtext: str, | ||
text: str, | ||
lineno: int, | ||
inliner: Inliner, | ||
options: Dict = {}, | ||
content: List[str] = [] | ||
) -> Tuple[List[Node], List[system_message]]: | ||
text = utils.unescape(text) | ||
has_explicit_title, title, key = split_explicit_title(text) | ||
full_url = resource_links[key] | ||
if not has_explicit_title: | ||
title = full_url | ||
pnode = nodes.reference(title, title, internal = False, refuri = full_url) | ||
return [pnode], [] | ||
return role | ||
|
||
|
||
def add_link_role(app: Sphinx) -> None: | ||
app.add_role("resource", make_link_role(app.config.resource_links)) | ||
|
||
def setup(app: Sphinx) -> Dict[str, Any]: | ||
app.add_config_value("resource_links", {}, "env") | ||
app.connect("builder-inited", add_link_role) | ||
return {"version": sphinx.__display_version__, "parallel_read_safe": True} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
.. ntfpy documentation master file | ||
Welcome to ntfpy | ||
================ | ||
|
||
ntfpy is a Python API Wrapper for ntfy.sh | ||
|
||
|
||
Getting Started | ||
--------------- | ||
|
||
- :doc:`intro` | ||
- :resource:`Examples <examples>` | ||
|
||
|
||
Getting Help | ||
------------ | ||
|
||
- Ask us in the :resource:`Discord <discord>` server | ||
- For specifics, use :ref:`index <genindex>` or :ref:`searching <search>` | ||
- Report bugs in :resource:`issues <issues>` | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
:hidden: | ||
|
||
intro | ||
changelog | ||
|
||
.. toctree:: | ||
:caption: API Reference | ||
:maxdepth: 2 | ||
:hidden: | ||
|
||
api/index | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
.. _intro: | ||
|
||
Introduction | ||
============ | ||
|
||
Installation | ||
------------ | ||
|
||
Run this in your terminal to install the library | ||
|
||
.. code-block:: bash | ||
python3 -m pip install ntfpy | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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=. | ||
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 |