gajus / gajus/gitdown

Add an option to "include" function to increment headings

Open
#48 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
450
Forks
50
PR merge metrics
No merged PRs in 30d

Description

Add an option to the [include file](https://github.com/gajus/gitdown/tree/fab31aa75a95b0e9fa4b8d474ad42e853e8bf255#features-include-file) function that would increment heading size of the document being included to the size of the host section heading.

Example:

Source `README.md`:

``` markdown
# README

## Section where LICENSE is included

{"gitdown": "include", "file": "./LICENSE.md","adjustHeading":"contain"}
```

Source `LICENSE.md`:

``` markdown
# LICENSE

Foo

## bar

Bar
```

Current output:

``` markdown
# README

## Section where LICENSE is included

# LICENSE

Foo

## bar

Bar
```

Desired output:

``` markdown
# README

## Section where LICENSE is included

### LICENSE

Foo

### bar

Bar
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.