Skip to content

Added option to increase heading level of transcluded files#10

Open
cncastillo wants to merge 2 commits intoobsidian-community:masterfrom
cncastillo:increase-headings
Open

Added option to increase heading level of transcluded files#10
cncastillo wants to merge 2 commits intoobsidian-community:masterfrom
cncastillo:increase-headings

Conversation

@cncastillo
Copy link

@cncastillo cncastillo commented Jun 26, 2024

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.

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.

1 participant