Skip to content

Commit

Permalink
Add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
frenzymadness committed Feb 26, 2024
1 parent 64908dd commit afa1087
Show file tree
Hide file tree
Showing 8 changed files with 115 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ __pycache__
*.pyo
.tox
dist/
docs/_build
build/
lxml_html_clean.egg-info/
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ This project was initially a part of [lxml](https://github.com/lxml/lxml). Becau
## Installation

You can install this project directly via `pip install lxml_html_clean` or soon as an extra of lxml
itself via `pip install lxml[html_clean]`. Both ways installs this project together with lxml itself.

## Usage

[USAGE.rst](USAGE.rst) contains a part of the lxml documentation related to HTML cleaning.
via `pip install lxml[html_clean]`. Both ways installs this project together with lxml itself.

## License

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 = .
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)
37 changes: 37 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# 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

import sys

sys.path.insert(0, "..")

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

project = 'lxml_html_clean'
copyright = '2024, Lumír Balhar'
author = 'Lumír Balhar'

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

extensions = ['sphinx.ext.autodoc']

templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

autodoc_default_options = {
'ignore-module-all': True,
'private-members': True,
'inherited-members': True,
}

autodoc_member_order = 'groupwise'

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

html_theme = 'sphinx_rtd_theme'
#html_static_path = ['_static']
39 changes: 39 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
Welcome to lxml_html_clean's documentation!
===========================================

Motivation
----------

This project was initially a part of `lxml <https://github.com/lxml/lxml>`_. Because HTML cleaner is designed as blocklist-based,
many reports about possible security vulnerabilities were filed for lxml and that make the project problematic for
security-sensitive environments. Therefore we decided to extract the problematic part to a separate project.

Installation
------------

You can install this project directly via ``pip install lxml_html_clean``` or soon as an extra of lxml
via ``pip install lxml[html_clean]``. Both ways installs this project together with lxml itself.

Usage
=====

.. toctree::
:maxdepth: 2

usage

API
===

.. toctree::
:maxdepth: 2

lxml_html_clean


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

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
10 changes: 10 additions & 0 deletions docs/lxml_html_clean.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
lxml\_html\_clean package
=========================

lxml\_html\_clean.clean module
------------------------------

.. automodule:: lxml_html_clean.clean
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions docs/modules.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
lxml_html_clean
===============

.. toctree::
:maxdepth: 4

lxml_html_clean
File renamed without changes.

0 comments on commit afa1087

Please sign in to comment.