{ "info": { "author": "Alberto Pianon", "author_email": "pianon@array.eu", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "pandoc-inline-headers\n=====================\n\nPandoc filter to render headers as inline headers in html, docx and odt\nconversion, while keeping header ids (and cross-references).\n\nEven if it can used as the only pandoc filter, it is intended to be used\nin cascade after\n`pandoc-crossref `__.\n\nInline header delimiters, as well as inline numbering and header styles,\ncan be customized globally and/or for a specific chapter.\n\n**NEW:** With the additional crossref-ordered-list filter (used in\ncascade *before* pandoc-crossref), it can handle also markdown ordered\nlists, converting them into \u201cnative\u201d pandoc-crossref ordered lists, that\ncan be referenced by adding the item\u2019s number or letter to section\nidentifier (like ``@sec:mysection:a``).\n\nHere is an example of the filter in action with html preview:\n\n|image0|\n\nand here is an example of conversion of the same example text to odt:\n\n|image1|\n\n1. Installation\n---------------\n\n1.1. Python Package\n~~~~~~~~~~~~~~~~~~~\n\n.. code:: bash\n\n sudo pip3 install pandoc-inline-headers\n\nor, if you want to install as user:\n\n.. code:: bash\n\n pip3 install --user pandoc-inline-headers\n\nbut then check if your PATH contains also your user installation\ndirectory).\n\n**Note**: pip and pip3 are two different applications; pip3 is for\npython 3.x and it is the one you need to use to install this package.\n\n1.2. (Highly) Recommended Pandoc Filters\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n1. `Pandoc-crossref `__ is\n not necessary but **highly recommended**, because **without it, you\n cannot exploit all the features of pandoc-inline-headers**. To\n install it, you may just download the latest release file from the\n corresponding `github\n page `__, and\n install the ``pandoc-crossref`` binary to a directory included in\n your PATH (like ``usr/local/bin`` or the like).\n2. Moreover, if you want to convert to odt, you need also a patched\n version odt-custom-styles lua filter by\n `jzeneto `__ \u2013 see my pull request\n `here `__. You\n have to download both\n `odt-custom-styles.lua `__\n and\n `util.lua `__\n and put them in your lua filters directory (tipically,\n ``~/.pandoc/filters/``).\n\n2. Usage\n--------\n\n2.1. Basics\n~~~~~~~~~~~\n\n2.1.1. YAML Configuration Variables\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n.. code:: yaml\n\n ---\n numberSections: true\n linkReferences: true\n sectionsDepth: 3\n secHeaderDelim: \". \"\n inlineHeaderLevel: 2\n ---\n\nThe first four variables are relative to the ``pandoc-crossref`` filter:\nwe activate section numbering, automatic creation of reference links,\nthird level section depth, and a section header number delimiter (period\nfollowed by tab) that will be useful when converting to docx or odt\nformats (note that the \u2018tab\u2019 character must be written as the\ncorresponding html character code \u2013 `` `` \u2013 otherwise it is ignored\nby ``pandoc-crossref``).\n\nThe last variable is the one that \u2018activates\u2019\n``inline-section-headers``. It means that all headers, whose level is 2\nor higher, will be rendered as inline headers. Such parameter\nautomatically activates also the ``crossref-ordered-list`` filter\n(see below), that can be activated also (if for some reason you do not\nwant inline section headers but you do want ordered lists converted to\n``pandoc-crossref`` sections) by setting ``crossrefOrderedList: true``.\n\nOf course you can choose level 3, 4, etc. as inlineHeaderLevel. Instead,\nputting values below 2 will not produce any effect \u2013 so first level\nheaders cannot be rendered as inline headers (this feature may be added\nin the future).\n\nAnd, of course, you can use different values for ``pandoc-crossref``\nvariables (you should refer to its\n`documentation `__): the\nvalues shown above are just an example of a typical usage of\n``pandoc-inline-headers`` together with ``pandoc-crossref``.\n\n2.1.2. Markdown Syntax\n^^^^^^^^^^^^^^^^^^^^^^\n\nJust write your markdown documents as usual, keeping in mind that all\nheaders, whose level is equal to or greater than the\n``inlineHeaderLevel`` variable, will be rendered as inline headers.\n\nSection identifiers (like ``{#sec:my_section}``) will be kept, and\ncross-references (like ``@sec:my_section``) will be correctly rendered\neven if they refer to inline headers.\n\nComments within the text or between section header and section text\n(like ````) are kept but ignored.\n\nYou can use also empty headers, like:\n\n.. code:: md\n\n ###\n\n I'm a section without header\n\nthat will be rendered (if you use ``pandoc-crossref``) as follows:\n\n 1.2.3. I\u2019m a section without header\n\neven if in such cases it is recommended to put a unique section\nidentifier:\n\n.. code:: md\n\n ### {#sec:no_header_section}\n\n I'm a section without header\n\nAs for ordered lists, if you use crossref-ordered-list filter *before*\npandoc-crossref and pandoc-inline-headers, they can be rendered and\nreferenced through pandoc-crossref.\n\nIf you want to reference an ordered list item, you can just use the\nautomatically created identifier (``#PARENT_SECTION_ID:ITEM_NUMBER``,\nf.e. ``#sec:my_section:a``), but, if you want a **custom identifier that\ndoes not change** if you change the position of the list item or you add\nother items), you can set it with a syntax like\n\n.. code:: md\n\n a. {#sec:my_custom_id} item text.\n\nHere is an example of the code with html preview:\n\n|image2|\n\nPlease note the use of ``sectionsDepth`` to choose at which level\nordered list numbers/letters have to be rendered without the parent\nsection number(s) - i.e.\u00a0\\ ``a. item`` instead of ``1.1.a. item`` - and\nalso note that, when refencing ordered list items, parent section\nnumbers are always included, regardless of the ``sectionsDepth`` value\n(exactly as one may expect).\n\n2.1.3. Markdown Preview in Editor\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nIf you use a markdown preview plugin in your favourite text editor, you\nshould include the three filters ``crossref-ordered-list``,\n``pandoc-crossref`` and ``pandoc-inline-headers`` (in this precise\norder) in pandoc rendering settings.\n\nYou should choose a markdown preview plugin that does not modify the\nmarkdown code before passing it to pandoc, otherwise you may get wrong\nor misleading output. F.e. markdown-preview-plus for Atom seem to work\ncorrectly with pandoc-inline-headers.\n\nYou can also use `markdown-preview-enhanced `__,\nthat **since version 0.16.2** works well with pandoc-inline-headers.\n\n2.1.4. Converting to html, docx, odt\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nPandoc-inline-headers must be used in cascade after ``pandoc-crossref``\n(and before ``odt-custom-styles.lua``, when converting to odt), while\ncrossref-ordered-list must be put before it.\n\na) HTML\n'''''''\n\nA typical command to convert to html would be:\n\n::\n\n pandoc -p -t html \\\n --filter=crossref-ordered-list \\\n --filter=pandoc-crossref \\\n --filter=pandoc-inline-headers \\\n --o test.html test.md\n\nb) docx\n'''''''\n\nTo convert to docx you have to do first:\n\n::\n\n pandoc -p -t docx \\\n --filter=crossref-ordered-list \\\n --filter=pandoc-crossref \\\n --filter=pandoc-inline-headers \\\n --o test.docx -p test.md\n\n..\n\n Please note the ``-p`` (or ``--preserve-tabs``) option, needed if you\n need tabs in your output document\n\nThen you should edit ``example.docx`` and change the custom paragraph\nstyles created by the filter, that are named \u2018Customlist 1 start\u2019,\n\u2018Customlist 1\u2019, \u2018Customlist 2 start\u2019, \u2018Customlist 2\u2019, and so on (styles\nwith \u2018start\u2019 at the end of the name are applied to the first paragraph\nof a section; styles without \u2018start\u2019 are applied to the following\nparagraphs).\n\nYou may use appropriate tab values in paragraph styles, that, together\nwith the section header number delimiter suggested above (period\nfollowed by tab, or ``. ``) may lead to nice results like in the\nexample images at the beggining of this README.\n\nWhen you are satisfied of your model, just save it (say, as\n``test_model.docx``) and use it in your pandoc command:\n\n::\n\n pandoc -p -t docx \\\n --filter=crossref-ordered-list \\\n --filter=pandoc-crossref \\\n --filter=pandoc-inline-headers \\\n --reference-doc=test_model.docx \\\n --o test.docx -p test.md\n\n\u00a0\n\nc) odt\n''''''\n\nConverting to odt is a little bit more complicated, since pandoc does\nnot support odt custom styles yet (there is an `open\nissue `__ about that on\ngithub). There is a `lua filter written by\njzeneto `__ as a\nworkaround for such issue, but such filter:\n\n- does not support tabs (so that you will have to use my patched\n version \u2013 see installation instructions above) and\n- does not support the creation of custom styles if they are not found\n in the model, so you will have to create your model document first,\n and manually add the needed custom styles (named like explained above\n for docx conversion).\n\nAfterwards, you will be able to convert to odt in this way:\n\n::\n\n pandoc -p -t odt \\\n --filter=crossref-ordered-list \\\n --filter=pandoc-crossref \\\n --filter=pandoc-inline-headers \\\n --lua-filter=odt-custom-styles.lua \\\n --reference-doc=test_model.odt \\\n --o test.odt -p test.md\n\n2.2. Advanced Use\n~~~~~~~~~~~~~~~~~\n\n2.2.1. Customization of inline header delimiters and styles\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe most important advanced feature you may need is customization of\ninline header delimiters and styles. This may be done globally (by\nputting the variable value in YAML metadata at the beginning of the\nmarkdown document, like ``inlineHeaderDelim: ':'``) and/or for the\nsubsections of a specific \u2018main\u2019 section header \u2013 i.e., if you set\ninlineHeaderLevel to 2, a \u2018main\u2019 section header is a level 1 header\n(example:\n``# my level 1 section {#sec:my_sec inlineHeaderDelim=\":\" inlineHeaderStyle=\"bold\"}``).\n\n**inlineHeaderDelim**\n\nSequence of characters put after an inline section header and before\nsection text. If the section header title is empty, it is not rendered.\nSetting a different value (say, colon \u2018:\u2019) only for a specific section\nmay be useful if, for example, its subsections contain definitions (like\nin the example images at the beginning of this README).\n\n*default value:* \u2018.\u2019\n\n**inlineHeaderStyle**\n\nStyle for inline headers.\n\n*possible values:*\n\n\u2018plain\u2019, \u2018normal\u2019, \u2018standard\u2019 (will be all rendered as plain text)\n\n\u2018emph\u2019, \u2018emphasis\u2019, \u2018italic\u2019 (will be all rendered as italic)\n\n\u2018bold\u2019, \u2018strong\u2019 (will be all rendered as bold)\n\n*default value:* \u2018emph\u2019\n\n**inlineHeaderNumStyle**\n\nStyle for inline header numbers. Used only if you use also\npandoc-crossref, and only if you set a different value for\n``secHeaderDelim`` and for ``chapDelim`` (for instance, if ``chapDelim``\nis set to the default value ``.``, you have to set ``secHeaderDelim``\nto, for example, ``. `` or ``. `` as suggested above)\n\n*possible values:* same as inlineHeaderStyle\n\n*default value:* \u2018plain\u2019\n\n**inlineHeaderParStyle, inlineHeaderParStyleStart**\n\nPandoc uses two paragraphs: one at the beginning of the text, one for\nthe follow-on paragraphs (usually, first paragraph, text body), to\nfollow the convention that first paragraphs have no leading indent. The\nsame happens with pandoc-inline-headers.py. Style names will be\ngenerated as follows: To override the standard default values, you can\nadd one or both of these parameters. They will be rendered according to\nthe following convention:\n\n::\n\n {inlineHeaderParStyle} {level} {inlineHeaderParStyleStart}\n {inlineHeaderParStyle} {level}\n\nTherefore, The actual name of the styles, using\n\n::\n\n {inlineHeaderParStyle=\"Mystyle\" inlineHeaderParStyleStart=\"first\"}\n\nwill be, when converted:\n\n.. code:: md\n\n # heading 1\n Mystyle 1 first\n Mystyle 1\n ## Heading 2\n Mystyle 2 first\n Mystyle 2\n ### Heading 3\n Mystyle 3 first\n Mystyle 3\n\netc.\n\n*default values:* \u2018Customlist\u2019 \u2018start\u2019\n\n2.2.2. Ordered lists\n^^^^^^^^^^^^^^^^^^^^\n\nAs for ordered lists (like ``a) ... b) ...``), you may \u2018use\u2019 them even\nwithout the ``crossref-ordered-list`` filter, but please keep in mind\nthat, **because of a**\\ `pandoc\nbug/issue `__\\ **, they\ncannot be rendered in odt or in docx conversion** with a custom *list*\nstyle, but only with a custom *paragraph* style; but with ordered lists,\nparagraph style customization is of little use, because, among other\nthings, *paragraph* syle indents are overrided by *list* style indents\n(so you will always get the indents set in the default list style,\nregardless of the level/indentation of the \u201cparent\u201d section).\n\nIn other words, you cannot customize standard ordered list styles in\ndocx and odt; this is the reason why it is preferable to render them as\n\u201cnative\u201d pandoc-crossref lists (so you can even reference them, as\nexplained in the `Basics section <#ordered-lists>`__)\n\n.. |image0| image:: https://raw.githubusercontent.com/alpianon/pandoc-inline-headers/master/examples/img/inline-headers-screenshot.png\n.. |image1| image:: https://raw.githubusercontent.com/alpianon/pandoc-inline-headers/master/examples/img/inline-headers-odt-screenshot.png\n.. |image2| image:: https://raw.githubusercontent.com/alpianon/pandoc-inline-headers/master/examples/img/inline-headers-orderedlists-screenshot.png\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/alpianon/pandoc-inline-headers", "keywords": "", "license": "GPLv3", "maintainer": "", "maintainer_email": "", "name": "pandoc-inline-headers", "package_url": "https://pypi.org/project/pandoc-inline-headers/", "platform": "any", "project_url": "https://pypi.org/project/pandoc-inline-headers/", "project_urls": { "Homepage": "https://github.com/alpianon/pandoc-inline-headers" }, "release_url": "https://pypi.org/project/pandoc-inline-headers/1.0.0/", "requires_dist": [ "panflute" ], "requires_python": "", "summary": "Pandoc filter to render headers as inline headers in html docx and odt conversion", "version": "1.0.0" }, "last_serial": 5589825, "releases": { "0.9.7": [ { "comment_text": "", "digests": { "md5": "88c4571a77cd5e807fca1cf8f736b543", "sha256": "295acd88dc93c784d4004aed375840ae43ecda9a1ddef0dbd5eecc1c6cd733f7" }, "downloads": -1, "filename": "pandoc_inline_headers-0.9.7-py3-none-any.whl", "has_sig": false, "md5_digest": "88c4571a77cd5e807fca1cf8f736b543", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 15946, "upload_time": "2019-06-24T16:37:45", "url": "https://files.pythonhosted.org/packages/67/74/4106eafe47d182d8c22186f15810285ae21fad53e2ffeae1387301fef123/pandoc_inline_headers-0.9.7-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2ea82c89224f4ba92784a52fa3ea7485", "sha256": "1a66b4c26b3780a43614958c953dec719e7f11933875cf30a020c2aa1dc6e7ee" }, "downloads": -1, "filename": "pandoc-inline-headers-0.9.7.tar.gz", "has_sig": false, "md5_digest": "2ea82c89224f4ba92784a52fa3ea7485", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11908, "upload_time": "2019-06-24T16:37:48", "url": "https://files.pythonhosted.org/packages/5a/fa/f35288c4a2757ed9ad78669c78082b547e321ad4459e86ed057c6f0abdbe/pandoc-inline-headers-0.9.7.tar.gz" } ], "0.9.8": [ { "comment_text": "", "digests": { "md5": "c687f57a8f8df175eae1447cf0c8db2c", "sha256": "11d3ef65a6245973ecdd5b9b37bafa667da1dfcaf7122b08c7c17d3a12b47914" }, "downloads": -1, "filename": "pandoc_inline_headers-0.9.8-py3-none-any.whl", "has_sig": false, "md5_digest": "c687f57a8f8df175eae1447cf0c8db2c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 16314, "upload_time": "2019-06-24T17:07:10", "url": "https://files.pythonhosted.org/packages/d0/bf/a716f13fd9644b78738b05e1776d46600552f6349eb1edd63c40e7ba02b9/pandoc_inline_headers-0.9.8-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "115fb1d84a356d5aef0d8c537c955104", "sha256": "8cca151b428f4f4cacfbbdee81eabed20f06a3ed1943f59ef129746739e06995" }, "downloads": -1, "filename": "pandoc-inline-headers-0.9.8.tar.gz", "has_sig": false, "md5_digest": "115fb1d84a356d5aef0d8c537c955104", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12195, "upload_time": "2019-06-24T17:07:14", "url": "https://files.pythonhosted.org/packages/89/64/ee150399c0d324339ca54ecaafe5f756e58b6974ece5a96fd0fffec7552b/pandoc-inline-headers-0.9.8.tar.gz" } ], "0.9.9": [ { "comment_text": "", "digests": { "md5": "1d02f480f4258abe39fc37464580a055", "sha256": "160476f406b2d99bf4ca0d11bdead8bf962a5a55f98c5b00e212927ba634bcbb" }, "downloads": -1, "filename": "pandoc_inline_headers-0.9.9-py3-none-any.whl", "has_sig": false, "md5_digest": "1d02f480f4258abe39fc37464580a055", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 17200, "upload_time": "2019-07-18T15:28:18", "url": "https://files.pythonhosted.org/packages/15/71/9fec2f6925c7b0adf2cee36c635448a6ae7d9ab8da65bd10b41067a0c055/pandoc_inline_headers-0.9.9-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "544524083d78d784c6abbc648c648e2f", "sha256": "1bd65c2df1a9d57586450c5f050c8c2f3bc1dcd74eab37ef054f2bb077fedadc" }, "downloads": -1, "filename": "pandoc-inline-headers-0.9.9.tar.gz", "has_sig": false, "md5_digest": "544524083d78d784c6abbc648c648e2f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13030, "upload_time": "2019-07-18T15:28:23", "url": "https://files.pythonhosted.org/packages/10/94/2d27396a1944f5b409ceccb7798eb123ab60d8c4b5b51e98ca71584d0430/pandoc-inline-headers-0.9.9.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "868ac7f4bc97673e3dd3b56ead46e3df", "sha256": "91fc1da4c353e708cb1139a98966771998056d5eecc96bfdf68a748495924c14" }, "downloads": -1, "filename": "pandoc_inline_headers-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "868ac7f4bc97673e3dd3b56ead46e3df", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 17271, "upload_time": "2019-07-26T16:53:39", "url": "https://files.pythonhosted.org/packages/7f/e2/fc3df0b9fd102fcdbff87d013abdc4fdfb81ec27013dcaf597e5c4bb8944/pandoc_inline_headers-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "754424466b39480dde719d1b293bf7ea", "sha256": "055af65c220397ac4e52ef92937a4551dcaa28636b1c68786f02a3534e52b19f" }, "downloads": -1, "filename": "pandoc-inline-headers-1.0.0.tar.gz", "has_sig": false, "md5_digest": "754424466b39480dde719d1b293bf7ea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13088, "upload_time": "2019-07-26T16:53:40", "url": "https://files.pythonhosted.org/packages/2b/c1/40b55f49ba9493075c94e11245a8be8592d2b9c0075b84f15734bb673690/pandoc-inline-headers-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "868ac7f4bc97673e3dd3b56ead46e3df", "sha256": "91fc1da4c353e708cb1139a98966771998056d5eecc96bfdf68a748495924c14" }, "downloads": -1, "filename": "pandoc_inline_headers-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "868ac7f4bc97673e3dd3b56ead46e3df", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 17271, "upload_time": "2019-07-26T16:53:39", "url": "https://files.pythonhosted.org/packages/7f/e2/fc3df0b9fd102fcdbff87d013abdc4fdfb81ec27013dcaf597e5c4bb8944/pandoc_inline_headers-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "754424466b39480dde719d1b293bf7ea", "sha256": "055af65c220397ac4e52ef92937a4551dcaa28636b1c68786f02a3534e52b19f" }, "downloads": -1, "filename": "pandoc-inline-headers-1.0.0.tar.gz", "has_sig": false, "md5_digest": "754424466b39480dde719d1b293bf7ea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13088, "upload_time": "2019-07-26T16:53:40", "url": "https://files.pythonhosted.org/packages/2b/c1/40b55f49ba9493075c94e11245a8be8592d2b9c0075b84f15734bb673690/pandoc-inline-headers-1.0.0.tar.gz" } ] }