added docs

This commit is contained in:
Christopher Pickering 2021-07-27 16:06:47 -05:00
parent 8538e03516
commit bb337c09d8
No known key found for this signature in database
GPG key ID: E14DB3B0A0FACF84
7 changed files with 151 additions and 11 deletions

View file

@ -39,15 +39,15 @@ PR any changes needed 👍🏽
Optional args
-------------
+-------------------+---------------------------+----------------+
| Arg | Definition | Default |
+===================+===========================+================+
| -e, --extension | File extension to lint. | default=html |
+-------------------+---------------------------+----------------+
| --check | Checks file formatting |
+-------------------+---------------------------+----------------+
| --reformat | Reformats html |
+-------------------+---------------------------+----------------+
+--------------------+---------------------------+----------------+
| Arg | Definition | Default |
+====================+===========================+================+
| -e, --extension | File extension to lint. | default=html |
+--------------------+---------------------------+----------------+
| --reformat --check | Checks html formatting | |
+--------------------+---------------------------+----------------+
| --reformat | Reformats html | |
+--------------------+---------------------------+----------------+
Linter Rules
------------
@ -97,6 +97,8 @@ Warning Codes
+--------+----------------------------------------------------------------+
| W016 | Missging title tag in html. |
+--------+----------------------------------------------------------------+
| W017 | Tag should be self closing. |
+--------+----------------------------------------------------------------+
Adding Rules
------------
@ -111,7 +113,7 @@ A good rule consists of
Contributing - Please Help!
---------------------------
Checkout the issue list and help where you can!
Checkout the `issue <https://github.com/Riverside-Healthcare/djlint/issues>`_ list and help where you can!
.. |codecov| image:: https://codecov.io/gh/Riverside-Healthcare/djlint/branch/master/graph/badge.svg?token=eNTG721BAA
:target: https://codecov.io/gh/Riverside-Healthcare/djlint

20
docs/Makefile Normal file
View file

@ -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 = .
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)

62
docs/conf.py Normal file
View file

@ -0,0 +1,62 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# 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.
#
from pathlib import Path
CURRENT_DIR = Path(__file__).parent
# -- Project information -----------------------------------------------------
project = "djlint"
copyright = "2021, Riverside Healthcare"
author = "Christopher Pickering"
release = "0.1.1"
version = release
# -- General configuration ---------------------------------------------------
extensions = ["myst_parser", "sphinx_copybutton"]
templates_path = ["_templates"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
# -- Options for HTML output -------------------------------------------------
html_theme = "alabaster"
html_sidebars = {
"**": [
"about.html",
"navigation.html",
"relations.html",
"searchbox.html",
]
}
html_theme_options = {
"show_related": False,
"description": "django template formatter",
"github_button": True,
"github_user": "Riverside-Healthcare",
"github_repo": "djlint",
"github_type": "star",
"show_powered_by": False,
"fixed_sidebar": True,
# "logo": "logo2.png",
}
html_static_path = ["_static"]
source_suffix = [".rst", ".md"]
pygments_style = "sphinx"

19
docs/index.rst Normal file
View file

@ -0,0 +1,19 @@
.. djlint documentation master file, created by
sphinx-quickstart on Tue Jul 27 15:28:35 2021.
Django Template Formatter
=========================
.. toctree::
:maxdepth: 2
:caption: Contents:
.. toctree::
:hidden:
GitHub ↪ <https://github.com/Riverside-Healthcare/djlint>
PyPI ↪ <https://pypi.org/project/djlint/>
.. include:: ../readme.rst
:start-line: 1

35
docs/make.bat Normal file
View file

@ -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
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

0
docs/requirements.txt Normal file
View file

View file

@ -6,6 +6,8 @@ from setuptools import find_packages, setup
project_path = Path(__file__).parent
__version__ = "0.1.1"
def long_description():
"""Build long description from readme and changelog."""
@ -24,7 +26,7 @@ extras = {
setup(
name="djlint",
version="0.1.1",
version=__version__,
author="Christopher Pickering",
author_email="cpickering@rhc.net",
description="Django Template Linter",