mgmeyers / obsidian-easy-bake

Compile many Obsidian notes down to one.
GNU General Public License v3.0
71 stars 9 forks source link

Added option to increase heading level of transcluded files #10

Open cncastillo opened 5 months ago

cncastillo commented 5 months ago

Sometimes if you have a note.md

# Abstract
...
# Introduction
...
# Chapter 1
[[chapter1.md]]

and chapter1.md

# Abstract
...
# Introduction
...
# Methods
...

You want to include the chapter increasing the heading levels by one, so note.baked.md

# Abstract
...
# Introduction
...
# Chapter 1
## Abstract
...
## Introduction
...
## Methods
...

This pull request accomplishes that, and adds a command bake-file:saved-settings using the new API.

Nevertheless, I am not sure if this is the best place to call the new incrementHeadings function (bake.ts):

    // Recurse and bake the linked file...
    const baked = incrementHeadings(sanitizeBakedContent(
      await bake(app, linkedFile, subpath, newAncestors, settings)
    ), settings.incrementHeadingLevels);

Related to #8.