{
"info": {
"author": "Daniil Minukhin",
"author_email": "ddddsa@gmail.com",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Topic :: Documentation",
"Topic :: Utilities"
],
"description": "\n\n# TemplateParser preprocessor for Foliant\n\nPreprocessor which allows to use templates in Foliant source files. Preprocessor now supports only [Jinja2](http://jinja.pocoo.org/) templating engine, but more can be added easily.\n\n## Installation\n\n```bash\n$ pip install foliantcontrib.templateparser\n```\n\n## Config\n\nAll params that are stated in foliant.yml are considered global params. All of them may be overriden in template tag options, which have higher priority.\n\n```yaml\npreprocessors:\n - templateparser:\n engine: jinja2\n engine_params:\n root: '/usr/src/app'\n context:\n param1: 1008\n param2: 'Kittens'\n ext_context: context.yml\n param3: 'Puppies'\n```\n\n`engine`\n: name of the template engine which will be used to process template. Supported engines right now: `jinja2`.\n\n`engine_params`\n: dictionary with parameters which will be transfered to the template engine.\n\n`context`\n: dictionary with variables which will be redirected to the template.\n\n`ext_context`\n: path to YAML- or JSON-file with context dictionary. (relative to current md-file)\n\n_All parameters with other names are also transfered to the template, as if they appeared inside the `context` dictionary. (`param3` in the above example)_\n\n> Please note that even if this may seem convenient, it is preferred to include template variables in the `context` dictionary, as in future more reserved parameters may be added which may conflict with your stray variables.\n\nIf some variable names overlap among these methods to supply context, preprocessor uses this priority order:\n\n1. Context dictionary.\n2. Stray variables.\n3. External context file.\n\n## Usage\n\nTo use the template in a Markdown file just insert a tag of the template engine name, for example:\n\n```html\nThis is ordinary markdown text.\n\nThis is a Jinja2 template:\nI can count to five!\n{% for i in range(5) %}{{ i + 1 }}{% endfor %}\n\n```\n\nAfter making a document with Foliant this will be transformed to:\n\n```\nThis is ordinary markdown text.\n\nThis is a Jinja2 template:\nI can count to five!\n12345\n```\n\nYou can also use a general `` tag, but in this case you have to specify the engine you want to use in the `engine` parameter:\n\n```html\nThis is ordinary markdown text.\n\nThis is a Jinja2 template:\nI can count to five!\n{% for i in range(5) %}{{ i + 1 }}{% endfor %}\n\n```\n\n### Sending variables to template\n\nTo send a variable to template, add them into the `context` option. This option accepts `yaml` dictionary format.\n\n> Please note that foliant doesn't support multiline tag options yet, so use one-line dictionary format {'key1': value1, ...}\n\n```html\n\nHi, my name is {{name}}!\nI am {{age}} years old.\n{% for prev in range(age - 1, 0, -1) %}\nThe year before I was {{prev}} years old.\n{% endfor %}\n\n```\n\nResult:\n\n```\nHi, my name is Andy!\nI am 8 years old.\n\nThe year before I was 7 years old.\n\nThe year before I was 6 years old.\n\nThe year before I was 5 years old.\n\nThe year before I was 4 years old.\n\nThe year before I was 3 years old.\n\nThe year before I was 2 years old.\n\nThe year before I was 1 years old.\n```\n\n### Extends and includes\n\nExtends and includes work in templates. The path of the extending\\included file is relative to the Markdown file where the template lives.\n\nIn Jinja2 engine you can override the path of the included\\extended files with `root` engine_param. **Note that this param is relative to project root.**\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/foliant-docs/foliantcontrib.templateparser",
"keywords": "",
"license": "MIT",
"maintainer": "",
"maintainer_email": "",
"name": "foliantcontrib.templateparser",
"package_url": "https://pypi.org/project/foliantcontrib.templateparser/",
"platform": "any",
"project_url": "https://pypi.org/project/foliantcontrib.templateparser/",
"project_urls": {
"Homepage": "https://github.com/foliant-docs/foliantcontrib.templateparser"
},
"release_url": "https://pypi.org/project/foliantcontrib.templateparser/1.0.2/",
"requires_dist": [
"foliant (>=1.0.8)",
"foliantcontrib.utils.combined-options (>=1.0.4)",
"foliantcontrib.utils.preprocessor-ext (>=1.0.0)",
"jinja2"
],
"requires_python": "",
"summary": "Template parser preprocessor for Foliant.",
"version": "1.0.2"
},
"last_serial": 5790252,
"releases": {
"1.0.0": [
{
"comment_text": "",
"digests": {
"md5": "63db1875217af20e6843ede8057dc928",
"sha256": "c446c219b9b96e50c23cc8097e4929435150e7db3ee72862782d0a1e6e4f3576"
},
"downloads": -1,
"filename": "foliantcontrib.templateparser-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "63db1875217af20e6843ede8057dc928",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 7198,
"upload_time": "2019-05-15T07:05:18",
"url": "https://files.pythonhosted.org/packages/63/a2/9777ddcfdc373ad96d0529232ff2abd65900883dd3b2e259a7f4d7fe8b26/foliantcontrib.templateparser-1.0.0-py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "d1ac3c9849324610b8dfa537410aca1b",
"sha256": "775a9657e1080a84be4e40654e2e27ef954509596017840ab220d1a6da04f928"
},
"downloads": -1,
"filename": "foliantcontrib.templateparser-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "d1ac3c9849324610b8dfa537410aca1b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5097,
"upload_time": "2019-05-15T07:05:20",
"url": "https://files.pythonhosted.org/packages/dd/12/4627458c21bbdfbd8208dab553102e116fc4a33959212d49d1a08f72702c/foliantcontrib.templateparser-1.0.0.tar.gz"
}
],
"1.0.1": [
{
"comment_text": "",
"digests": {
"md5": "af054bf06f4127e2e09df22938c9c8e4",
"sha256": "25ad527d700ef833689a16a1f59d17715436d7aa8abbe2c0708a8497b791fdf9"
},
"downloads": -1,
"filename": "foliantcontrib.templateparser-1.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "af054bf06f4127e2e09df22938c9c8e4",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 6869,
"upload_time": "2019-05-20T09:24:49",
"url": "https://files.pythonhosted.org/packages/47/3b/2e4406903ddb68eae4e98f0ff1723c2310ac3f528b644f25cde42b6bb62f/foliantcontrib.templateparser-1.0.1-py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "bd89b3c9f011b03c094950761bf92e26",
"sha256": "c788f32649673dd12e6257fa79714093bdcc52f8c667b01a59f007c236055c11"
},
"downloads": -1,
"filename": "foliantcontrib.templateparser-1.0.1.tar.gz",
"has_sig": false,
"md5_digest": "bd89b3c9f011b03c094950761bf92e26",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 4848,
"upload_time": "2019-05-20T09:24:51",
"url": "https://files.pythonhosted.org/packages/7c/d3/4b8a682d8a48906538ef73f7e6e7d4334d0da71d982f584bc29df325c875/foliantcontrib.templateparser-1.0.1.tar.gz"
}
],
"1.0.2": [
{
"comment_text": "",
"digests": {
"md5": "45c37323aaa294e00376a5af75dcb92d",
"sha256": "bd52864eedcefe9c07f7df4389447875f55011ba8812fed91566718db0bcf39a"
},
"downloads": -1,
"filename": "foliantcontrib.templateparser-1.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "45c37323aaa294e00376a5af75dcb92d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 6909,
"upload_time": "2019-06-14T13:18:43",
"url": "https://files.pythonhosted.org/packages/4a/f9/844e1e29de743a3795987ef613e8077df995fe96f64eef686459c34f35d7/foliantcontrib.templateparser-1.0.2-py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "fa0891d6344fbd79e60762d0a971054b",
"sha256": "f25f19b50571b3e7b3f1b7efad37b6c04f14be86e2372753cfa0263c39fcd4b0"
},
"downloads": -1,
"filename": "foliantcontrib.templateparser-1.0.2.tar.gz",
"has_sig": false,
"md5_digest": "fa0891d6344fbd79e60762d0a971054b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 4903,
"upload_time": "2019-06-14T13:18:44",
"url": "https://files.pythonhosted.org/packages/e4/9d/9899abd7d86ebc50326648d2c92307c3628a6193d702ac98de1426760dd5/foliantcontrib.templateparser-1.0.2.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "45c37323aaa294e00376a5af75dcb92d",
"sha256": "bd52864eedcefe9c07f7df4389447875f55011ba8812fed91566718db0bcf39a"
},
"downloads": -1,
"filename": "foliantcontrib.templateparser-1.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "45c37323aaa294e00376a5af75dcb92d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 6909,
"upload_time": "2019-06-14T13:18:43",
"url": "https://files.pythonhosted.org/packages/4a/f9/844e1e29de743a3795987ef613e8077df995fe96f64eef686459c34f35d7/foliantcontrib.templateparser-1.0.2-py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "fa0891d6344fbd79e60762d0a971054b",
"sha256": "f25f19b50571b3e7b3f1b7efad37b6c04f14be86e2372753cfa0263c39fcd4b0"
},
"downloads": -1,
"filename": "foliantcontrib.templateparser-1.0.2.tar.gz",
"has_sig": false,
"md5_digest": "fa0891d6344fbd79e60762d0a971054b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 4903,
"upload_time": "2019-06-14T13:18:44",
"url": "https://files.pythonhosted.org/packages/e4/9d/9899abd7d86ebc50326648d2c92307c3628a6193d702ac98de1426760dd5/foliantcontrib.templateparser-1.0.2.tar.gz"
}
]
}