summaryrefslogtreecommitdiff
path: root/smartypants
diff options
context:
space:
mode:
authorYu-Jie Lin <livibetter@gmail.com>2013-08-24 22:00:01 +0800
committerYu-Jie Lin <livibetter@gmail.com>2013-08-24 22:00:01 +0800
commit47a373c61d28835552239c20cfd225c76371e980 (patch)
treef9d4c7c9430f1f61f5204abaf8ae2ec164049dfc /smartypants
parenta7122fc4c21f4705236eec0f47dbda3eeb53dbd3 (diff)
downloadsmartypants-47a373c61d28835552239c20cfd225c76371e980.tar.gz
huge changeset for documentation
Now the documentation is generated by Sphinx. Related commands and configurations are also added. Many moved from README.rst to docstrings in the module.
Diffstat (limited to 'smartypants')
-rwxr-xr-xsmartypants62
1 files changed, 62 insertions, 0 deletions
diff --git a/smartypants b/smartypants
index 5d1525c..c100d3d 100755
--- a/smartypants
+++ b/smartypants
@@ -2,6 +2,68 @@
# Copyright (c) 2013 Yu-Jie Lin
# Licensed under the BSD License, for detailed license information, see COPYING
+"""
+============
+Command-line
+============
+
+smartypants
+===========
+
+``smartypants`` provides a command-line interface for :py:mod:`smartypants`
+module, which is named as same as the module.
+
+It takes input from either standard input or files and output the result to
+standard output.
+
+
+Usage
+=====
+
+Syntax::
+
+ smartypants [-h] [-v] [-a ATTR] [-s SKIP] [FILE [FILE ...]]
+
+Some examples::
+
+ $ smartypants inputfile
+
+ $ command-foo inputfile | command-bar | smartypants
+
+
+Options
+=======
+
+``-a``, ``--attr``:
+ processe attrbutes tells smartypants how to translate,
+
+ The attributes is a string of characters, which are taken from the names of
+ attributes of :py:class:`smartypants.Attr <smartypants._Attr>`.
+
+ For example, the default attribute is
+ :py:attr:`smartypants.Attr.set1 <smartypants._Attr.set1>`::
+
+ smartypants -a 1
+
+ If you want :py:attr:`smartypants.Attr.q <smartypants._Attr.q>` and
+ :py:attr:`smartypants.Attr.w <smartypants._Attr.w>` then it would be invoked
+ as::
+
+ smartypants -a qw
+
+``-s``, ``--skip``:
+ skip specified HTML elements.
+
+ It is a comma-separated string. For example::
+
+ smartypants -s tag1,tag2,tag3
+
+``FILE``:
+ files to be processed.
+
+ If no ``FILE`` is specified, the input is taken from standard input.
+"""
+
from __future__ import print_function
import argparse
import sys