{ "info": { "author": "Eric Shapiro", "author_email": "eshapiro42@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": "# mdoc\n### Modular documents\n\nWith mdoc you can create recursive, modular documents. It has four main features:\n\n1. Include entire files in other documents.\n2. Include snippets of files in other documents.\n3. Use externally defined variables throughout your documents.\n4. Evaluate Python expressions inside your documents.\n\nThat's the 'modular' part. The 'recursive' part means that the included documents can themselves include other documents, ad infinitum.\n\nFor example, this readme was generated from the various pieces sitting in the ```readme``` directory.\n\n## mdoc tags\n\nmdoc accomplishes all of this by parsing your input files for mdoc tags. These tags look like:\n\n1. ```{mdoc include file.ext}```, to include the file ```file.ext```\n2. ```{mdoc snippet eq1 from file.ext}```, to include the snippet called ```eq1``` from the file ```file.ext```\n3. ```{mdoc var1}```, to insert the variable called ```var1```\n4. ```{mdoc eval expression}```, to evaluate the Python expression ```expression```\n\nYou might be wondering how, if this readme is generated using mdoc, I was able to type {mdoc ...} above without it being parsed. This is thanks to the ```static``` option, which prevents included files from being parsed and includes them verbatim:\n\n1. ```{mdoc include file.ext static}``` includes ```file.ext``` but does not parse it for mdoc tags\n2. ```{mdoc include snippet eq1 from file.ext static}``` includes snippet ```eq1``` from ```file.ext``` but does not parse it for mdoc tags\n\nThere is no static option for variables or evals, since that wouldn't make any sense.\n\nSnippets are defined as follows:\n\n```\n# Inside file.ext\n{mdoc snip snippet_name}\n...\nsnippet contents\n...\n{mdoc unsnip snippet_name}\n```\n\nYou can then reference the snippet name and the file it lives in to include it in another document:\n\n```\n# Inside main file\n{mdoc snippet snippet_name from file.ext}\n```\n\nThis is very handy for including snippets of code that may change over time, as well as other fluctuating content.\n\nOf course, the words ```include```, ```snippet```, ```snip```, ```unsnip``` and ```eval``` are reserved and cannot be used as mdoc variables names.\n\n\n## usage\n\nUsing mdoc is simple, once you've installed it. Simply navigate into the folder where your main document template lives and run:\n\n```\nmdoc --input INPUT_DOCUMENT --output OUTPUT_DOCUMENT --variables VARIABLES_JSON\n```\n\nThis will parse ```INPUT_DOCUMENT```, insert any variables defined in ```VARIABLES_JSON```, and spit out ```OUTPUT_DOCUMENT```.\n\nIf you do not wish to generate an output file and simply want to see what the output would look like, you can replace the ```--output OUTPUT_DOCUMENT``` with ```--dryrun```.\n\nIf you've lost track of all the variables needed throughout your documents, you can use ```--showvariables``` rather than ```--output``` or ```--dryrun``` and it will spit out a JSON-formatted list of all the variables you need. You can pipe this into a file to make things really easy!\n\n```\nmdoc --input INPUT_DOCUMENT --showvariables > VARIABLES_JSON\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/eshapiro42/mdoc", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "mdoc", "package_url": "https://pypi.org/project/mdoc/", "platform": "", "project_url": "https://pypi.org/project/mdoc/", "project_urls": { "Homepage": "https://github.com/eshapiro42/mdoc" }, "release_url": "https://pypi.org/project/mdoc/0.0.9/", "requires_dist": [ "pathlib" ], "requires_python": "", "summary": "Modular documents", "version": "0.0.9" }, "last_serial": 4089676, "releases": { "0.0.8": [ { "comment_text": "", "digests": { "md5": "5b3caea2f7a7c2c4dd234950274d9976", "sha256": "57b044b7d96743c04731869ded27691a684f9f9d9834f16f72aab53567186a72" }, "downloads": -1, "filename": "mdoc-0.0.8-py2-none-any.whl", "has_sig": false, "md5_digest": "5b3caea2f7a7c2c4dd234950274d9976", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 4745, "upload_time": "2018-07-20T18:50:39", "url": "https://files.pythonhosted.org/packages/e6/e2/c9ba75c04a039e2257b6f3e2fe64879289aea2aa6cb962e861ed455fa5e8/mdoc-0.0.8-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d6475a7a04dec3b526230c6efe4b30f3", "sha256": "881da665a887627d65b032fc1aa1176169a929b3bee8cf41c17a753cacd4b446" }, "downloads": -1, "filename": "mdoc-0.0.8.tar.gz", "has_sig": false, "md5_digest": "d6475a7a04dec3b526230c6efe4b30f3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4479, "upload_time": "2018-07-20T18:50:41", "url": "https://files.pythonhosted.org/packages/fc/23/ef25ba146cf91a17a6e312621c3a41458948b48814ff3176bc8d1dc73772/mdoc-0.0.8.tar.gz" } ], "0.0.9": [ { "comment_text": "", "digests": { "md5": "5b9889c68d44e9fd2f21302b20963429", "sha256": "e2f179ccc83307a7bccac4b92738ee0a248f0fa23278306671bf021d7d9df1d2" }, "downloads": -1, "filename": "mdoc-0.0.9-py2-none-any.whl", "has_sig": false, "md5_digest": "5b9889c68d44e9fd2f21302b20963429", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 5179, "upload_time": "2018-07-22T04:23:34", "url": "https://files.pythonhosted.org/packages/f2/a8/77b500d1cbad8060880528015d9860c93d536d25d4f26470c7b94beebdd9/mdoc-0.0.9-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8bacece6d199661c26b7465f128d20fb", "sha256": "994819f231940867c25da7552022d332e2fd2dac7fbd6c92aa714146fe2eb090" }, "downloads": -1, "filename": "mdoc-0.0.9.tar.gz", "has_sig": false, "md5_digest": "8bacece6d199661c26b7465f128d20fb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5042, "upload_time": "2018-07-22T04:23:35", "url": "https://files.pythonhosted.org/packages/a3/91/3c3c83e179b037c4f74731ebebfcc210c95fdc2e1f8fe19fbcae81830344/mdoc-0.0.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5b9889c68d44e9fd2f21302b20963429", "sha256": "e2f179ccc83307a7bccac4b92738ee0a248f0fa23278306671bf021d7d9df1d2" }, "downloads": -1, "filename": "mdoc-0.0.9-py2-none-any.whl", "has_sig": false, "md5_digest": "5b9889c68d44e9fd2f21302b20963429", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 5179, "upload_time": "2018-07-22T04:23:34", "url": "https://files.pythonhosted.org/packages/f2/a8/77b500d1cbad8060880528015d9860c93d536d25d4f26470c7b94beebdd9/mdoc-0.0.9-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8bacece6d199661c26b7465f128d20fb", "sha256": "994819f231940867c25da7552022d332e2fd2dac7fbd6c92aa714146fe2eb090" }, "downloads": -1, "filename": "mdoc-0.0.9.tar.gz", "has_sig": false, "md5_digest": "8bacece6d199661c26b7465f128d20fb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5042, "upload_time": "2018-07-22T04:23:35", "url": "https://files.pythonhosted.org/packages/a3/91/3c3c83e179b037c4f74731ebebfcc210c95fdc2e1f8fe19fbcae81830344/mdoc-0.0.9.tar.gz" } ] }