{ "info": { "author": "Jack Gaino", "author_email": "md2cf@jackgaino.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# md2cf\n\n[![image](https://img.shields.io/travis/iamjackg/md2cf/master.svg?label=master)](https://travis-ci.org/iamjackg/md2cf)\n\n[![image](https://img.shields.io/travis/iamjackg/md2cf/develop.svg?label=develop)](https://travis-ci.org/iamjackg/md2cf)\n\nA library to convert documents written in Markdown to Confluence Storage\nformat, and optionally upload them to a Confluence Server instance.\n\n## Features\n\n - **Convert Markdown documents.** The library implements a\n [Mistune](https://github.com/lepture/mistune) renderer that outputs\n Confluence Storage Format.\n - **Basic Confluence API support.** Embedded micro-implementation of\n the [Confluence Server REST\n API](https://developer.atlassian.com/server/confluence/confluence-server-rest-api/)\n with basic support for creating and updating pages.\n - **Upload automation.** Includes a small script that can automate the\n upload process for you.\n\n## Installation\n\nTBD\n\n## Basic Usage\n\n### Renderer\n\nUse the `ConfluenceRenderer` class to generate Confluence Storage Format\noutput from a markdown document.\n\n``` sourceCode python\nimport mistune\nfrom md2cf.confluence_renderer import ConfluenceRenderer\n\nrenderer = ConfluenceRenderer(use_xhtml=True)\nconfluence_mistune = mistune.Markdown(renderer=renderer)\nconfluence_body = confluence_mistune(markdown_data)\n```\n\n### API\n\nmd2cf embeds a teeny-tiny implementation of the Confluence Server REST\nAPI that allows you to create, read, and update pages.\n\n``` sourceCode python\nfrom md2cf.api import MinimalConfluence\n\nconfluence = MinimalConfluence(host='http://example.com/rest/api', username='foo', password='bar')\n\nconfluence.create_page(space='TEST', title='Test page', body='

Nothing

', message='Created page')\n\npage = confluence.get_page(title='Test page', space_key='TEST')\nconfluence.update_page(page=page, body='New content', message='Changed page contents')\n```\n\n### Upload script\n\nIn order to upload a document, you'll need to supply at least the\nfollowing five parameters:\n\n - The **hostname** of your Confluence instance, including the path to\n the REST API (e.g. `http://confluence.example.com/rest/api`)\n - The **username** to use for logging into the instance\n - The corresponding **password**\n - The **space** on which to upload the page\n - The **file(s)** to be uploaded -- or standard input if the list is\n missing\n\nExample basic\n usage:\n\n md2cf --host 'https://confluence.example.com/rest/api' --username foo --password bar --space TEST document.md\n\nNote that entering the password as a parameter on the command line is\ngenerally a bad idea. If you're running the script interactively, you\ncan omit the `--password` parameter and the script will prompt for it.\n\nIn addition, for the security conscious out there or those who plan on\nusing this as part of a pipeline, you can also supply the hostname,\nusername, and password as **environment variables**: `CONFLUENCE_HOST`,\n`CONFLUENCE_USERNAME`, and `CONFLUENCE_PASSWORD`.\n\nThe **title** of the page will be the first top-level header found in\nthe document (i.e. the first `#` header), or the filename if there are\nno top-level headers.\n\nIf you want to upload the page under **a specific parent**, supply the\nparent's page ID as the `--parent` parameter.\n\nYou can also optionally specify an **update message** to describe the\nchange you just made by using the `--message` parameter.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/iamjackg/md2cf", "keywords": "markdown confluence", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "md4cf", "package_url": "https://pypi.org/project/md4cf/", "platform": "", "project_url": "https://pypi.org/project/md4cf/", "project_urls": { "Homepage": "https://github.com/iamjackg/md2cf" }, "release_url": "https://pypi.org/project/md4cf/0.0.3/", "requires_dist": [ "mistune", "tortilla", "lxml", "beautifulsoup4" ], "requires_python": ">=3", "summary": "Convert Markdown documents to Confluence", "version": "0.0.3" }, "last_serial": 5221709, "releases": { "0.0.2": [ { "comment_text": "", "digests": { "md5": "c7ed9a69ae9397713cfc122498824875", "sha256": "795d0aff8aefa8336742306747c2defdf27326fde1e3027884cacda3669efcca" }, "downloads": -1, "filename": "md4cf-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "c7ed9a69ae9397713cfc122498824875", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 7426, "upload_time": "2019-05-03T12:42:04", "url": "https://files.pythonhosted.org/packages/72/bb/0f84f32dc76183a01bf5b096613d335f00bd913503dee1dab599a90dba56/md4cf-0.0.2-py3-none-any.whl" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "faf87432fbf464c39e15515678f24bd1", "sha256": "ba261ff75dd560b150861b4d15fdbe88d173465f76c0b1fa7bf04bdc21c222c1" }, "downloads": -1, "filename": "md4cf-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "faf87432fbf464c39e15515678f24bd1", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 7420, "upload_time": "2019-05-03T12:52:41", "url": "https://files.pythonhosted.org/packages/e4/0f/a5d2010d4f58515d569fae672b8817e112268b205fdbfc85449b642f9186/md4cf-0.0.3-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "faf87432fbf464c39e15515678f24bd1", "sha256": "ba261ff75dd560b150861b4d15fdbe88d173465f76c0b1fa7bf04bdc21c222c1" }, "downloads": -1, "filename": "md4cf-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "faf87432fbf464c39e15515678f24bd1", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 7420, "upload_time": "2019-05-03T12:52:41", "url": "https://files.pythonhosted.org/packages/e4/0f/a5d2010d4f58515d569fae672b8817e112268b205fdbfc85449b642f9186/md4cf-0.0.3-py3-none-any.whl" } ] }