Skip to content

Commit

Permalink
Sphinxify-docs.
Browse files Browse the repository at this point in the history
Rename .txt to .rst, add docs/ directory and include existing files, setup basic automodule API reference.
  • Loading branch information
jamadden committed Jul 26, 2018
1 parent 0813545 commit c40c507
Show file tree
Hide file tree
Showing 27 changed files with 399 additions and 61 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -12,3 +12,6 @@ develop-eggs/
eggs/
parts/
coverage/
.coverage
htmlcov/
docs/_build/
15 changes: 8 additions & 7 deletions CHANGES.rst
@@ -1,14 +1,15 @@
Changes
=======
=========
Changes
=========

4.5 (unreleased)
================
4.5.0 (unreleased)
==================

- Nothing changed yet.
- Move documentation to https://zopeformlib.readthedocs.io


4.4 (2017-08-15)
================
4.4.0 (2017-08-15)
==================

- Add support for Python 3.5, and 3.6.

Expand Down
4 changes: 4 additions & 0 deletions MANIFEST.in
Expand Up @@ -6,6 +6,10 @@ include tox.ini
include .travis.yml
include .coveragerc

recursive-include docs *.py
recursive-include docs *.rst
recursive-include docs Makefile

recursive-include src *

global-exclude *.pyc
Expand Down
12 changes: 10 additions & 2 deletions README.rst
@@ -1,9 +1,17 @@
``zope.formlib``
================
==============
zope.formlib
==============

.. image:: https://travis-ci.org/zopefoundation/zope.formlib.svg?branch=master
:target: https://travis-ci.org/zopefoundation/zope.formlib

.. image:: https://readthedocs.org/projects/zopeformlib/badge/?version=latest
:target: https://zopeformlib.readthedocs.io/en/latest/
:alt: Documentation Status


Forms are web components that use widgets to display and input data.
Typically a template displays the widgets by accessing an attribute or
method on an underlying class.

Documentation is hosted at https://zopeformlib.readthedocs.io/en/latest/
78 changes: 78 additions & 0 deletions docs/api/index.rst
@@ -0,0 +1,78 @@
===============
API Reference
===============

zope.formlib.interfaces
=======================

.. automodule:: zope.formlib.interfaces

zope.formlib.boolwidgets
========================

.. automodule:: zope.formlib.boolwidgets

zope.formlib.errors
===================

.. automodule:: zope.formlib.errors

zope.formlib.exception
======================

.. automodule:: zope.formlib.exception

zope.formlib.form
=================

.. automodule:: zope.formlib.form

zope.formlib.i18n
=================

.. automodule:: zope.formlib.i18n

zope.formlib.itemswidgets
=========================

.. automodule:: zope.formlib.itemswidgets

zope.formlib.namedtemplate
==========================

.. automodule:: zope.formlib.namedtemplate

zope.formlib.objectwidget
=========================

.. automodule:: zope.formlib.objectwidget

zope.formlib.sequencewidget
===========================

.. automodule:: zope.formlib.sequencewidget

zope.formlib.source
===================

.. automodule:: zope.formlib.source

zope.formlib.textwidgets
========================

.. automodule:: zope.formlib.textwidgets

zope.formlib.utility
====================

.. automodule:: zope.formlib.utility

zope.formlib.widget
===================

.. automodule:: zope.formlib.widget

zope.formlib.widgets
====================

.. automodule:: zope.formlib.widgets
1 change: 1 addition & 0 deletions docs/changelog.rst
@@ -0,0 +1 @@
.. include:: ../CHANGES.rst
199 changes: 199 additions & 0 deletions docs/conf.py
@@ -0,0 +1,199 @@
# -*- coding: utf-8 -*-
#
# zope.formlib documentation build configuration file, created by
# sphinx-quickstart on Thu Jun 8 07:02:25 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.

# 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.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
import os
import sys
import pkg_resources
# Use the python versions instead of the cython compiled versions
# for better documentation extraction and ease of tweaking docs.
os.environ['PURE_PYTHON'] = '1'

sys.path.append(os.path.abspath('../src'))
rqmt = pkg_resources.require('zope.formlib')[0]

# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode',
'repoze.sphinx.autointerface',
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = u'zope.formlib'
copyright = u'2017, Zope Foundation contributors'
author = u'Zope Foundation contributors'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '%s.%s' % tuple(map(int, rqmt.version.split('.')[:2]))
# The full version, including alpha/beta/rc tags.
release = rqmt.version

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

# The reST default role (used for this markup: `text`) to use for all documents.
default_role = 'obj'

# If true, '()' will be appended to :func: etc. cross-reference text.
add_function_parentheses = True

# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
add_module_names = False

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'perldoc'

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False


# -- Options for HTML output ----------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']


# -- Options for HTMLHelp output ------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'zopeformlibdoc'


# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'zopeformlib.tex', u'zope.formlib Documentation',
u'Zopefoundation', 'manual'),
]


# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'zopeformlib', u'zope.formlib Documentation',
[author], 1)
]


# -- Options for Texinfo output -------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'zopeformlib', u'zope.formlib Documentation',
author, 'zopeformlib', 'One line description of project.',
'Miscellaneous'),
]




# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {
'http://docs.python.org/': None,
'http://zopebrowser.readthedocs.io/en/latest': None,
'http://zopecomponent.readthedocs.io/en/latest': None,
'http://zopeinterface.readthedocs.io/en/latest': None,
'http://zopepublisher.readthedocs.io/en/latest': None,
}

extlinks = {
'issue': ('https://github.com/zopefoundation/zope.formlib/issues/%s',
'issue #'),
'pr': ('https://github.com/zopefoundation/zope.formlib/pull/%s',
'pull request #')}

autodoc_default_flags = ['members', 'show-inheritance']
autoclass_content = 'both'
# This causes the order in __all__ to be ignored :(
# autodoc_member_order = 'bysource'
1 change: 1 addition & 0 deletions docs/errors.rst
@@ -0,0 +1 @@
.. include:: ../src/zope/formlib/errors.rst
1 change: 1 addition & 0 deletions docs/form.rst
@@ -0,0 +1 @@
.. include:: ../src/zope/formlib/form.rst
34 changes: 34 additions & 0 deletions docs/index.rst
@@ -0,0 +1,34 @@

.. include:: ../README.rst


Introduction and Basics
=======================

.. toctree::
:maxdepth: 2

form
widgets
errors
objectwidget
source
changelog


API Details
===========

.. toctree::
:maxdepth: 2

api/index


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

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
1 change: 1 addition & 0 deletions docs/objectwidget.rst
@@ -0,0 +1 @@
.. include:: ../src/zope/formlib/objectwidget.rst
1 change: 1 addition & 0 deletions docs/source.rst
@@ -0,0 +1 @@
.. include:: ../src/zope/formlib/source.rst
1 change: 1 addition & 0 deletions docs/widgets.rst
@@ -0,0 +1 @@
.. include:: ../src/zope/formlib/widgets.rst
1 change: 1 addition & 0 deletions rtd-requirements.txt
@@ -0,0 +1 @@
.[docs]

0 comments on commit c40c507

Please sign in to comment.