Skip to content

Commit f9977b7

Browse files
committed
Documentation draft
1 parent de20908 commit f9977b7

8 files changed

Lines changed: 220 additions & 4 deletions

File tree

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Change Log
5050
- 0.3 Added Document.encoding, positive\_keywords and negative\_keywords
5151

5252
Licensing
53-
=========
53+
--------
5454

5555
This code is under `the Apache License
5656
2.0 <http://www.apache.org/licenses/LICENSE-2.0>`__ license.

doc/__init__.py

Whitespace-only changes.

doc/source/__init__.py

Whitespace-only changes.

doc/source/api.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
Reference
2+
=========
3+
4+
.. automodule:: readability
5+
:members:
6+
:show-inheritance:
7+
8+
.. automodule:: readability.browser
9+
:members:
10+
:show-inheritance:
11+
12+
.. automodule:: readability.cleaners
13+
:members:
14+
:show-inheritance:
15+
16+
.. automodule:: readability.debug
17+
:members:
18+
:show-inheritance:
19+
20+
.. automodule:: readability.encoding
21+
:members:
22+
:show-inheritance:
23+
24+
.. automodule:: readability.htmls
25+
:members:
26+
:show-inheritance:
27+
28+
.. automodule:: readability.readability
29+
:members:
30+
:show-inheritance:

doc/source/conf.py

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: utf-8 -*-
3+
#
4+
# readability documentation build configuration file, created by
5+
# sphinx-quickstart on Thu Mar 23 16:29:38 2017.
6+
#
7+
# This file is execfile()d with the current directory set to its
8+
# containing dir.
9+
#
10+
# Note that not all possible configuration values are present in this
11+
# autogenerated file.
12+
#
13+
# All configuration values have a default; values that are commented out
14+
# serve to show the default.
15+
16+
# If extensions (or modules to document with autodoc) are in another directory,
17+
# add these directories to sys.path here. If the directory is relative to the
18+
# documentation root, use os.path.abspath to make it absolute, like shown here.
19+
#
20+
import os
21+
import sys
22+
23+
sys.path.insert(0, os.path.abspath("../.."))
24+
25+
import readability
26+
27+
# -- General configuration ------------------------------------------------
28+
29+
# If your documentation needs a minimal Sphinx version, state it here.
30+
#
31+
# needs_sphinx = '1.0'
32+
33+
# Add any Sphinx extension module names here, as strings. They can be
34+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
35+
# ones.
36+
extensions = [
37+
"sphinx.ext.autodoc",
38+
"sphinx.ext.doctest",
39+
"sphinx.ext.intersphinx",
40+
"sphinx.ext.todo",
41+
"recommonmark",
42+
]
43+
44+
# Add any paths that contain templates here, relative to this directory.
45+
templates_path = ["_templates"]
46+
47+
# The suffix(es) of source filenames.
48+
# You can specify multiple suffix as a list of string:
49+
#
50+
source_suffix = [".rst", ".md"]
51+
52+
# The master toctree document.
53+
master_doc = "index"
54+
55+
# General information about the project.
56+
project = "readability"
57+
copyright = "2020, Yuri Baburov"
58+
author = "Yuri Baburov"
59+
60+
# The version info for the project you're documenting, acts as replacement for
61+
# |version| and |release|, also used in various other places throughout the
62+
# built documents.
63+
64+
# The short X.Y version.
65+
version = readability.__version__
66+
67+
# The full version, including alpha/beta/rc tags.
68+
release = readability.__version__
69+
70+
# The language for content autogenerated by Sphinx. Refer to documentation
71+
# for a list of supported languages.
72+
#
73+
# This is also used if you do content translation via gettext catalogs.
74+
# Usually you set "language" from the command line for these cases.
75+
language = None
76+
77+
# List of patterns, relative to source directory, that match files and
78+
# directories to ignore when looking for source files.
79+
# This patterns also effect to html_static_path and html_extra_path
80+
exclude_patterns = []
81+
82+
# The name of the Pygments (syntax highlighting) style to use.
83+
pygments_style = "sphinx"
84+
85+
# If true, `todo` and `todoList` produce output, else they produce nothing.
86+
todo_include_todos = False
87+
88+
89+
# -- Options for HTML output ----------------------------------------------
90+
91+
# The theme to use for HTML and HTML Help pages. See the documentation for
92+
# a list of builtin themes.
93+
#
94+
html_theme = "sphinx_rtd_theme"
95+
96+
# Theme options are theme-specific and customize the look and feel of a theme
97+
# further. For a list of options available for each theme, see the
98+
# documentation.
99+
#
100+
# html_theme_options = {}
101+
102+
# Add any paths that contain custom static files (such as style sheets) here,
103+
# relative to this directory. They are copied after the builtin static files,
104+
# so a file named "default.css" will overwrite the builtin "default.css".
105+
html_static_path = [] #'_static']
106+
107+
108+
# -- Options for HTMLHelp output ------------------------------------------
109+
110+
# Output file base name for HTML help builder.
111+
htmlhelp_basename = "readabilitydoc"
112+
113+
114+
# -- Options for LaTeX output ---------------------------------------------
115+
116+
latex_elements = {
117+
# The paper size ('letterpaper' or 'a4paper').
118+
#
119+
# 'papersize': 'letterpaper',
120+
# The font size ('10pt', '11pt' or '12pt').
121+
#
122+
# 'pointsize': '10pt',
123+
# Additional stuff for the LaTeX preamble.
124+
#
125+
# 'preamble': '',
126+
# Latex figure (float) alignment
127+
#
128+
# 'figure_align': 'htbp',
129+
}
130+
131+
# Grouping the document tree into LaTeX files. List of tuples
132+
# (source start file, target name, title,
133+
# author, documentclass [howto, manual, or own class]).
134+
latex_documents = [(master_doc, "readability.tex", "Readability Documentation", "Yuri Baburov", "manual")]
135+
136+
137+
# -- Options for manual page output ---------------------------------------
138+
139+
# One entry per manual page. List of tuples
140+
# (source start file, name, description, authors, manual section).
141+
man_pages = [(master_doc, "readability", "readability Documentation", [author], 1)]
142+
143+
144+
# -- Options for Texinfo output -------------------------------------------
145+
146+
# Grouping the document tree into Texinfo files. List of tuples
147+
# (source start file, target name, title, author,
148+
# dir menu entry, description, category)
149+
texinfo_documents = [
150+
(
151+
master_doc,
152+
"readability",
153+
"Readability Documentation",
154+
author,
155+
"readability",
156+
"One line description of project.",
157+
"Miscellaneous",
158+
)
159+
]
160+
161+
162+
intersphinx_mapping = {
163+
"python": ("https://docs.python.org/3", None),
164+
}

doc/source/index.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.. include:: ../../README.rst
2+
3+
.. toctree::
4+
:maxdepth: 2
5+
6+
api
7+
8+
Indices and tables
9+
------------------
10+
11+
* :ref:`genindex`
12+
* :ref:`modindex`
13+
* :ref:`search`

readability/readability.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def summary(self, html_partial=False):
178178
Given a HTML file, extracts the text of the article.
179179
180180
:param html_partial: return only the div of the document, don't wrap
181-
in html and body tags.
181+
in html and body tags.
182182
183183
Warning: It mutates internal DOM representation of the HTML document,
184184
so it is better to call other API methods before this one.

tox.ini

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,15 @@
44
# and then run "tox" from this directory.
55

66
[tox]
7-
envlist = py27, py35, py36, py37
7+
envlist = py27, py35, py36, py37, doc
88

99
[testenv]
10-
deps=pytest
10+
deps =
11+
pytest
12+
doc: sphinx
13+
doc: sphinx_rtd_theme
14+
doc: recommonmark
15+
1116
# This creates the virtual envs with --site-packages so already packages
1217
# that are already installed will be reused. This is especially useful on
1318
# Windows. Since we use lxml instead of compiling it locally (which in turn
@@ -18,3 +23,7 @@ sitepackages=True
1823
commands =
1924
pip install -r requirements.txt -e ".[test]"
2025
py.test
26+
27+
[testenv:doc]
28+
commands =
29+
python setup.py build_sphinx

0 commit comments

Comments
 (0)