cmacmackin / markdown-include

Provides syntax for Python-Markdown which allows for the inclusion of the contents of other Markdown documents.
GNU General Public License v3.0
104 stars 41 forks source link

allow include by section? #32

Open fundthmcalculus opened 2 years ago

fundthmcalculus commented 2 years ago

The goal of this PR is to enable including only a specific section of a file, as specified by the header.

fundthmcalculus commented 2 years ago

@cmacmackin thoughts?

ZedThree commented 2 years ago

@fundthmcalculus Please could you give an example of this?

BlakeFreer commented 3 months ago

This should include all content up to the next heading of equal or greater importance.

For example, given the following document called readme.md

Lorem Ipsum

Usage

Installation

Install with pip install lorem-ipsum

Importing

import lorem_ipsum

Issues

Contact me at example@email.com

Then you could include the "Usage" section (up to and excluding ## Issues) with

{!readme.md!section=usage}

Rather than needing to know the exact line numbers. This syntax plays nicely with the existing Markdown syntax where you can link to this section heading with #usage