Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow include by section? #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fundthmcalculus
Copy link

@fundthmcalculus fundthmcalculus commented Apr 8, 2022

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

@fundthmcalculus
Copy link
Author

@cmacmackin thoughts?

@ZedThree
Copy link
Collaborator

@fundthmcalculus Please could you give an example of this?

@BlakeFreer
Copy link

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 [email protected]

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

@BlakeFreer BlakeFreer mentioned this pull request Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants