Skip to content
This repository has been archived by the owner on Aug 20, 2022. It is now read-only.

simonrenger/markdown-include-lines

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

markdown-include-lines

This is a markdown extension for python allows you to include lines from a source file or a whole source file. This project was inspired by https://github.com/cmacmackin/markdown-include. I tried to make the syntax as simple and intuitive as possible.

What can you do with this extension?

  • include a certain range of lines e.h. 5-29
  • include the whole file
  • include only a certain line
  • include certain lines

How to use this extension:

([...] subtsitute with the right content)

{[file type]* [start at line] - [end at line] [file]}

* file type is for the highlight part of the code block.

Range of lines:

{python 15-20 include.py}

In case you want to include the whole file:

{python * include.py}

In case you want to include only one line:

{python 15 include.py}

In case you want to include only certain lines of code:

{python [15,20,3] include.py}

Example

In case you want to include only certain lines of code:

{cpp [15,20,3] I:\Simon\Y1\BlockB\Coding\Project\Game\main.cpp}

The extension will generate the following output:

I:\Simon\Y1\BlockB\Coding\Project\Game\main.cpp

[...]
#include "Game.h"

[...]
    const float fps = 100;

[...]
    sr::Shader shader("Basic3D");

Note: [...] are actual part of this extension they get generated when ever you use this:

{cpp [15,20,3] I:\Simon\Y1\BlockB\Coding\Project\Game\main.cpp}

syntax.

How to install

$ pip install git+https://github.com/simonrenger/markdown-include-lines.git

or

You just clone this repo and then you run:

cd /where/ever/the/files/are
$ pip install .

This should install the exention and then you can use it like any other markdown extension.

About

This is a markdown extension for python which allows you to include lines of a whole source file.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages