aboutsummaryrefslogtreecommitdiffstats
path: root/docs/command_line.txt
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2008-10-15 22:45:32 -0400
committerWaylan Limberg <waylan@gmail.com>2008-10-15 22:45:32 -0400
commit1ae68f81bdf22d764f6283f8fd70b3b11e33dad0 (patch)
treea1112441e2d884bb11ea645634f81969560b1072 /docs/command_line.txt
parent32eeea883fa316fbcff49b790c269b2e35083619 (diff)
downloadmarkdown-1ae68f81bdf22d764f6283f8fd70b3b11e33dad0.tar.gz
markdown-1ae68f81bdf22d764f6283f8fd70b3b11e33dad0.tar.bz2
markdown-1ae68f81bdf22d764f6283f8fd70b3b11e33dad0.zip
Added docs for command line and using as a module.
Diffstat (limited to 'docs/command_line.txt')
-rw-r--r--docs/command_line.txt57
1 files changed, 57 insertions, 0 deletions
diff --git a/docs/command_line.txt b/docs/command_line.txt
new file mode 100644
index 0000000..8ec2522
--- /dev/null
+++ b/docs/command_line.txt
@@ -0,0 +1,57 @@
+Using Python-Markdown on the Command Line
+=========================================
+
+While Python-Markdown is primarily a python library, it also serves as a
+command line program. While there are many other command line implementations
+of Markdown, you may not have them installed, or you may prefer to use
+Python-Markdown's various extensions.
+
+The Basics
+----------
+
+To use ``markdown.py`` from the command line, run it as
+
+ python markdown.py input_file.txt
+
+or
+
+ python markdown.py input_file.txt > output_file.html
+
+More Options
+
+If you are using Python 2.3 or higher, you can also use advanced
+command line options to specify encoding or to run extensions.
+
+ $ python markdown.py
+ Usage: markdown.py INPUTFILE [options]
+
+ Options:
+ -h, --help show this help message and exit
+ -f OUTPUT_FILE, --file=OUTPUT_FILE
+ write output to OUTPUT_FILE
+ -e ENCODING, --encoding=ENCODING
+ encoding for input and output files
+ -q, --quiet suppress all messages
+ -v, --verbose print info messages
+ -s SAFE_MODE, --safe=SAFE_MODE
+ safe mode ('replace', 'remove' or 'escape' user's
+ HTML tag)
+ --noisy print debug messages
+ -x EXTENSION, --extension=EXTENSION
+ load extension EXTENSION
+
+Using Extensions
+----------------
+
+For an extension to be ran this way it must be provided in a module
+named ``mdx_{extensionname}.py`` which should be in your python path,
+e.g. ``mdx_footnotes.py``. It can then be invoked as by name (the
+part after "mdx_"):
+
+ python markdown.py -x footnotes text_with_footnotes.txt > output.html
+
+If the extension supports config options (see below), you can also
+pass them in as well:
+
+ python markdown.py -x "footnotes(PLACE_MARKER=~~~~~~~~)" input.txt
+