Skip to content

[Feature Request] Support for Including Section (If snippet not found) #1

@Akv2021

Description

@Akv2021

Hi,
This extension serves the purpose of cross-referencing snippets with the given tag well.
However, there are instances when we want to include the whole section (h1/h2..). In that case we have to mark the whole section.
Could we include the support to the add section with a matching name in case no snippet is found.

For example in the following file - test.md,

  1. Include the "snippet1" (- this is part 2) with following statement :
<!-- include: test.md#snippet1-->
<!-- /include-->
  1. And Include the whole "sub header 2" with following :
<!-- include: test.md#sub-header-2-->
<!-- /include-->

test.md

<!-- Table of Contents-->
- [main header](#main-header)
  - [sub header 1](#sub-header-1)
  - [sub header 2](#sub-header-2)
    - [sub sub header](#sub-sub-header)
<!-- TOC ends-->

# main header
## sub header 1
- this is part 1
## sub header 2
<!-- snippet:snippet1 -->
- this is part 2
<!-- /snippet -->
### sub sub header
- this is sub part 1
  • In case of snippet & section with same name, simply give precedence to snippet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions