{ "info": { "author": "Summer Ruan", "author_email": "marchtea213@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "==========================\nMarkdown to Github Html\n==========================\n\nMotivation\n===============\n\nBasically, You may want to convert md files into Html looks exactly like github does.\n\nMaybe you would try `pandoc`_, but html it generates looks **not** very well.\n\nSo, I start writing this small tool, inspired by `grip`_\n\nFeatures\n=================\n\nmdtogh can **convert** your md files into html files like github does with features belows:\n\n- toc support\n- custom toc(use one file to be toc)\n- index.html for your book\n- next/prev files link\n- file regexp to select your md files\n- fix relative link(ie. `` => ``)\n- custom template\n- offline renderer\n- proxy support(respect https_proxy environment variable)\n- cache support\n\ndemo\n=================\n\nI've generate a book written by julycoding: `The-Art-Of-Programming-By-July`_.\n\nDemo link: `taop.marchtea.com`_\n\nYou can check on that.\n\n\nInstallation\n==============\n\nFrom `pypi`_\n\n.. code-block:: bash\n\n $ pip install mdtogh \n\nAlso, you can clone repo & install with setup.py.\n\n.. code-block:: bash\n\n\t$ git clone https://github.com/marchtea/md_to_github_html.git\n\t$ cd md_to_github_html\n\t$ python setup.py install\n\n**Maybe you will need add sudo**\n\nUsage\n==================\n\nGenerate one or more files\n\n.. code-block:: bash\n\n $ cd mdfiles\n\t$ mdtogh 01.md 02.md 03.md\n\t\nGenerate all md files in current directory\n\n.. code-block:: bash\n\n $ cd mdfiles\n $ mdtogh\n \nGenerate md files in other directory\n\n.. code-block:: bash\n\n\t$ mdtogh ../mdfiles\n\nGenerate files with file reg support\n\n.. code-block:: bash\n\n\t$ cd mdfiles\n\t$ mdtogh --file_reg='^\\d.+\\.md'\n\nGenerate files with toc & toc_depth support\n\n.. code-block:: bash\n\n\t$ cd mdfiles\n\t$ mdtogh --toc --toc_depth=2 --file_reg='^\\d.+\\.md'\n\nGenerate files with additional book info\n\n.. code-block:: bash\n\n\t$ cd mdfiles\n\t$ mdtogh --toc --book='book.json'\n\t\nThe format of book.json is given below.\n\nGenerate files with custom template\n\n.. code-block:: bash\n\n\t$ cd mdfiles\n\t$ mdtogh --templates=path_to_templates 01.md\n\t\nThe rules for templates is given below.\n\nGenerate files with custom toc file\n\n.. code-block:: bash\n\n\t$ cd mdfiles\n\t$ mdtogh --toc --toc_file=Readme.md --file_reg='^\\d.+\\.md'\n\nOffline rendering:\n\n.. code-block:: bash\n\n\t$ cd mdfiles\n\t$ mdtogh --offline 01.0.md\n\n**Recommanded** options to generate book\n\n.. code-block:: bash\n\n\t$ mdtogh --css --toc --book='book.json' --file_reg='your reg exp'\n\n**Recommanded** options to generate several files\n\n.. code-block:: bash\n\n\t$ mdtogh 01.md 02.md\n\nFor more options\n\n.. code-block:: bash\n\n\tmdtogh -h\n\t\nSomething You May Notice\n=================================\n\nAs to generate files exactly like github does, the easiest way is to use\n`api`_ if offers. But it has its own `limits`_.\n\n- 60 for anonymous requests an hour\n- 5000 for requests using Basic Authentication an hour\n\nSo, you may using --user & --pass options\n\n.. code-block:: bash\n\n\t$ mdtogh --user='your_github_username' --pass='your login password'\n\t\nYour info are sended through https which is safe. mdtogh will not save any of it.\n\n\nbook.json\n========================\n\n.. code-block:: javascript \n\n {\n \"title\": \"Demo book\",\n \"description\": \"This is a book.\",\n \"coverimage\": \"demo.jpg\"\n }\n\nCustom Templates Support\n========================\n\nmdtogh now support custom templates. You can use --templates to specific where to locate templates. You should give at least three files belows:\n\n- content.html\n- toc.html\n- index.html\n\nmdtogh use `jinja2`_ as template engine.\n\nFor tutorial of template writing, please check `jinja doc`_\n\n- content.html\n\ncontent.html is used for generate standalone html file with things like head, body **after** content of md file is rendered by github or offline renderer.\n\nmdtogh will pass several parameters to content.html which you can use:\n\n- filetitle \t*#booktitle in book.json`*\n- content *#contents after render by `github` or `offline renderer`*\n- toc *#not support yet*\n- needtoc\t\t *#whether toc is needed*\n- prevfile *#link to prevfile. only used when `--toc` is set*\n- nextfile *#link to nextfile. only used when `--toc`is set*\n\n\ntoc.html\n\ntoc.html is used for generate table of content which will be used later in index.html. So, you don't need add html or body tag.\n\n\nParameters passed to toc.html.\n\n- tocs \n- toc_depth\n\ntocs\n\ntocs is a list of headers. It's set like \n\n.. code-block:: javascript \n\n [\n ['h1', 'top header', 'headerlink'],\n ['h2', 'sub header', 'header link'],\n ....\n ]\n\ntoc_depth\n\ntoc_depth is set by user. It refers the maxium depth of header. It's an integer value. ie.\n\n.. code-block:: javascript \n\n\t2\n\nindex.html\n\nindex.html is used for generate index.html for book. \n\nParameters passed to toc.html:\n\n- booktitle *#title in book.json*\n- coverimage *#coverimage in book.json*\n- description *#description in book.json*\n- toc *#toc rendered with toc.html*\n- custom_toc *#whether use custom_toc. custom_toc is rendered like normal md file*\n\nTODO\n===================\nmdtogh is still on developing.\n\nFeatures are developing or will be add later.\n\n- support recursive options.\n- add toc in content.html\n\nContibuting\n===============\n\nAny **help** will be **appreciated**.\n\n- open issues if you find any questions\n- complete one in TODO list\n- add features you like\n- feel free to open pull request\n\nLinks\n=====================\n\n- `Github repo`_\n- `grip`_\n- `github markdown api`_\n\nChange Log\n=====================\n\n- 2014/4/30 0.0.9 add option: --timeout. set timeout for requests. add cache support. now it will skip file which is not changed.\n- 2014/3/12 0.0.8 add option: --offline. offline rendering is supported.\n- 2014/3/11 0.0.7 add option: --toc_file. user can specific one file as toc. relative link will be resolved automatically.\n- 2014/3/6 0.0.6 add option: --encoding for offline renderer, fix relative link, add support for custom template\n- 2014/3/5 0.0.5 add MANIFEST.in, fix pacakge wrapped by setup.py. Fix css link not include while rendering after first downloading css files\n- 2014/3/4 0.0.3 fix error leads by unicode filename\n- 2014/3/3 0.0.2 add --toc_depth support, fix get_html_name bug\n- 2014/3/1 0.0.1 first release\n\nThanks\n==========\n\nSpecial thanks to `grip`_. Without its excellent work, this tool can't be done.\n\n.. _limits: http://developer.github.com/v3/#rate-limiting\n.. _api: http://developer.github.com/v3/markdown/\n.. _github markdown api: http://developer.github.com/v3/markdown/\n.. _pypi: https://pypi.python.org/pypi\n.. _grip: https://github.com/joeyespo/grip\n.. _pandoc: http://johnmacfarlane.net/pandoc/index.html\n.. _The-Art-Of-Programming-By-July: https://github.com/julycoding/The-Art-Of-Programming-By-July\n.. _taop.marchtea.com: http://taop.marchtea.com\n.. _Github repo: http://github.com/marchtea/mdtogh\n.. _jinja2: https://github.com/mitsuhiko/jinja2 \n.. _jinja doc: http://jinja.pocoo.org/docs/", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/marchtea/mdtogh", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "mdtogh", "package_url": "https://pypi.org/project/mdtogh/", "platform": "any", "project_url": "https://pypi.org/project/mdtogh/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/marchtea/mdtogh" }, "release_url": "https://pypi.org/project/mdtogh/0.0.9/", "requires_dist": null, "requires_python": null, "summary": "Transform markdown files into html with styles of github", "version": "0.0.9" }, "last_serial": 1077430, "releases": { "0.0.1": [ { "comment_text": "built for Darwin-13.0.0", "digests": { "md5": "8f8905919111f172736aa28c91265df2", "sha256": "dfd60a9812496785547426f638bbeaf581cbcc98eacb5abf646fbe4c2bee37ba" }, "downloads": -1, "filename": "mdtogh-0.0.1.macosx-10.9-intel.tar.gz", "has_sig": false, "md5_digest": "8f8905919111f172736aa28c91265df2", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 16674, "upload_time": "2014-03-02T04:46:16", "url": "https://files.pythonhosted.org/packages/4b/86/c0bc6f3522ec9c47515f1a481ed310d15b5cf6d95619d65f846ffa397dcb/mdtogh-0.0.1.macosx-10.9-intel.tar.gz" }, { "comment_text": "", "digests": { "md5": "764ae1ecbfb101192fc3fa694f728be6", "sha256": "636ed9908c9f1ffec4b28fc529005e7ddc7299e2d6739d745c6bebf82281bf9d" }, "downloads": -1, "filename": "mdtogh-0.0.1.tar.gz", "has_sig": false, "md5_digest": "764ae1ecbfb101192fc3fa694f728be6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8250, "upload_time": "2014-03-02T04:46:11", "url": "https://files.pythonhosted.org/packages/0d/d5/a33ad27eb38ad1dd30330dcc6dd043d66cecca4ba6be656232ef5b71d8ce/mdtogh-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "8d45d4c31d1f43769a5f8230eca359cc", "sha256": "c1679ec69cbd3fa43a38306458164912f78d1f18b2106cc44c9636a456641cb4" }, "downloads": -1, "filename": "mdtogh-0.0.2.tar.gz", "has_sig": false, "md5_digest": "8d45d4c31d1f43769a5f8230eca359cc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8762, "upload_time": "2014-03-03T14:29:35", "url": "https://files.pythonhosted.org/packages/cd/7a/4ac654454570348360a0d411a9b2f9fd3791d08a248bb7bdb68160b03809/mdtogh-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "2e6f914d73773cd282c20edb576569d8", "sha256": "eddefdcd56a48d5cf3dc75eacd53e509f40398fb260416491e35adba9104002d" }, "downloads": -1, "filename": "mdtogh-0.0.3.tar.gz", "has_sig": false, "md5_digest": "2e6f914d73773cd282c20edb576569d8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8461, "upload_time": "2014-03-04T06:39:04", "url": "https://files.pythonhosted.org/packages/24/17/a697beb02390b447df10326e3d1e951c0802c43ef13ffb7cebcfd0f707ab/mdtogh-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "4bd04307eff9637ef18952a1854bfca3", "sha256": "e29bf93a582a4a75b2cebb4943600a1a1f3cce145c5f861e08dbb09f01b7c566" }, "downloads": -1, "filename": "mdtogh-0.0.4.tar.gz", "has_sig": false, "md5_digest": "4bd04307eff9637ef18952a1854bfca3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10137, "upload_time": "2014-03-05T16:23:52", "url": "https://files.pythonhosted.org/packages/62/0d/b4b99d607b6c638c5f2e6c29509fd18215abd7772f5122b1d1c1f5a34da2/mdtogh-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "00ff08d85a6d57a5af073773679c7f1e", "sha256": "7de7c98ea1696a6a4f8d984d84702887fe366f9a1ab73f7de761d559331df31c" }, "downloads": -1, "filename": "mdtogh-0.0.5.tar.gz", "has_sig": false, "md5_digest": "00ff08d85a6d57a5af073773679c7f1e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12564, "upload_time": "2014-03-06T02:32:46", "url": "https://files.pythonhosted.org/packages/d2/dd/0a0c875b055f85dbf5b6fffc5780968a5f0305918bc370afe394482d6acf/mdtogh-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "755d57ee27bd4c43d1b989d11cd557b6", "sha256": "5a7b0d4a8a648ed8075e8ed5e3b6ad7bf8a208d5281bc36deae5e91ecde66afc" }, "downloads": -1, "filename": "mdtogh-0.0.6.tar.gz", "has_sig": false, "md5_digest": "755d57ee27bd4c43d1b989d11cd557b6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15184, "upload_time": "2014-03-11T09:06:23", "url": "https://files.pythonhosted.org/packages/4f/76/6557d40f5b4e8d105d717599ce839272ebe5ec36d824c4269dce5741a45a/mdtogh-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "31474fd9812032279a5da1b4d655e1f8", "sha256": "c6ee842c27a24e3281da760638d023949ef6b28f0131f83f97498458e31d0aad" }, "downloads": -1, "filename": "mdtogh-0.0.7.tar.gz", "has_sig": false, "md5_digest": "31474fd9812032279a5da1b4d655e1f8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15620, "upload_time": "2014-03-11T15:48:59", "url": "https://files.pythonhosted.org/packages/e0/f6/66f0a3908b0e8735bb230bc7148348c5bcedd716fc805d6efcc1e3de7b57/mdtogh-0.0.7.tar.gz" } ], "0.0.8": [ { "comment_text": "", "digests": { "md5": "d025dd4a3f33c82fe7d6fa94a9a23937", "sha256": "f3c66ea424bca97bbdcd471f452532ecbd990b91048d4f2e29c833452919ab5d" }, "downloads": -1, "filename": "mdtogh-0.0.8.tar.gz", "has_sig": false, "md5_digest": "d025dd4a3f33c82fe7d6fa94a9a23937", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15713, "upload_time": "2014-03-12T12:27:47", "url": "https://files.pythonhosted.org/packages/d4/5b/bf2e9e502e1cf8832aa79afa5c53d40e58377d746f9db0812032ab720381/mdtogh-0.0.8.tar.gz" } ], "0.0.9": [ { "comment_text": "", "digests": { "md5": "2595fd697b609091a5181ddaf28ec6d2", "sha256": "dc3757676ee6303a6e26b198e1c8d230200c5e0e320b913044bd4fc1ff9c4282" }, "downloads": -1, "filename": "mdtogh-0.0.9.tar.gz", "has_sig": false, "md5_digest": "2595fd697b609091a5181ddaf28ec6d2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16328, "upload_time": "2014-05-01T05:15:28", "url": "https://files.pythonhosted.org/packages/56/d2/359bf1e1194f8bf69896d7f6577fc87924ed77410a2cd0565903b27afceb/mdtogh-0.0.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2595fd697b609091a5181ddaf28ec6d2", "sha256": "dc3757676ee6303a6e26b198e1c8d230200c5e0e320b913044bd4fc1ff9c4282" }, "downloads": -1, "filename": "mdtogh-0.0.9.tar.gz", "has_sig": false, "md5_digest": "2595fd697b609091a5181ddaf28ec6d2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16328, "upload_time": "2014-05-01T05:15:28", "url": "https://files.pythonhosted.org/packages/56/d2/359bf1e1194f8bf69896d7f6577fc87924ed77410a2cd0565903b27afceb/mdtogh-0.0.9.tar.gz" } ] }