Commits

Jonathan Eunice committed 33d10c9

Pushing 1.0.1 for new docs strategy.

Comments (0)

Files changed (7)

 *.swp.{py,txt,html,css,js}
 *.pyc
 .DS_Store
+docs/_build
 build/*
 dist/*
 *.egg-info
+1.0.1
+=====
 
+  * Moved main documentation to Sphinx format in ./docs, and hosted
+    the long-form documentation on readthedocs.org. README.rst now
+    an abridged version/teaser for the module.
 
 1.0
 ===
     formatted printing of positional parameters. Isn't it time for an upgrade?
 
     **A:** Yes! ZOMG, yes!
+
+.. image:: https://pypip.in/d/say/badge.png
+    :target: https://crate.io/packages/say/
     
 ``say`` supplements or replaces Python's ``print``
 statement/function, ``format`` function/method, and ``%`` string interpolation
 invocation, the more valuable having it stated in-line becomes. Note that full
 expressions are are supported. They are evaluated in the context of the caller.
 
-Printing Where You Like
-=======================
-
-``say()`` writes to a list of files--by default just ``sys.stdout``. But
-with one simple configuration call, it will write to different--even
-multiple--files::
-
-    from say import say, stdout
-    
-    say.setfiles([stdout, "report.txt"])
-    say(...)   # now prints to both stdout and report.txt
-
-This has the advantage of allowing you to both capture and see
-program output, without changing
-any code (other than the config statement). You can also define your own targeted ``Say`` instances::
-
-    from say import say, Say, stderr
-    
-    err = say.clone().setfiles([stderr, 'error.txt'])
-    err("Failed with error {errcode}")  # writes to stderr, error.txt
-    
-Note that ``stdout`` and ``stderr`` are just convenience aliases to
-the respective 
-``sys`` equivalents.
-
-Printing When You Like
-======================
-
-If you want to stop printing for a while::
-
-    say.set(silent=True)  # no printing until set to False
-    
-Or transiently::
-
-    say(...stuff..., silent=not verbose) # prints iff bool(verbose) is True
-
-Of course, you don't have to print to any file. There's a predefined sayer
-``fmt()`` that works exactly like ``say()`` and inherits most of
-its options, but 
-doesn't print. (The
-``C`` analogy: ``say`` **:** ``fmt`` **::** ``printf`` **:** ``sprintf``.)
-
-Indentation and Wrapping
-========================
-
-Indentation is a common way to display data hierarchically. ``say`` will
-help you manage it. For example::
-
-    say('TITLE')
-    for item in items:
-        say(item, indent=1)
-   
-will indent the items by one indentation level (by default, each indent
-level is four spaces, but
-you can change that with the ``indent_str`` option). 
-
-If you want to change the default indentation level::
-
-    say.set(indent=1)      # to an absolute level
-    say.set(indent='+1')   # strings => set relative to current level
-    
-    ...
-    
-    say.set(indent=0)      # to get back to the default, no indent
-
-Or you can use a ``with`` construct::
-
-    with say.settings(indent='+1'):
-        say(...)
-        
-        # anything say() emits here will be auto-indented +1 levels
-        
-    # anything say() emits here, after the with, will not be indented +1
-
-And if you have a lot of data or text to print, you can easily wrap it::
-
-    say("This is a really long...blah blah blah", wrap=40)
-    
-Will automatically wrap the text to the given width (using Python's standard ``textwrap`` module).
-
-While it's easy enough for any ``print`` statement or function to have a few
-space characters added to its format string, it's easy to mistakenly type too
-many or too few spaces, or to forget to type them in some format strings. And if
-you're indenting strings that themselves may contain multiple lines, the simple
-``print`` approach breaks because won't take multi-line strings into account.
-And it won't be integrated with wrapping.
-
-``say``, however, simply handles the indent level and wrapping, and it properly
-handles the multi-line string case. Subsequent lines will be just as nicely and
-correctly indented as the first one--something not otherwise easily accomplished
-without adding gunky, complexifying string manipulation code to every place in
-your program that prints strings.
-
-This starts to illustrate the "do the right thing" philosophy behind ``say``. So
-many languages' printing and formatting functions a restricted to "outputting
-values" at a low level. They may format basic data types, but they don't provide
-straightforward ways to do neat text transformations like indentation that let
-programmers rapidly provide correct, highly-formatted ouput. Over time, ``say``
-will provide higher-level formatting options. For now: indentation and wrapping.
-
-Encodings
-=========
-
-``say()`` and 
-``fmt()`` try to work with Unicode strings, for example providing them as
-return values. But character encodings remain a fractious and often exasperating
-part of IT. When writing formatted strings, ``say`` handles this by encoding
-into ``utf-8``.
-
-If you are using strings containing ``utf-8`` rather than Unicode characters, ``say`` 
-may complain. But it complains in the same places the built-in ``format()`` does,
-so no harm done. (Python 3 doesn't generally allow ``utf-8`` in strings, so it's
-cleaner on this front.)
-
-You can get creative with the encoding::
-
-    say('I am a truck!', encoding='base64')  # SSBhbSBhIHRydWNrIQo=
-
-Or change the default::
-
-    say.set(encoding='rot-13')
-    
-Knock yourself out with `all the exciting opportunites
-<http://docs.python.org/library/codecs.html#standard-encodings>`_!
-If you really want the formatted text returned just as it is written to files,
-use the ``encoded`` option. Set to ``True`` and it returns text in the output
-encoding. Or set to an actual encoding name, and that will be the return encoding.
-
-``say()`` returns the formatted text with one small tweak: it removes the final
-newline if a newline is the very last character. Though odd, this is exactly
-what you need if you're going to ``print`` or
-``say`` the resulting text without a gratuitous "extra" newline.
-
-Titles and Horizontal Rules
-===========================
-
-``say`` defines a few convenience formatting functions::
-
-    say.title('Errors', sep='-')
-    for i,e in enumerate(errors, start=1):
-        say("{i:3}: {e['name'].upper()}")
-        
-might yield::
-
-    --------------- Errors ---------------
-      1: I/O ERROR
-      2: COMPUTE ERROR
-
-A similar method ``hr`` produces just a horizontal line, like
-the HTML ``<hr>`` element. For either, one can optionally 
-specify the width (``width``), character repeated to make the line (``sep``),
-and vertical separation/whitespace above and below the item (``vsep``).
-Good options for the separator might be be '-', '=', or parts of the `Unicode 
-box drawing character set <http://en.wikipedia.org/wiki/Box-drawing_character>`_.
-
-Non-Functional Invocation
-=========================
-
-For those who don't want to always and forever surround "print statements" with
-the Python 3-style function parentheses, the ``>`` operator is
-provided as an experimental, non-functional way to print. The following
-are identical::
-
-    say> "{user.id}: {user.username}"
-    say("{user.id}: {user.username}")
-    
-You can name as many values as you like in the format string, but there can
-only be one format string, and no options. If you need to ``say`` multiple values,
-or say them with statement-specific options, you must use the functional syntax.
-    
-
-Text and Templates
-==================
-
-Often the job of output is not about individual text lines, but about creating
-multi-line files such as scripts and reports. This often leads away from standard
-output mechanisms toward template pakcages, but ``say`` has you covered here as
-well.::
-
-    from say import Text
-    
-    # assume `hostname` and `filepath` already defined
-    
-    script = Text()
-    script += """
-        !#/bin/bash
-        
-        # Output the results of a ping command to the given file
-        
-        ping {hostname} >{filepath}
-    """
-    
-    script.write_to("script.sh")
-    
-``Text`` objects are basically a list of text lines. In most cases, when you add
-text (either as multi-line strings or lists of strings), ``Text`` will
-automatically interopolate variables the same way ``say`` does. One can
-simply ``print`` or
-``say`` ``Text`` objects, as their ``str()`` value is the full text you would
-assume. ``Text`` objects have both ``text`` and ``lines`` properties which
-can be either accessed or assigned to.
-
-``+=`` incremental assignment 
-automatically removes blank starting and ending lines, and any whitespace prefix
-that is common to all of the lines (i.e. it will *dedent* any given text).
-This ensures you don't need to give up
-nice Python program formatting just to include a template.
-
-While ``+=`` is a handy way of incrementally building text, it
-isn't strictly necessary in the simple example above; the
-``Text(...)`` constructor itself accepts a string or set of lines.
-
-Other in-place operators are: `|=`` for adding text while preserving leading white
-space (no dedent) and ``&=`` adds text verbatim--without dedent or string
-interpolation. 
-
-One can ``read_from()`` a file (appending the contents of the file to the given
-text object, with optional interpolation and dedenting). One can also 
-``write_to()`` a file. Use the ``append`` flag if you wish to add to rather than
-overwrite the file of a given name, and you can set an output encoding if you
-like (``encoding='utf=8'`` is the default).
-
-So far we've discussed``Text`` objects almost like strings, but they also act
-as lists of individual lines (strings). They are, for example,
-indexible via ``[]``, and they are iterable.
-Their ``len()`` is the number of lines they contain. One can
-``append()`` or ``extend()`` them with one or multiple strings, respectively.
-``append()`` takes a keyword parameter ``interpolate`` that controls whether
-``{}`` expressions in the string are interpolated. ``extend()`` additionally takes
-a ``dedent`` flag that, if true, will
-automatically remove blank starting and ending lines, and any whitespace prefix
-that is common to all of the lines.
-
-``Text`` objects, unlike strings, are mutable. The ``replace(x, y)`` method will
-replace all instances of ``x`` with ``y`` *in situ*. If given just one argument,
-a ``dict``, all the keys will be replaced with their corresponding values.
-
-``Text`` doesn't have the full set of text-onboarding options seen in `textdata
-<http://pypi.python.org/pypi/textdata>`_, but it should suit many cirumstances.
-If you need more, ``textdata`` can be used alongside ``Text``.
-
-
-Your Own Iterpolators
-=====================
-
-If you want to write your own functions that take strings and interpolate ``{}``
-format tempaltes in them, you can look at ``say`` souce code and see how to
-do it (see e.g. ``say.text.Text``). But there's an easier way::
-
-    from say import caller_fmt
-    
-    def ucfmt(s):
-        return caller_fmt(s).upper()
-
-If ``ucfmt()`` had used ``fmt()``, it would not have worked. ``fmt()`` would
-look for interpolating values within the context of ``ucfmt()`` and, not finding
-any, probably raised an exception. But using ``caller_fmt()`` it looks into the
-context of the caller of ``ucfmt()``, which is exactly where those values would
-reside. *Voila!*
-
-Python 3
-========
-
-Say works virtually the same way in Python 2 and Python 3. This can simplify 
-software that should work across the versions, without all the ``from __future__
-import print_function`` hassle.
-
-``say`` attempts to mask some of the quirky compexities of the 2-to-3 divide,
-such as string encodings and codec use.
-
-
-Alternatives
-============
-
- * `ScopeFormatter <http://pypi.python.org/pypi/ScopeFormatter>`_
-   provides variable interpolation into strings. It is amazingly
-   compact and elegant. Sadly, it only interpolates Python names, not full
-   expressions. ``say`` has full expressions, as well as a framework for
-   higher-level printing features beyond ``ScopeFormatter``'s...um...scope.
-
- * `interpolate <https://pypi.python.org/pypi/interpolate>`_ is 
-   similar to ``say.fmt()``, in that it can 
-   interpolate complex Python expressions, not just names.
-   It's ``i % "format string"`` syntax is a little odd, however, in
-   the way that it repurposes Python's earlier ``"C format string" % (values)``
-   style ``%`` operator. It also depends on the native ``print`` statement
-   or function, which doesn't help bridge Python 2 and 3.
-   
- * Even simpler are invocations of ``%`` or ``format()``
-   using ``locals()``. E.g.::
-   
-       name = "Joe"
-       print "Hello, %(name)!" % locals()
-       # or
-       print "Hello, {name}!".format(**locals())
-       
-   Unfortunately this has even more limitations than ``ScopeFormatter``: it only supports
-   local variables, not globals or expressions. And the interpolation code seems
-   gratuitous. Simpler::
-   
-      say("Hello, {name}!")
-
-Notes
-=====
-
- *  The ``say`` name was inspired by Perl's `say <http://perldoc.perl.org/functions/say.html>`_,
-    but the similarity stops there.
-    
- *  The ``show`` debug printing functions previously in this package
-    have been split into a separate package,
-    `show <http://pypi.python.org/pypi/show>`_.
-    
- *  A new text aggregation class, ``Text`` is now available.
-   
- *  Automated multi-version testing is managed with the wonderful
-    `pytest <http://pypi.python.org/pypi/pytest>`_
-    and `tox <http://pypi.python.org/pypi/tox>`_. ``say`` is now
-    successfully packaged for, and tested against, all late-model verions of
-    Python: 2.6, 2.7, 3.2, and 3.3, as well as PyPy 1.9 (based on 2.7.2).
- 
- *  ``say`` has greater ambitions than just simple template printing. It's part
-    of a larger rethinking of how output should be formatted. ``show()`` and ``Text``
-    are down-payments on this larger vision. Stay tuned for more.
- 
- *  In addition to being a practical module in its own right, ``say`` is
-    testbed for `options <http://pypi.python.org/pypi/options>`_, a package
-    that provides high-flexibility option, configuration, and parameter
-    management.
- 
- *  The author, `Jonathan Eunice <mailto:jonathan.eunice@gmail.com>`_ or
-    `@jeunice on Twitter <http://twitter.com/jeunice>`_
-    welcomes your comments and suggestions.
-    
-To-Dos
-======
-
- *  Provide code that allows ``pylint`` to see that variables used inside
-    the ``say`` and ``fmt`` format strings are indeed thereby used.
-
-Installation
-============
-
-To install the latest version::
-
-    pip install -U say
-
-To ``easy_install`` under a specific Python version (3.3 in this example)::
-
-    python3.3 -m easy_install --upgrade say
-    
-(You may need to prefix these with "sudo " to authorize installation.)
+For this and much more, see `the full documentation at Read the Docs
+<http://say.readthedocs.org/en/latest/>`_. 
+# Makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS    =
+SPHINXBUILD   = sphinx-build
+PAPER         =
+BUILDDIR      = _build
+
+# Internal variables.
+PAPEROPT_a4     = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+# the i18n builder cannot share the environment and doctrees with the others
+I18NSPHINXOPTS  = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+
+.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
+
+help:
+	@echo "Please use \`make <target>' where <target> is one of"
+	@echo "  html       to make standalone HTML files"
+	@echo "  dirhtml    to make HTML files named index.html in directories"
+	@echo "  singlehtml to make a single large HTML file"
+	@echo "  pickle     to make pickle files"
+	@echo "  json       to make JSON files"
+	@echo "  htmlhelp   to make HTML files and a HTML help project"
+	@echo "  qthelp     to make HTML files and a qthelp project"
+	@echo "  devhelp    to make HTML files and a Devhelp project"
+	@echo "  epub       to make an epub"
+	@echo "  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+	@echo "  latexpdf   to make LaTeX files and run them through pdflatex"
+	@echo "  text       to make text files"
+	@echo "  man        to make manual pages"
+	@echo "  texinfo    to make Texinfo files"
+	@echo "  info       to make Texinfo files and run them through makeinfo"
+	@echo "  gettext    to make PO message catalogs"
+	@echo "  changes    to make an overview of all changed/added/deprecated items"
+	@echo "  linkcheck  to check all external links for integrity"
+	@echo "  doctest    to run all doctests embedded in the documentation (if enabled)"
+
+clean:
+	-rm -rf $(BUILDDIR)/*
+
+html:
+	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+	@echo
+	@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+
+dirhtml:
+	$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
+	@echo
+	@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+
+singlehtml:
+	$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
+	@echo
+	@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
+
+pickle:
+	$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
+	@echo
+	@echo "Build finished; now you can process the pickle files."
+
+json:
+	$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
+	@echo
+	@echo "Build finished; now you can process the JSON files."
+
+htmlhelp:
+	$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
+	@echo
+	@echo "Build finished; now you can run HTML Help Workshop with the" \
+	      ".hhp project file in $(BUILDDIR)/htmlhelp."
+
+qthelp:
+	$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
+	@echo
+	@echo "Build finished; now you can run "qcollectiongenerator" with the" \
+	      ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
+	@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/say.qhcp"
+	@echo "To view the help file:"
+	@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/say.qhc"
+
+devhelp:
+	$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
+	@echo
+	@echo "Build finished."
+	@echo "To view the help file:"
+	@echo "# mkdir -p $$HOME/.local/share/devhelp/say"
+	@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/say"
+	@echo "# devhelp"
+
+epub:
+	$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
+	@echo
+	@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
+
+latex:
+	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+	@echo
+	@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
+	@echo "Run \`make' in that directory to run these through (pdf)latex" \
+	      "(use \`make latexpdf' here to do that automatically)."
+
+latexpdf:
+	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+	@echo "Running LaTeX files through pdflatex..."
+	$(MAKE) -C $(BUILDDIR)/latex all-pdf
+	@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+text:
+	$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
+	@echo
+	@echo "Build finished. The text files are in $(BUILDDIR)/text."
+
+man:
+	$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
+	@echo
+	@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
+
+texinfo:
+	$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+	@echo
+	@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
+	@echo "Run \`make' in that directory to run these through makeinfo" \
+	      "(use \`make info' here to do that automatically)."
+
+info:
+	$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+	@echo "Running Texinfo files through makeinfo..."
+	make -C $(BUILDDIR)/texinfo info
+	@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
+
+gettext:
+	$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
+	@echo
+	@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
+
+changes:
+	$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
+	@echo
+	@echo "The overview file is in $(BUILDDIR)/changes."
+
+linkcheck:
+	$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
+	@echo
+	@echo "Link check complete; look for any errors in the above output " \
+	      "or in $(BUILDDIR)/linkcheck/output.txt."
+
+doctest:
+	$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
+	@echo "Testing of doctests in the sources finished, look at the " \
+	      "results in $(BUILDDIR)/doctest/output.txt."
+# -*- coding: utf-8 -*-
+#
+# say documentation build configuration file, created by
+# sphinx-quickstart on Fri Sep 13 19:35:44 2013.
+#
+# 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.
+
+import sys, 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
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#sys.path.insert(0, os.path.abspath('.'))
+
+# -- 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']
+
+# 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'
+
+# General information about the project.
+project = u'say'
+copyright = u'2013, Jonathan Eunice'
+
+# 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 = '1.0'
+# The full version, including alpha/beta/rc tags.
+release = '1.0.1'
+
+# 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 = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+
+# -- 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 = 'default'
+
+# 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 = []
+
+# 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 = {}
+
+# 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 = 'saydoc'
+
+
+# -- 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', 'say.tex', u'say Documentation',
+   u'Jonathan Eunice', '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', 'say', u'say Documentation',
+     [u'Jonathan Eunice'], 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', 'say', u'say Documentation',
+   u'Jonathan Eunice', 'say', 'One line description of project.',
+   'Miscellaneous'),
+]
+
+# 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'
+say
+===
+
+
+``print``, ``format``, and ``%``, evolved.
+
+    **Q:** It's been *forty years* since ``C`` introduced ``printf()`` and the basic
+    formatted printing of positional parameters. Isn't it time for an upgrade?
+
+    **A:** Yes! ZOMG, yes!
+    
+``say`` supplements or replaces Python's ``print``
+statement/function, ``format`` function/method, and ``%`` string interpolation
+operator with higher-level facilities:
+
+ *  Straightforward string formatting with DRY, Pythonic
+    templates that piggyback the built in ``format()`` method,  
+    formatting syntax, and well-proven underlying engine.
+ *  A single output mechanism compatible with both Python 2.x and Python 3.x.
+ *  Indentation and wrapping (to help stucture output)
+ *  Convenience printing functions for horizontal rules (lines), titles, and
+    vertical whitespace.
+ *  Convenient template/text aggregator objects for easily building,
+    reading, and writing mutli-line texts.
+
+Usage
+=====
+
+::
+
+    from say import say, fmt
+    
+    x = 12
+    nums = list(range(4))
+    
+    say("There are {x} things.")
+    say("Nums has {len(nums)} items: {nums}")
+    
+yields::
+
+    There are 12 things.
+    Nums has 4 items: [0, 1, 2, 3]
+
+``say`` is basically a simpler, nicer recasting of::
+    
+    print "There are {} things.".format(x)
+    print "Nums has {} items: {}".format(len(nums), nums)
+    
+(NB in Python 2.6 one must number each of the ``{}`` placeholders--e.g. ``"Nums
+has {0} items: {1}"``-- in order to avoid a ``ValueError: zero length field name
+in format`` error. Python 2.7 and later assume the placeholders are sequential.)
+    
+The more items that are being printed, and the complicated the ``format``
+invocation, the more valuable having it stated in-line becomes. Note that full
+expressions are are supported. They are evaluated in the context of the caller.
+
+Printing Where You Like
+=======================
+
+``say()`` writes to a list of files--by default just ``sys.stdout``. But
+with one simple configuration call, it will write to different--even
+multiple--files::
+
+    from say import say, stdout
+    
+    say.setfiles([stdout, "report.txt"])
+    say(...)   # now prints to both stdout and report.txt
+
+This has the advantage of allowing you to both capture and see
+program output, without changing
+any code (other than the config statement). You can also define your own targeted ``Say`` instances::
+
+    from say import say, Say, stderr
+    
+    err = say.clone().setfiles([stderr, 'error.txt'])
+    err("Failed with error {errcode}")  # writes to stderr, error.txt
+    
+Note that ``stdout`` and ``stderr`` are just convenience aliases to
+the respective 
+``sys`` equivalents.
+
+Printing When You Like
+======================
+
+If you want to stop printing for a while::
+
+    say.set(silent=True)  # no printing until set to False
+    
+Or transiently::
+
+    say(...stuff..., silent=not verbose) # prints iff bool(verbose) is True
+
+Of course, you don't have to print to any file. There's a predefined sayer
+``fmt()`` that works exactly like ``say()`` and inherits most of
+its options, but 
+doesn't print. (The
+``C`` analogy: ``say`` **:** ``fmt`` **::** ``printf`` **:** ``sprintf``.)
+
+Indentation and Wrapping
+========================
+
+Indentation is a common way to display data hierarchically. ``say`` will
+help you manage it. For example::
+
+    say('TITLE')
+    for item in items:
+        say(item, indent=1)
+   
+will indent the items by one indentation level (by default, each indent
+level is four spaces, but
+you can change that with the ``indent_str`` option). 
+
+If you want to change the default indentation level::
+
+    say.set(indent=1)      # to an absolute level
+    say.set(indent='+1')   # strings => set relative to current level
+    
+    ...
+    
+    say.set(indent=0)      # to get back to the default, no indent
+
+Or you can use a ``with`` construct::
+
+    with say.settings(indent='+1'):
+        say(...)
+        
+        # anything say() emits here will be auto-indented +1 levels
+        
+    # anything say() emits here, after the with, will not be indented +1
+
+And if you have a lot of data or text to print, you can easily wrap it::
+
+    say("This is a really long...blah blah blah", wrap=40)
+    
+Will automatically wrap the text to the given width (using Python's standard ``textwrap`` module).
+
+While it's easy enough for any ``print`` statement or function to have a few
+space characters added to its format string, it's easy to mistakenly type too
+many or too few spaces, or to forget to type them in some format strings. And if
+you're indenting strings that themselves may contain multiple lines, the simple
+``print`` approach breaks because won't take multi-line strings into account.
+And it won't be integrated with wrapping.
+
+``say``, however, simply handles the indent level and wrapping, and it properly
+handles the multi-line string case. Subsequent lines will be just as nicely and
+correctly indented as the first one--something not otherwise easily accomplished
+without adding gunky, complexifying string manipulation code to every place in
+your program that prints strings.
+
+This starts to illustrate the "do the right thing" philosophy behind ``say``. So
+many languages' printing and formatting functions a restricted to "outputting
+values" at a low level. They may format basic data types, but they don't provide
+straightforward ways to do neat text transformations like indentation that let
+programmers rapidly provide correct, highly-formatted ouput. Over time, ``say``
+will provide higher-level formatting options. For now: indentation and wrapping.
+
+Encodings
+=========
+
+``say()`` and 
+``fmt()`` try to work with Unicode strings, for example providing them as
+return values. But character encodings remain a fractious and often exasperating
+part of IT. When writing formatted strings, ``say`` handles this by encoding
+into ``utf-8``.
+
+If you are using strings containing ``utf-8`` rather than Unicode characters, ``say`` 
+may complain. But it complains in the same places the built-in ``format()`` does,
+so no harm done. (Python 3 doesn't generally allow ``utf-8`` in strings, so it's
+cleaner on this front.)
+
+You can get creative with the encoding::
+
+    say('I am a truck!', encoding='base64')  # SSBhbSBhIHRydWNrIQo=
+
+Or change the default::
+
+    say.set(encoding='rot-13')
+    
+Knock yourself out with `all the exciting opportunites
+<http://docs.python.org/library/codecs.html#standard-encodings>`_!
+If you really want the formatted text returned just as it is written to files,
+use the ``encoded`` option. Set to ``True`` and it returns text in the output
+encoding. Or set to an actual encoding name, and that will be the return encoding.
+
+``say()`` returns the formatted text with one small tweak: it removes the final
+newline if a newline is the very last character. Though odd, this is exactly
+what you need if you're going to ``print`` or
+``say`` the resulting text without a gratuitous "extra" newline.
+
+Titles and Horizontal Rules
+===========================
+
+``say`` defines a few convenience formatting functions::
+
+    say.title('Errors', sep='-')
+    for i,e in enumerate(errors, start=1):
+        say("{i:3}: {e['name'].upper()}")
+        
+might yield::
+
+    --------------- Errors ---------------
+      1: I/O ERROR
+      2: COMPUTE ERROR
+
+A similar method ``hr`` produces just a horizontal line, like
+the HTML ``<hr>`` element. For either, one can optionally 
+specify the width (``width``), character repeated to make the line (``sep``),
+and vertical separation/whitespace above and below the item (``vsep``).
+Good options for the separator might be be '-', '=', or parts of the `Unicode 
+box drawing character set <http://en.wikipedia.org/wiki/Box-drawing_character>`_.
+
+Non-Functional Invocation
+=========================
+
+For those who don't want to always and forever surround "print statements" with
+the Python 3-style function parentheses, the ``>`` operator is
+provided as an experimental, non-functional way to print. The following
+are identical::
+
+    say> "{user.id}: {user.username}"
+    say("{user.id}: {user.username}")
+    
+You can name as many values as you like in the format string, but there can
+only be one format string, and no options. If you need to ``say`` multiple values,
+or say them with statement-specific options, you must use the functional syntax.
+    
+
+Text and Templates
+==================
+
+Often the job of output is not about individual text lines, but about creating
+multi-line files such as scripts and reports. This often leads away from standard
+output mechanisms toward template pakcages, but ``say`` has you covered here as
+well.::
+
+    from say import Text
+    
+    # assume `hostname` and `filepath` already defined
+    
+    script = Text()
+    script += """
+        !#/bin/bash
+        
+        # Output the results of a ping command to the given file
+        
+        ping {hostname} >{filepath}
+    """
+    
+    script.write_to("script.sh")
+    
+``Text`` objects are basically a list of text lines. In most cases, when you add
+text (either as multi-line strings or lists of strings), ``Text`` will
+automatically interopolate variables the same way ``say`` does. One can
+simply ``print`` or
+``say`` ``Text`` objects, as their ``str()`` value is the full text you would
+assume. ``Text`` objects have both ``text`` and ``lines`` properties which
+can be either accessed or assigned to.
+
+``+=`` incremental assignment 
+automatically removes blank starting and ending lines, and any whitespace prefix
+that is common to all of the lines (i.e. it will *dedent* any given text).
+This ensures you don't need to give up
+nice Python program formatting just to include a template.
+
+While ``+=`` is a handy way of incrementally building text, it
+isn't strictly necessary in the simple example above; the
+``Text(...)`` constructor itself accepts a string or set of lines.
+
+Other in-place operators are: `|=`` for adding text while preserving leading white
+space (no dedent) and ``&=`` adds text verbatim--without dedent or string
+interpolation. 
+
+One can ``read_from()`` a file (appending the contents of the file to the given
+text object, with optional interpolation and dedenting). One can also 
+``write_to()`` a file. Use the ``append`` flag if you wish to add to rather than
+overwrite the file of a given name, and you can set an output encoding if you
+like (``encoding='utf=8'`` is the default).
+
+So far we've discussed``Text`` objects almost like strings, but they also act
+as lists of individual lines (strings). They are, for example,
+indexible via ``[]``, and they are iterable.
+Their ``len()`` is the number of lines they contain. One can
+``append()`` or ``extend()`` them with one or multiple strings, respectively.
+``append()`` takes a keyword parameter ``interpolate`` that controls whether
+``{}`` expressions in the string are interpolated. ``extend()`` additionally takes
+a ``dedent`` flag that, if true, will
+automatically remove blank starting and ending lines, and any whitespace prefix
+that is common to all of the lines.
+
+``Text`` objects, unlike strings, are mutable. The ``replace(x, y)`` method will
+replace all instances of ``x`` with ``y`` *in situ*. If given just one argument,
+a ``dict``, all the keys will be replaced with their corresponding values.
+
+``Text`` doesn't have the full set of text-onboarding options seen in `textdata
+<http://pypi.python.org/pypi/textdata>`_, but it should suit many cirumstances.
+If you need more, ``textdata`` can be used alongside ``Text``.
+
+
+Your Own Iterpolators
+=====================
+
+If you want to write your own functions that take strings and interpolate ``{}``
+format tempaltes in them, you can look at ``say`` souce code and see how to
+do it (see e.g. ``say.text.Text``). But there's an easier way::
+
+    from say import caller_fmt
+    
+    def ucfmt(s):
+        return caller_fmt(s).upper()
+
+If ``ucfmt()`` had used ``fmt()``, it would not have worked. ``fmt()`` would
+look for interpolating values within the context of ``ucfmt()`` and, not finding
+any, probably raised an exception. But using ``caller_fmt()`` it looks into the
+context of the caller of ``ucfmt()``, which is exactly where those values would
+reside. *Voila!*
+
+Python 3
+========
+
+Say works virtually the same way in Python 2 and Python 3. This can simplify 
+software that should work across the versions, without all the ``from __future__
+import print_function`` hassle.
+
+``say`` attempts to mask some of the quirky compexities of the 2-to-3 divide,
+such as string encodings and codec use.
+
+
+Alternatives
+============
+
+ * `ScopeFormatter <http://pypi.python.org/pypi/ScopeFormatter>`_
+   provides variable interpolation into strings. It is amazingly
+   compact and elegant. Sadly, it only interpolates Python names, not full
+   expressions. ``say`` has full expressions, as well as a framework for
+   higher-level printing features beyond ``ScopeFormatter``'s...um...scope.
+
+ * `interpolate <https://pypi.python.org/pypi/interpolate>`_ is 
+   similar to ``say.fmt()``, in that it can 
+   interpolate complex Python expressions, not just names.
+   It's ``i % "format string"`` syntax is a little odd, however, in
+   the way that it repurposes Python's earlier ``"C format string" % (values)``
+   style ``%`` operator. It also depends on the native ``print`` statement
+   or function, which doesn't help bridge Python 2 and 3.
+   
+ * Even simpler are invocations of ``%`` or ``format()``
+   using ``locals()``. E.g.::
+   
+       name = "Joe"
+       print "Hello, %(name)!" % locals()
+       # or
+       print "Hello, {name}!".format(**locals())
+       
+   Unfortunately this has even more limitations than ``ScopeFormatter``: it only supports
+   local variables, not globals or expressions. And the interpolation code seems
+   gratuitous. Simpler::
+   
+      say("Hello, {name}!")
+
+Notes
+=====
+
+ *  The ``say`` name was inspired by Perl's `say <http://perldoc.perl.org/functions/say.html>`_,
+    but the similarity stops there.
+    
+ *  The ``show`` debug printing functions previously in this package
+    have been split into a separate package,
+    `show <http://pypi.python.org/pypi/show>`_.
+    
+ *  A new text aggregation class, ``Text`` is now available.
+   
+ *  Automated multi-version testing is managed with the wonderful
+    `pytest <http://pypi.python.org/pypi/pytest>`_
+    and `tox <http://pypi.python.org/pypi/tox>`_. ``say`` is now
+    successfully packaged for, and tested against, all late-model verions of
+    Python: 2.6, 2.7, 3.2, and 3.3, as well as PyPy 1.9 (based on 2.7.2).
+ 
+ *  ``say`` has greater ambitions than just simple template printing. It's part
+    of a larger rethinking of how output should be formatted. ``show()`` and ``Text``
+    are down-payments on this larger vision. Stay tuned for more.
+ 
+ *  In addition to being a practical module in its own right, ``say`` is
+    testbed for `options <http://pypi.python.org/pypi/options>`_, a package
+    that provides high-flexibility option, configuration, and parameter
+    management.
+ 
+ *  The author, `Jonathan Eunice <mailto:jonathan.eunice@gmail.com>`_ or
+    `@jeunice on Twitter <http://twitter.com/jeunice>`_
+    welcomes your comments and suggestions.
+    
+To-Dos
+======
+
+ *  Provide code that allows ``pylint`` to see that variables used inside
+    the ``say`` and ``fmt`` format strings are indeed thereby used.
+
+Installation
+============
+
+To install the latest version::
+
+    pip install -U say
+
+To ``easy_install`` under a specific Python version (3.3 in this example)::
+
+    python3.3 -m easy_install --upgrade say
+    
+(You may need to prefix these with "sudo " to authorize installation.)
+
+.. toctree::
+   :maxdepth: 2
+
 
 setup(
     name='say',
-    version="1.0",
+    version="1.0.1",
     author='Jonathan Eunice',
     author_email='jonathan.eunice@gmail.com',
     description='Super-simple templated printing. E.g.: say("Hello, {whoever}!", indent=1)',
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.