Skip to content

Commit

Permalink
Merge pull request #25 from turulix/FIX-24
Browse files Browse the repository at this point in the history
Closes #24
  • Loading branch information
turulix authored Apr 26, 2023
2 parents 09e2036 + 6437831 commit 8e375bf
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "obsidian-folder-index",
"name": "Folder Index",
"version": "1.0.11",
"version": "1.0.12",
"minAppVersion": "1.1.16",
"description": "This Plugin will automatically generate a TOC for the current Folder.",
"author": "turulix",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "obsidian-sample-plugin",
"version": "1.0.11",
"version": "1.0.12",
"description": "This is a sample plugin for Obsidian (https://obsidian.md)",
"main": "main.js",
"scripts": {
Expand Down
8 changes: 4 additions & 4 deletions src/modules/IndexContentRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ export class IndexContentRenderer extends MarkdownRenderChild {
return
}

let headings = this.app.metadataCache.getFileCache(value).headings
headings = headings.sort((a, b) => a.position.start.offset - b.position.start.offset)

let headings = this.app.metadataCache.getFileCache(value).headings
const fileLink = this.app.metadataCache.fileToLinktext(value, this.filePath)

list.push(`1. ${this.plugin.settings.includeFileContent ? '!' : ''}[[${fileLink}|${value.basename}]]`);

if (headings != null && !this.plugin.settings.disableHeadlines) {
headings = headings.sort((a, b) => a.position.start.offset - b.position.start.offset)
if (this.plugin.settings.skipFirstHeadline) {
headings = headings.slice(1)
}
Expand All @@ -59,7 +59,7 @@ export class IndexContentRenderer extends MarkdownRenderChild {
const heading = new FileHeader(headings[i])
//const numIndents = new Array(Math.max(1, heading.level - headings[0].level + (this.plugin.settings.skipFirstHeadline ? 1 : 0)));
let indent = ""
for(let j=0; j<heading.level; j++) {
for (let j = 0; j < heading.level; j++) {
indent += "\t"
}
//const indent = numIndents.fill("\t").join("");
Expand Down
3 changes: 2 additions & 1 deletion versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"1.0.0": "0.9.7",
"1.0.1": "0.12.0",
"1.0.10": "1.1.16",
"1.0.11": "1.1.16"
"1.0.11": "1.1.16",
"1.0.12": "1.1.16"
}

0 comments on commit 8e375bf

Please sign in to comment.