{
"info": {
"author": "Artemy Lomov",
"author_email": "artemy@lomov.ru",
"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": "# EscapeCode and UnescapeCode\n\nEscapeCode and UnescapeCode preprocessors work in pair.\n\nEscapeCode finds in the source Markdown content the parts that should not be modified by any next preprocessors. Examples of content that should be left raw: fence code blocks, pre code blocks, inline code.\n\nEscapeCode replaces these raw content parts with pseudo-XML tags recognized by UnescapeCode preprocessor.\n\nEscapeCode saves raw content parts into files. Later, UnescapeCode restores this content from files.\n\nAlso, before the replacement, EscapeCode normalizes the source Markdown content to unify and simplify further operations. The preprocessor replaces `CRLF` with `LF`, removes excessive whitespace characters, provides trailing newline, etc.\n\n## Installation\n\nTo install EscapeCode and UnescapeCode preprocessors, run:\n\n```bash\n$ pip install foliantcontrib.includes\n```\n\nSee more details below.\n\n## Integration with Foliant and Includes\n\nYou may call EscapeCode and UnescapeCode explicitly, but these preprocessors are integrated with Foliant core (since version 1.0.10) and with Includes preprocessor (since version 1.1.1).\n\nThe `escape_code` project\u2019s config option, if set to `true`, provides applying EscapeCode before all other preprocessors, and applying UnescapeCode after all other preprocessors. Also this option tells Includes preprocessor to apply EscapeCode to each included file.\n\nIn this mode EscapeCode and UnescapeCode preprocessors deprecate _unescape preprocessor.\n\n > **Note**\n >\n > The preprocessor _unescape is a part of Foliant core. It allows to use pseudo-XML tags in code examples. If you want an opening tag not to be interpreted by any preprocessor, precede this tag with the `<` character. The preprocessor _unescape applies after all other preprocessors and removes such characters.\n\nConfig example:\n\n```yaml\ntitle: My Awesome Project\n\nchapters:\n - index.md\n ...\n\nescape_code: true\n\npreprocessors:\n ...\n - includes\n ...\n...\n```\n\nIf the `escape_code` option isn\u2019t used or set to `false`, backward compatibility mode is involved. In this mode EscapeCode and UnescapeCode aren\u2019t applied automatically, but _unescape preprocessor is applied.\n\nIn more complicated case, you may pass some custom options to EscapeCode preprocessor:\n\n```\nescape_code:\n options:\n ...\n```\n\nCustom options available in EscapeCode since version 1.0.2. Foliant core supports passing custom options to EscapeCode preprocessor as the value of `escape_code.options` parameter since version 1.0.11. Options are described below.\n\nThe Python package that includes EscapeCode and UnescapeCode preprocessors is the dependence of Includes preprocessor since version 1.1.1. At the same time this package isn\u2019t a dependence of Foliant core. To use `escape_code` config option in Foliant core, you have to install the package with EscapeCode and UnescapeCode preprocessors separately.\n\n## Explicit Enabling\n\nYou may not to use the `escape_code` option and call the preprocessors explicitly:\n\n```yaml\npreprocessors:\n - escapecode # usually the first list item\n ...\n - unescapecode # usually the last list item\n```\n\nBoth preprocessors allow to override the path to the directory that is used to store temporary files:\n\n```yaml\npreprocessors:\n - escapecode:\n cache_dir: !path .escapecodecache\n ...\n - unescapecode:\n cache_dir: !path .escapecodecache\n```\n\nThe default values are shown in this example. EscapeCode and related UnescapeCode must work with the same cache directory.\n\nNote that if you use Includes preprocessor, and the included content doesn\u2019t belong to the current Foliant project, there\u2019s no way to escape raw parts of this content before Includes preprocessor is applied.\n\n## Config\n\nSince version 1.0.2, EscapeCode preprocessor supports the option `actions` in additional to `cache_dir`.\n\nThe value of `actions` options should be a list of acceptable actions. By default, the following list is used:\n\n```yaml\nactions:\n - normalize\n - escape:\n - fence_blocks\n - pre_blocks\n - inline_code\n```\n\nThis default list may be overridden. For example:\n\n```yaml\nactions:\n - normalize\n - escape:\n - fence_blocks\n - inline_code\n - tags:\n - plantuml\n - seqdiag\n - comments\n```\n\nMeanings of parameters:\n\n* `normalize`\u2014perform normalization;\n* `escape`\u2014perform escaping of certain types of raw content:\n * `fence_blocks`\u2014fence code blocks;\n * `pre_blocks`\u2014pre code blocks;\n * `inline_code`\u2014inline code;\n * `comments`\u2014HTML-style comments, also usual for Markdown;\n * `tags`\u2014content of certain tags with the tags themselves, for example `plantuml` for `<...`.\n\n## Usage\n\nBelow you can see an example of Markdown content with code blocks and inline code.\n\n # Heading\n\n Text that contains some `inline code`.\n\n Below is a fence code block, language is optional:\n\n ```python\n import this\n ```\n\n One more fence code block:\n\n ~~~\n # This is a comment that should not be interpreted as a heading\n\n print('Hello World')\n ~~~\n\n And this is a pre code block:\n\n mov dx, hello;\n mov ah, 9;\n int 21h;\n\nThe preprocessor EscapeCode with default behavior will do the following replacements:\n\n # Heading\n\n Text that contains some .\n\n Below is a fence code block, language is optional:\n\n \n\n One more fence code block:\n\n \n\n And this is a pre code block:\n\n \n\nEscaped content parts will be saved into files located in the cache directory. The names of the files correspond the values of the `hash` attributes. For example, that\u2019s the content of the file `15e1e46a75ef29eb760f392bb2df4ebb.md`:\n\n ```python\n import this\n ```\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.escapecode",
"keywords": "",
"license": "MIT",
"maintainer": "",
"maintainer_email": "",
"name": "foliantcontrib.escapecode",
"package_url": "https://pypi.org/project/foliantcontrib.escapecode/",
"platform": "any",
"project_url": "https://pypi.org/project/foliantcontrib.escapecode/",
"project_urls": {
"Homepage": "https://github.com/foliant-docs/foliantcontrib.escapecode"
},
"release_url": "https://pypi.org/project/foliantcontrib.escapecode/1.0.2/",
"requires_dist": [
"foliant (>=1.0.4)"
],
"requires_python": "",
"summary": "Preprocessor for Foliant to escape/unescape raw content.",
"version": "1.0.2"
},
"last_serial": 5983015,
"releases": {
"1.0.0": [
{
"comment_text": "",
"digests": {
"md5": "9dd45beef4c02d093b118e16f1833ece",
"sha256": "a9413cee2f165c64034298fdbfb4c368a3cb3f1fc7706fc140f9ce04fe8ce7a0"
},
"downloads": -1,
"filename": "foliantcontrib.escapecode-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9dd45beef4c02d093b118e16f1833ece",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 7018,
"upload_time": "2019-07-30T12:22:45",
"url": "https://files.pythonhosted.org/packages/c8/2f/a54b7cfbc29beede4312854ae15d95aeb2e2620e57f8fdb318257da555d3/foliantcontrib.escapecode-1.0.0-py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "6e7265a8edba6c0fb31e79ffb85c0df1",
"sha256": "0ebd16edfbe36f34f089ef7fe16ad705a7481a0c43d055e5b66e042d33cfa653"
},
"downloads": -1,
"filename": "foliantcontrib.escapecode-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "6e7265a8edba6c0fb31e79ffb85c0df1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5266,
"upload_time": "2019-07-30T12:22:48",
"url": "https://files.pythonhosted.org/packages/6e/d8/1e19e3308ab20432412e426381583aee175b70f4b036fbd27a335a078396/foliantcontrib.escapecode-1.0.0.tar.gz"
}
],
"1.0.1": [
{
"comment_text": "",
"digests": {
"md5": "b5d931b7faa1bae8960e97a673e07670",
"sha256": "73f8aa01b5e7c3b07ddd138cf8bf8331410d7783045af9efc05d39a95a3bd95e"
},
"downloads": -1,
"filename": "foliantcontrib.escapecode-1.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b5d931b7faa1bae8960e97a673e07670",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 6756,
"upload_time": "2019-08-02T14:56:27",
"url": "https://files.pythonhosted.org/packages/4f/b0/dc984bfd38515952eed077d5cfdce338d62dd8d42475f3cb893b384eb9b7/foliantcontrib.escapecode-1.0.1-py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "33ccb68aebbaea1f1e73bd315f785aa9",
"sha256": "71c6914de6e79452a8b15edeaaa795d3354e10203c7905c29a774fd32c538927"
},
"downloads": -1,
"filename": "foliantcontrib.escapecode-1.0.1.tar.gz",
"has_sig": false,
"md5_digest": "33ccb68aebbaea1f1e73bd315f785aa9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5025,
"upload_time": "2019-08-02T14:56:28",
"url": "https://files.pythonhosted.org/packages/8e/28/ccb3e7af5156be33728e91ac361d882a986bcc64ba672f7e41d67157b41f/foliantcontrib.escapecode-1.0.1.tar.gz"
}
],
"1.0.2": [
{
"comment_text": "",
"digests": {
"md5": "df246f59792f7dac80d6ba7b2f3c40b9",
"sha256": "a6e1810516b780eee1f6b224763bf6883be84380372648a892a054ef6f9f3406"
},
"downloads": -1,
"filename": "foliantcontrib.escapecode-1.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "df246f59792f7dac80d6ba7b2f3c40b9",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 7942,
"upload_time": "2019-10-16T12:43:36",
"url": "https://files.pythonhosted.org/packages/f7/61/3bd6d806b8ba19ab69b538662831923f9b20dbf5f28ccaa5ce42b4a2c0ec/foliantcontrib.escapecode-1.0.2-py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "c1e386922e8b04ef871ccd458d69d21d",
"sha256": "4c735d701e0077dd83ea78843116b8363bf2ff8c704a54233645847d0bb7b78f"
},
"downloads": -1,
"filename": "foliantcontrib.escapecode-1.0.2.tar.gz",
"has_sig": false,
"md5_digest": "c1e386922e8b04ef871ccd458d69d21d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 6310,
"upload_time": "2019-10-16T12:43:37",
"url": "https://files.pythonhosted.org/packages/30/b5/3b86ce6dc85007d5aed533478621bc747483f38ba5cc10741193b66291aa/foliantcontrib.escapecode-1.0.2.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "df246f59792f7dac80d6ba7b2f3c40b9",
"sha256": "a6e1810516b780eee1f6b224763bf6883be84380372648a892a054ef6f9f3406"
},
"downloads": -1,
"filename": "foliantcontrib.escapecode-1.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "df246f59792f7dac80d6ba7b2f3c40b9",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 7942,
"upload_time": "2019-10-16T12:43:36",
"url": "https://files.pythonhosted.org/packages/f7/61/3bd6d806b8ba19ab69b538662831923f9b20dbf5f28ccaa5ce42b4a2c0ec/foliantcontrib.escapecode-1.0.2-py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "c1e386922e8b04ef871ccd458d69d21d",
"sha256": "4c735d701e0077dd83ea78843116b8363bf2ff8c704a54233645847d0bb7b78f"
},
"downloads": -1,
"filename": "foliantcontrib.escapecode-1.0.2.tar.gz",
"has_sig": false,
"md5_digest": "c1e386922e8b04ef871ccd458d69d21d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 6310,
"upload_time": "2019-10-16T12:43:37",
"url": "https://files.pythonhosted.org/packages/30/b5/3b86ce6dc85007d5aed533478621bc747483f38ba5cc10741193b66291aa/foliantcontrib.escapecode-1.0.2.tar.gz"
}
]
}