fonimus / markdown-include-snippets

Provides syntax for Python-Markdown which allows for the inclusion of the contents of other Markdown documents.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Markdown Include Snippets

Based on project https://github.com/cmacmackin/markdown-include

Installation

# release
pip install git+https://github.com/fonimus/markdown-include-snippets.git@<tag>
# master
pip install git+https://github.com/fonimus/markdown-include-snippets.git

Usage

Whole file inclusion

{!/path/to/file.java!}
package io.fonimus;

public class Test {

    // tag::test
    public void test(){

    }
    // end::test

}

Tag snippet

{!/path/to/file.java!tag=test}
    public void test(){

    }

Single line snippet

{!/path/to/file.java!lines=3}
public class Test {

Line enumeration snippet

{!/path/to/file.java!lines=1,3,6}
package io.fonimus;
public class Test {
    public void test(){

Line range snippet

{!/path/to/file.java!lines=6-8}
    public void test(){

    }

Notes

  • If file is not found, blank line is added
  • If tag is not found, all file is included
  • If start tag or end tag is not found, all file is included

About

Provides syntax for Python-Markdown which allows for the inclusion of the contents of other Markdown documents.

License:GNU General Public License v3.0


Languages

Language:Python 100.0%