1
0
Fork 0
forked from github/pelican
pelican-theme/docs/importer.rst

89 lines
2.6 KiB
ReStructuredText
Raw Normal View History

.. _import:
2011-08-03 22:06:10 +02:00
=================================
Import from other blog software
=================================
Description
===========
``pelican-import`` is a command line tool for converting articles from other
2011-08-03 22:06:10 +02:00
software to ReStructuredText. The supported formats are:
- WordPress XML export
2011-08-03 22:06:10 +02:00
- Dotclear export
- RSS/Atom feed
2011-08-03 22:06:10 +02:00
The conversion from HTML to reStructuredText relies on `pandoc
2011-08-03 22:06:10 +02:00
<http://johnmacfarlane.net/pandoc/>`_. For Dotclear, if the source posts are
written with Markdown syntax, they will not be converted (as Pelican also
supports Markdown).
Dependencies
""""""""""""
``pelican-import`` has two dependencies not required by the rest of pelican:
- Beautiful Soup
- pandoc
Beautiful Soup can be installed like any other Python package::
$ pip install BeautifulSoup
2012-09-10 20:50:45 -07:00
For pandoc, install a package for your operating system from the
`pandoc site <http://johnmacfarlane.net/pandoc/installing.html>`_.
2011-08-03 22:06:10 +02:00
Usage
"""""
| pelican-import [-h] [--wpfile] [--dotclear] [--feed] [-o OUTPUT]
| [-m MARKUP] [--dir-cat] [--strip-raw] [--disable-slugs]
| input
2011-08-03 22:06:10 +02:00
Positional arguments
====================
input The input file to read
Optional arguments
""""""""""""""""""
2011-08-03 22:06:10 +02:00
-h, --help show this help message and exit
--wpfile Wordpress XML export (default: False)
--dotclear Dotclear export (default: False)
--feed Feed to parse (default: False)
2011-08-03 22:06:10 +02:00
-o OUTPUT, --output OUTPUT
Output path (default: output)
-m MARKUP, --markup MARKUP
Output markup format (supports rst & markdown)
(default: rst)
2011-08-03 22:06:10 +02:00
--dir-cat Put files in directories with categories name
(default: False)
--strip-raw Strip raw HTML code that can't be converted to markup
such as flash embeds or iframes (wordpress import
only) (default: False)
--disable-slugs Disable storing slugs from imported posts within
output. With this disabled, your Pelican URLs may not
be consistent with your original posts. (default:
False)
2011-08-03 22:06:10 +02:00
Examples
========
For WordPress::
2011-08-03 22:06:10 +02:00
$ pelican-import --wpfile -o ~/output ~/posts.xml
2011-08-03 22:06:10 +02:00
For Dotclear::
2011-08-03 22:06:10 +02:00
$ pelican-import --dotclear -o ~/output ~/backup.txt
2011-08-03 22:06:10 +02:00
Tests
=====
To test the module, one can use sample files:
- for Wordpress: http://wpcandy.com/made/the-sample-post-collection
- for Dotclear: http://themes.dotaddict.org/files/public/downloads/lorem-backup.txt