mProjectsCode / obsidian-js-engine-plugin

https://www.moritzjung.dev/obsidian-js-engine-plugin-docs/
GNU General Public License v3.0
73 stars 5 forks source link

Generated headlines don't show in Obsidian's outline #23

Closed tkaufmann closed 2 weeks ago

tkaufmann commented 2 weeks ago

Headlines generated by this script don't appear in Obsidian's outline and don't work as anchors. Links such as

[[##Heading 5]]

don't work.


// Define an array with 5 headings
const headings = [
    "Heading 1",
    "Heading 2",
    "Heading 3",
    "Heading 4",
    "Heading 5"
];

// Create the Headings and some Lorem Ipsum
let content = "";
headings.forEach(heading => {
    content += `## ${heading}\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n\n`;
});

// Render as markdown
return engine.markdown.create(content);
mProjectsCode commented 2 weeks ago

That is expected, as Obsidian will only index what is actually in your note and the headings created via JS Engine are not part of your note, they are just displayed as part of the note instead of the js-engine code block.