{ "info": { "author": "Michael Stepner", "author_email": "stepner@mit.edu", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: End Users/Desktop", "License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Build Tools", "Topic :: Text Processing :: Filters" ], "description": ":Date: May 11, 2019\n\n.. contents::\n :depth: 3\n..\n\npandoc-mustache: Variable Substitution in Pandoc\n================================================\n\n|Development Status| |PyPI version| |Python version| |Build Status|\n\nThe **pandoc-mustache** filter allows you to put variables into your\npandoc document text, with their values stored in a separate file. When\nyou run ``pandoc`` the variables are replaced with their values.\n\n*Technical note:* This pandoc filter is not a complete implementation of\nthe `Mustache template spec `__. Only\nvariable replacement is supported: other `tag\ntypes `__ are not\ncurrently supported.\n\nExample\n-------\n\nThis document, in ``document.md``:\n\n::\n\n ---\n mustache: ./le_gaps.yaml\n ---\n The richest American men live {{diff_le_richpoor_men}} years longer than the poorest men,\n while the richest American women live {{diff_le_richpoor_women}} years longer than the poorest women.\n\nCombined with these variable definitions, in ``le_gaps.yaml``:\n\n.. code:: yaml\n\n diff_le_richpoor_men: \"14.6\"\n diff_le_richpoor_women: \"10.1\"\n\nWill be converted by ``pandoc document.md --filter pandoc-mustache`` to:\n\n The richest American men live 14.6 years longer than the poorest men,\n while the richest American women live 10.1 years longer than the\n poorest women.\n\nInstallation\n------------\n\nInstall by opening a terminal and running:\n\n::\n\n pip install -U pandoc-mustache\n\nPython 2.7, 3.4+, pypy, and pypy3 are supported.\n\nUsage\n-----\n\n#. Within a pandoc document, variables are referenced by enclosing the\n variable name in double \u201cmustaches\u201d, i.e.\u00a0curly brackets, like\n ``{{this}}``.\n\n#. The variables are defined in one or more separate files, using YAML\n formatted key-value pairs. For example:\n\n .. code:: yaml\n\n place: Montreal\n temperature: '7'\n\n#. The pandoc document containing the mustache variables points to the\n YAML file (or files) which contain the variable definitions. These\n files are indicated using the mustache field in a `YAML metadata\n block `__, typically\n placed at the top of the pandoc document. Absolute paths and relative\n paths are supported: relative paths are evaluated relative to the\n working directory where ``pandoc`` is being run.\n\n An example:\n\n .. code:: yaml\n\n ---\n title: My Report\n author: Jane Smith\n mustache: ./vars.yaml\n ---\n The temperature in {{place}} was {{temperature}} degrees.\n\n Or, with more than one file:\n\n .. code:: yaml\n\n ---\n title: My Report\n author: Jane Smith\n mustache:\n - ./vars.yaml\n - ./additional_vars.yaml\n ---\n The temperature in {{place}} was {{temperature}} degrees.\n The humidity was {{humidity}}%.\n\n#. Run pandoc and replace all variables in the document with their\n values by adding ``--filter pandoc-mustache`` to the pandoc command.\n\nTips and Tricks\n~~~~~~~~~~~~~~~\n\n- When defining variables in YAML, there is no need to enclose strings\n in quotes. But you should enclose numbers in quotes if you want them\n to appear in the document using the exact same formatting. Some\n examples:\n\n .. code:: yaml\n\n unquoted_string: Montreal # becomes: Montreal\n quoted_string: 'Montreal' # becomes: Montreal\n trailingzero_num: 7.40 # becomes: 7.4\n trailingzero_string: '7.40' # becomes: 7.40\n\n- If you\u2019re writing a document that reports computed numerical results,\n you can program your code (in R, Python, Stata, etc.) to write those\n numbers to a YAML file automatically each time they are generated. By\n referencing your numerical results using variables instead of\n hard-coding them into the text, the document can be updated instantly\n if the results change. And you can be certain that all the numbers in\n the output document reflect the latest results of your analysis.\n\nContributing\n------------\n\n|Project Status: Inactive \u2013 The project has reached a stable, usable\nstate but is no longer being actively developed; support/maintenance\nwill be provided as time allows.|\n\nThis code is not being actively developed. It was created to fulfill my\npandoc writing needs, and the current feature set is adequate for me.\n\nIf you have a **bug report**, you can create an issue or file a pull\nrequest. I\u2019ll look into it, time permitting.\n\nIf you have a **feature request**, it is unlikely that I will be able to\nimplement it for you. You can create an issue to generate discussion. If\nyou implement a feature, you can file pull request and I will review it\neventually, as time permits. If you\u2019re interested in making major\nadditions to the code, I\u2019d be happy to welcome a new maintainer to the\nproject.\n\nLicense\n-------\n\nAll of the files in this repository are released to the public domain\nunder a `CC0\nlicense `__ to\npermit the widest possible reuse.\n\nAcknowledgements\n----------------\n\nThis pandoc filter was created using Sergio Correia\u2019s\n`panflute `__ package. The\n`panflute `__ repository also\nserved as an inspiration for the organization of this repository.\n\nRelated Filters\n~~~~~~~~~~~~~~~\n\nScott Koga-Browes\u2019\n`pandoc-abbreviations `__\nfilter also performs variable replacement in pandoc documents, using a\ndifferent syntax.\n\n.. |Development Status| image:: https://img.shields.io/pypi/status/pandoc-mustache.svg\n :target: https://pypi.python.org/pypi/pandoc-mustache/\n.. |PyPI version| image:: https://img.shields.io/pypi/v/pandoc-mustache.svg\n :target: https://pypi.python.org/pypi/pandoc-mustache/\n.. |Python version| image:: https://img.shields.io/pypi/pyversions/pandoc-mustache.svg\n :target: https://pypi.python.org/pypi/pandoc-mustache/\n.. |Build Status| image:: https://travis-ci.org/michaelstepner/pandoc-mustache.svg?branch=master\n :target: https://travis-ci.org/michaelstepner/pandoc-mustache\n.. |Project Status: Inactive \u2013 The project has reached a stable, usable state but is no longer being actively developed; support/maintenance will be provided as time allows.| image:: http://www.repostatus.org/badges/latest/inactive.svg\n :target: http://www.repostatus.org/#inactive\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/michaelstepner/pandoc-mustache/", "keywords": "pandoc pandocfilters panflute markdown latex mustache", "license": "CC0-1.0", "maintainer": "", "maintainer_email": "", "name": "pandoc-mustache", "package_url": "https://pypi.org/project/pandoc-mustache/", "platform": "", "project_url": "https://pypi.org/project/pandoc-mustache/", "project_urls": { "Homepage": "https://github.com/michaelstepner/pandoc-mustache/" }, "release_url": "https://pypi.org/project/pandoc-mustache/0.1.0/", "requires_dist": [ "panflute", "pystache", "pyyaml", "future", "docutils ; extra == 'pypi'" ], "requires_python": "", "summary": "Pandoc filter for variable substitution using Mustache syntax", "version": "0.1.0" }, "last_serial": 5254629, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "6279414fb9b467c69188bfbd246d2b03", "sha256": "26cb281327736a1586830da42ee083e37bd87308e3ac3b3f7d68d1ba53be119d" }, "downloads": -1, "filename": "pandoc_mustache-0.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "6279414fb9b467c69188bfbd246d2b03", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7643, "upload_time": "2017-12-26T20:57:31", "url": "https://files.pythonhosted.org/packages/e7/13/cb35cfa64087aaec0a70ce787f284b6cd364fb8e66c7b963905b3fd4fb4d/pandoc_mustache-0.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0dbf750eff1953727951f9f051971364", "sha256": "5b65178222e99b1f187ac23713678b6127c407c18ee7eda1ceab624a61b27ee8" }, "downloads": -1, "filename": "pandoc-mustache-0.0.1.tar.gz", "has_sig": false, "md5_digest": "0dbf750eff1953727951f9f051971364", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6387, "upload_time": "2017-12-26T20:57:32", "url": "https://files.pythonhosted.org/packages/d9/9a/4baf48989b16ad338a5add29c1b24f64d28ca823311a27957b8c0d03eea1/pandoc-mustache-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "ba10f62b2d75b26479fed87822c1de60", "sha256": "7402c5e81e935bc7492003e16081601ee5d99893d803e6739267e0733807d92b" }, "downloads": -1, "filename": "pandoc_mustache-0.0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ba10f62b2d75b26479fed87822c1de60", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9029, "upload_time": "2017-12-27T02:06:44", "url": "https://files.pythonhosted.org/packages/2d/3a/b78d0086e081a75ccdcf8b8b5cf9cf23d513c05370d1f7af1060c367d8ed/pandoc_mustache-0.0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f8c971b7c7cd6bd42cd97d3f1f0184d9", "sha256": "4b27132a74988d00230aadd03dac5e119d195b1ac71601af6f73f5c2b80c756a" }, "downloads": -1, "filename": "pandoc-mustache-0.0.2.tar.gz", "has_sig": false, "md5_digest": "f8c971b7c7cd6bd42cd97d3f1f0184d9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7231, "upload_time": "2017-12-27T02:06:45", "url": "https://files.pythonhosted.org/packages/c7/9a/9bb7e0898ec7e8c6a9645fe8da04d1ba7063c34c03b4dc142913d8500a10/pandoc-mustache-0.0.2.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "46933f161953dcba93abbb7072e59d13", "sha256": "ce63e12a424bbb303457b5e9353cd901d8911eba2e01cd1aeb026047ed568b6d" }, "downloads": -1, "filename": "pandoc_mustache-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "46933f161953dcba93abbb7072e59d13", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8396, "upload_time": "2019-05-11T00:09:07", "url": "https://files.pythonhosted.org/packages/06/ba/e5c68652ac75be3f5e090c5b0a15e7d360fdb2cd09fd39436e2e3142a55f/pandoc_mustache-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8b7534ae05c2c87eb4b90a22dde6615e", "sha256": "c468d1c21676cf1f9824045a078fe5d4e8456aecbf2cca2c223310aa81a7c6b3" }, "downloads": -1, "filename": "pandoc-mustache-0.1.0.tar.gz", "has_sig": false, "md5_digest": "8b7534ae05c2c87eb4b90a22dde6615e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7174, "upload_time": "2019-05-11T00:09:08", "url": "https://files.pythonhosted.org/packages/29/5b/6745ae8e84050e03618b0080d6654ffd8c91cb241e54116ce389eb44f91d/pandoc-mustache-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "46933f161953dcba93abbb7072e59d13", "sha256": "ce63e12a424bbb303457b5e9353cd901d8911eba2e01cd1aeb026047ed568b6d" }, "downloads": -1, "filename": "pandoc_mustache-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "46933f161953dcba93abbb7072e59d13", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8396, "upload_time": "2019-05-11T00:09:07", "url": "https://files.pythonhosted.org/packages/06/ba/e5c68652ac75be3f5e090c5b0a15e7d360fdb2cd09fd39436e2e3142a55f/pandoc_mustache-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8b7534ae05c2c87eb4b90a22dde6615e", "sha256": "c468d1c21676cf1f9824045a078fe5d4e8456aecbf2cca2c223310aa81a7c6b3" }, "downloads": -1, "filename": "pandoc-mustache-0.1.0.tar.gz", "has_sig": false, "md5_digest": "8b7534ae05c2c87eb4b90a22dde6615e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7174, "upload_time": "2019-05-11T00:09:08", "url": "https://files.pythonhosted.org/packages/29/5b/6745ae8e84050e03618b0080d6654ffd8c91cb241e54116ce389eb44f91d/pandoc-mustache-0.1.0.tar.gz" } ] }