{ "info": { "author": "Gabor Laszlo Hajba", "author_email": "gabor.hajba@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python" ], "description": "This is a simple module meant to convert Markdown files to XML (XHTML) and send them to WordPress.com via XML-RPC.\n\nThe idea behind this all is to make the base of an open-source offline WordPress.com blog entry editor.\n\nThe first part converts the text written in a specific MarkDown language to XML (or XHTML).\nBecause I write currently my books for LeanPub I align the main conversion to the LeanPub MarkDown.\nHowever MD to XML conversion is a bit bothersome and there are many libraries which do this, I'll stick to Markdown a Python library for converting MarkDown files to X(HT)ML.\n\nThe mdxml.conf file contains custom configuration which is not available in markdown. For example the [sourcecode] block for WordPress. For this behavior I skip the markdown conversion for these lines of code.\nCurrently language and other options cannot be added for source codes.\n\nIf you have other configuration extensions (for example if you want to override the ~~~~~~~~ for source-codes, you can define it in your own conversion file and provide it as an argument to the application.\n\nEach configuration element has a starting and ending tag (although currently I am thinking about another way to solve this problem because XML files should be valid in the end...).\n\nOne problem with Markdown is, that you have to parse the whole text if you have multi-line elements (for example lists). If you do not do this, you'll end up with a bunch of lists.\n\nFeel free to create issues and change requests.\n\nThe application looks for the configuration file (containing wordpress endpoint, username, password and optional proxy configuration) in your home folder under the name *wpedit.conf*. Optionally you can provide it per commandline argument.\n\n\n

Usage

\n
\n    wpedit.py [-h] [-c CONFIG] [-m MDCONF] [-l] [-n NUMBER] [-U] [-V] post_file\n\npositional arguments:\n  post_file             The full path of the input file to send to WordPress.\n                        If used with the '-l' option it is the full path of\n                        the folder to save the drafts from WordPress.\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -c CONFIG, --config CONFIG\n                        The full path of the configuration file storing the\n                        XML-RPC endpoint, username and password. Per default\n                        the application looks at your home folder and searches\n                        for wpedit.conf\n  -m MDCONF, --mdconf MDCONF\n                        The full path of the md-to-xml conversion-extension\n                        file\n  -l, --load            Loads all draft posts into the folder where the\n                        'post_file' resides. The 'post_file' will not be sent\n                        to WordPress.\n  -n NUMBER, --number NUMBER\n                        The number of draft posts to load. Works only in\n                        combination with the '-l' argument.\n  -U, --update          Forces update of every draft loaded, the check for\n                        local modifications is disabled. Works only in\n                        combination with the '-l' argument.\n  -V, --verify          Enables verification of tags. If the blog post\n                        contains tags which are not defined, the article will\n                        not be sent to WordPress.\n
\n

File structure

\nThe markdown file is parsed and you can place special lines at the beginning of the text. These special lines have to start with **[** (square bracket). Once the parser encounters a line which does not start with [ the resulting text is treated as the content of the article.\n\n

Accepted special lines

\n[id] 1001 -- the ID of the blog post, if you create a new post, you do not have to provide an ID, Note if you provide an ID, the application attempts to edit the post with this ID.\n\n[title] Some title -- you can specify the post's title here, in the example \"Some title\" will be the title of the article. If you do not provide a title and the post does not have a title, the title will be set to \"My post\".\n\n[categories] Category 1, Category 2 -- a comma separated list of categories for your post. Optional, if not provided there will be no categories set. Starting with Version 0.3.1 categories are verified: if a category does not exist in the blog, you cannot post the entry.\n\n[tags] tag 1, tag 2, tag 3 -- a comma separated list for your post. Optional, if not provided there will be no tags set. Starting with Version 0.3.1 optional tag-verification is enabled. If you have the option enabled you can use only defined tags in your post.\n\n

Extra markdown

\nCurrently these extra markdonw symbols are configured for wpedit:\n
\n
~~~~~~~~ (tilde symbol 8 times)
Surrounds code blocks which will be presented as *[sourcecode]* in WordPess. Source code blocks can be enriched with key-value pairs to represent parameters of [sourcecode] blocks.\n~~~~~~~~{'language':'python', 'title':'Python source code example'} This line will be converted to: [sourcecode language=\"python\" title=\"Python source code example\"]
\n\n
-------- (dash 8 times)
Adds a read more tag to your article which will be presented as ** in WordPress.
\n\n
@@@ (\"at\" symbol 3 times)
Makes the surrounded text preformatted which will be presented as <pre> in WordPRess.
\n
\n

Changes

\n

Version 0.4.5

\n \n

Version 0.4.1

\n\n

Version 0.4

\n\n

Version 0.3.4

\n\n

Versions 0.3.2 and 0.3.3

\n