Skip to content

Commit

Permalink
Update docs and CHANGELOG
Browse files Browse the repository at this point in the history
- Rename HISTORY.rst -> CHANGELOG.rst
- Add support for sphinx_issues
- Update setup.py
- Update tasks.py for cross-platform compat
- Update konchrc
  • Loading branch information
sloria committed Jun 10, 2015
1 parent 309d459 commit 8a1ff5c
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 188 deletions.
2 changes: 2 additions & 0 deletions .konchrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
# vi: set ft=python :
import konch
from textblob import TextBlob, Blobber, Word, Sentence

Expand All @@ -10,4 +11,5 @@ konch.config({
'Sentence': Sentence,
},
'prompt': '>>> ',
'ipy_autoreload': True,
})
3 changes: 3 additions & 0 deletions HISTORY.rst → CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ Changelog
0.9.1 (unreleased)
------------------

Bug fixes:

- Fix ``DecisionTreeClassifier.pprint`` for compatibility with nltk>=3.0.2.
- Translation no longer adds erroneous whitespace around punctuation characters (:issue:`83`). Thanks :user:`AdrianLC` for reporting and thanks :user:`jschnurr` for the patch.

0.9.0 (2014-09-15)
------------------
Expand Down
7 changes: 5 additions & 2 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
nose>=1.3.0
tox>=1.5.0
sphinx
PyYAML
wheel
invoke
mock

# Docs
sphinx
PyYAML
sphinx-issues==0.2.0
2 changes: 1 addition & 1 deletion docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.. _changelog:

.. include:: ../HISTORY.rst
.. include:: ../CHANGELOG.rst
175 changes: 8 additions & 167 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, os
import sys
import os

# 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
Expand All @@ -22,29 +23,26 @@

# -- 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.doctest',
'sphinx.ext.viewcode',
'sphinx_issues',
]

primary_domain = 'py'
default_role = 'py:obj'

issues_github_path = 'sloria/TextBlob'

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

# The suffix of source filenames.
source_suffix = '.rst'

# The encoding of source files.
#source_encoding = 'utf-8-sig'

# The master toctree document.
master_doc = 'index'

Expand All @@ -58,202 +56,45 @@
#
# The short X.Y version.
version = release = textblob.__version__

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['_build']

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

# 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 = True

# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False

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

# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []

# If true, keep warnings as "system message" paragraphs in the built documents.
#keep_warnings = 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 = 'kr'

# 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 themes here, relative to this directory.
html_theme_path = ['_themes']

# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
#html_title = None

# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None

# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#html_logo = None

# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#html_favicon = None

# 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']

# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
#html_last_updated_fmt = '%b %d, %Y'

# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True

# Custom sidebar templates, maps document names to template names.
html_sidebars = {
'index': ['side-primary.html', 'searchbox.html'],
'**': ['side-secondary.html', 'localtoc.html',
'relations.html', 'searchbox.html']
}

# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}

# If false, no module index is generated.
#html_domain_indices = True

# If false, no index is generated.
#html_use_index = True

# If true, the index is split into individual pages for each letter.
#html_split_index = False

# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True

# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True

# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True

# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''

# This is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = None

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


# -- 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': '',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'TextBlob.tex', u'textblob Documentation',
u'Steven Loria', 'manual'),
('index', 'TextBlob.tex', u'textblob Documentation',
u'Steven Loria', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None

# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False

# If true, show page references after internal links.
#latex_show_pagerefs = False

# If true, show URL addresses after external links.
#latex_show_urls = False

# Documents to append as an appendix to all manuals.
#latex_appendices = []

# If false, no module index is generated.
#latex_domain_indices = True


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

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'textblob', u'textblob Documentation',
[u'Steven Loria'], 1)
]

# If true, show URL addresses after external links.
#man_show_urls = False


# -- 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 = [
('index', 'textblob', u'TextBlob Documentation',
('index', 'textblob', u'TextBlob Documentation',
u'Steven Loria', 'textblob', 'Simplified Python text-processing.',
'Natural Language Processing'),
]

# Documents to append as an appendix to all manuals.
#texinfo_appendices = []

# If false, no module index is generated.
#texinfo_domain_indices = True

# How to display URL addresses: 'footnote', 'no', or 'inline'.
#texinfo_show_urls = 'footnote'

# If true, do not generate a @detailmenu in the "Top" node's menu.
#texinfo_no_detailmenu = False
7 changes: 3 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@


def find_version(fname):
'''Attempts to find the version number in the file names fname.
"""Attempts to find the version number in the file names fname.
Raises RuntimeError if not found.
'''
"""
version = ''
with open(fname, 'r') as fp:
reg = re.compile(r'__version__ = [\'"]([^\'"]*)[\'"]')
Expand All @@ -36,8 +36,7 @@ def read(fname):
version=__version__,
description='Simple, Pythonic text processing. Sentiment analysis, '
'POS tagging, noun phrase parsing, and more.',
long_description=(read("README.rst") + '\n\n' +
read("HISTORY.rst")),
long_description=read("README.rst"),
license=read("LICENSE"),
author='Steven Loria',
author_email='sloria1@gmail.com',
Expand Down
20 changes: 6 additions & 14 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# -*- coding: utf-8 -*-
import os
import sys
import webbrowser

from invoke import task, run

Expand All @@ -28,18 +29,8 @@ def clean_docs():

@task
def browse_docs():
platform = str(sys.platform).lower()
command_map = {
'darwin': 'open ',
'linux': 'idle ',
'win32': '',
}
cmd = command_map.get(platform)
if cmd:
run("{0}{1}".format(cmd, os.path.join(build_dir, 'index.html')))
else:
print('Unsure how to open the built file on this operating system.')
sys.exit(1)
path = os.path.join(build_dir, 'index.html')
webbrowser.open_new_tab(path)

@task
def docs(clean=False, browse=False):
Expand All @@ -50,9 +41,10 @@ def docs(clean=False, browse=False):
browse_docs()

@task
def readme():
def readme(browse=False):
run("rst2html.py README.rst > README.html", pty=True)
run("open README.html")
if browse:
webbrowser.open_new_tab('README.html')

@task
def doctest():
Expand Down

0 comments on commit 8a1ff5c

Please sign in to comment.