# wxr2md - Convert WXR Files into Markdown
Convert WordPress exPort RSS (WXR) files to Markdown files with YAML frontmatter.
## Installation
Install using pip,
```sh
pip install wxr2md
```
## Usage
```
usage: wxr2md [-h] [--output OUTPUT] [--no-frontmatter] [--title-in-body] [--date-in-body] input
Convert WordPress eXport RSS (WXR) into Markdown files
positional arguments:
input path to the WXR file to be converted
options:
-h, --help show this help message and exit
--output OUTPUT output directory, defaults to 'out/' in the current working directory
--no-frontmatter don't add YAML frontmatter to the markdown file
--title-in-body add title in the markdown body as an h1 element
--date-in-body print date at the start of the markdown body
```
## Output
By default, the script will output to `out/` folder in the current working directory.
The markdown file output is as follows. The frontmatter mostly follows the frontmatter properties of [Hugo](https://gohugo.io/), except for `id`.
```markdown
---
id: 1
title: Hello, world!
type: post
date: 1970-01-01 12:34:56
lastmod: 1980-02-02 01:02:03
categories:
- a category
- another category
tags:
- my tag
- your tag
draft: true
---
# Hello, world! <!-- If passing in --title-in-body argument -->
_Mon 01 Jan 1970, 12:34_ <!-- If passing in --date-in-body argument -->
This is the content of the blog post. Perhaps there are a few sentences here.
```
## Limitations:
- only tested with WXR version 1.2 and a limited set of exports, so might not be compatible for all WXR files
- `date` and `lastmod` is in local timezone and does not include timezone data
- blog information is not outputed anywhere (e.g. description, url, etc.)
- no option to customise the output file names and folder structures
## Building
This package uses [poetry](https://python-poetry.org/) for dependency management and packaging. See their documentation for setup and usage.
Raw data
{
"_id": null,
"home_page": "https://github.com/nikolasdion/wxr2md",
"name": "wxr2md",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.11,<4.0",
"maintainer_email": "",
"keywords": "wxr,wordpress,markdown",
"author": "Dion Susanto",
"author_email": "nikolasdion@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/2c/f6/135b1d2ede16ce192d4b18c77b3e3b1413ee02f5d026e0f895071b7566b9/wxr2md-0.3.0.tar.gz",
"platform": null,
"description": "# wxr2md - Convert WXR Files into Markdown\n\nConvert WordPress exPort RSS (WXR) files to Markdown files with YAML frontmatter.\n\n## Installation\n\nInstall using pip,\n\n```sh\npip install wxr2md\n```\n\n## Usage\n\n```\nusage: wxr2md [-h] [--output OUTPUT] [--no-frontmatter] [--title-in-body] [--date-in-body] input\n\nConvert WordPress eXport RSS (WXR) into Markdown files\n\npositional arguments:\n input path to the WXR file to be converted\n\noptions:\n -h, --help show this help message and exit\n --output OUTPUT output directory, defaults to 'out/' in the current working directory\n --no-frontmatter don't add YAML frontmatter to the markdown file\n --title-in-body add title in the markdown body as an h1 element\n --date-in-body print date at the start of the markdown body\n```\n\n## Output\n\nBy default, the script will output to `out/` folder in the current working directory.\n\nThe markdown file output is as follows. The frontmatter mostly follows the frontmatter properties of [Hugo](https://gohugo.io/), except for `id`.\n\n```markdown\n---\nid: 1\ntitle: Hello, world!\ntype: post\ndate: 1970-01-01 12:34:56\nlastmod: 1980-02-02 01:02:03\ncategories:\n - a category\n - another category\ntags:\n - my tag\n - your tag\ndraft: true\n---\n\n# Hello, world! <!-- If passing in --title-in-body argument -->\n\n_Mon 01 Jan 1970, 12:34_ <!-- If passing in --date-in-body argument -->\n\nThis is the content of the blog post. Perhaps there are a few sentences here.\n```\n\n## Limitations:\n\n- only tested with WXR version 1.2 and a limited set of exports, so might not be compatible for all WXR files\n- `date` and `lastmod` is in local timezone and does not include timezone data\n- blog information is not outputed anywhere (e.g. description, url, etc.)\n- no option to customise the output file names and folder structures\n\n## Building\n\nThis package uses [poetry](https://python-poetry.org/) for dependency management and packaging. See their documentation for setup and usage.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Converter for WordPress eXport RSS (WXR) files into Markdown files",
"version": "0.3.0",
"project_urls": {
"Homepage": "https://github.com/nikolasdion/wxr2md",
"Repository": "https://github.com/nikolasdion/wxr2md"
},
"split_keywords": [
"wxr",
"wordpress",
"markdown"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f30761bee2161707c97ee2046f9517a1e9307453fdd8d4714028386e09aea86f",
"md5": "248cd7495c30facba1e0aa333f0eea52",
"sha256": "7424612f724422a7761697e2f0fc892ab1ddaa4a8999de6e2ea0969f788a1ea6"
},
"downloads": -1,
"filename": "wxr2md-0.3.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "248cd7495c30facba1e0aa333f0eea52",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11,<4.0",
"size": 5348,
"upload_time": "2024-01-19T21:15:23",
"upload_time_iso_8601": "2024-01-19T21:15:23.408767Z",
"url": "https://files.pythonhosted.org/packages/f3/07/61bee2161707c97ee2046f9517a1e9307453fdd8d4714028386e09aea86f/wxr2md-0.3.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2cf6135b1d2ede16ce192d4b18c77b3e3b1413ee02f5d026e0f895071b7566b9",
"md5": "c67cbe40209167ff986e8e59add62d0b",
"sha256": "68d1085ca6f1955bfe0ac4c14dabdcc093ade889b02324ac1b0e2b8ac78e8062"
},
"downloads": -1,
"filename": "wxr2md-0.3.0.tar.gz",
"has_sig": false,
"md5_digest": "c67cbe40209167ff986e8e59add62d0b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11,<4.0",
"size": 4641,
"upload_time": "2024-01-19T21:15:30",
"upload_time_iso_8601": "2024-01-19T21:15:30.347133Z",
"url": "https://files.pythonhosted.org/packages/2c/f6/135b1d2ede16ce192d4b18c77b3e3b1413ee02f5d026e0f895071b7566b9/wxr2md-0.3.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-19 21:15:30",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "nikolasdion",
"github_project": "wxr2md",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "wxr2md"
}