Giter Club home page Giter Club logo

obsidian-automatic-table-of-contents's People

Contributors

bjtho08 avatar johansatge avatar ras0q avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

obsidian-automatic-table-of-contents's Issues

underscore are discarded inside the table of content

Hello

When headers contain underscore _, the underscore is removed inside the toc.

image

the toc should keep the underscore that come from the header.

How to reproduce :

test_with_underscore

_test_with_an_other_underscore

Tested on MacOs with obsidian 1.5.12

plugins installed:

  • Automatic Table Of Contents
  • Custom file explorer sorting
  • Editing Toolbar

Thanks.

does not render color in title names

Hi and thx for this amazing plugin!

it does not seem to render any color (in html) in the heading names, ie

[travel.Taiwan.2023-09-14](app://obsidian.md/index.html#travel.Taiwan.2023-09-14)
[Visit summary](app://obsidian.md/index.html#Visit%20summary)
[<span style="background:#5ed3ff;color:#ffffff">Sites ๐Ÿ—ฝ</span>](app://obsidian.md/index.html#%3Cspan%20style=%22background:#5ed3ff;color:#ffffff%22%3ESites%20%F0%9F%97%BD%3C/span%3E)
[<span style="background:#00de79;color:#ffffff">Dishes ๐ŸŒถ๏ธ</span>](app://obsidian.md/index.html#%3Cspan%20style=%22background:#00de79;color:#ffffff%22%3EDishes%20%F0%9F%8C%B6%EF%B8%8F%3C/span%3E)
[<span style="background:#05aa5e;color:#ffffff">Food ๐Ÿณ</span>](app://obsidian.md/index.html#%3Cspan%20style=%22background:#05aa5e;color:#ffffff%22%3EFood%20%F0%9F%8D%B3%3C/span%3E)
[<span style="background:#ff0066;color:#ffffff">Calander ๐Ÿ“…</span>](app://obsidian.md/index.html#%3Cspan%20style=%22background:#ff0066;color:#ffffff%22%3ECalander%20%F0%9F%93%85%3C/span%3E)
[<span style="background:#ffda36;color:#ffffff">Notes ๐Ÿ—’๏ธ</span>](app://obsidian.md/index.html#%3Cspan%20style=%22background:#ffda36;color:#ffffff%22%3ENotes%20%F0%9F%97%92%EF%B8%8F%3C/span%3E)
[<span style="background:#ff00ff;color:#ffffff">Bike ๐Ÿšฒ</span>](app://obsidian.md/index.html#%3Cspan%20style=%22background:#ff00ff;color:#ffffff%22%3EBike%20%F0%9F%9A%B2%3C/span%3E)
Visit summary
Sites ๐Ÿ—ฝ

is this a bug or is that an inherit limitation in obsidian ?

thx!

Z

Generate real Markdown dynamically

It would be great if the codeblock containing the settings for the TOC could be defined elsewhere, e.g. via the plugin settings page. Then a TOC with a predefined style could be inserted via the Command Palette. The benefit would be that we could insert real Markdown code which would therefore be visible and useable in other Markdown viewers, not only Obsidian, and for example online.

These TOCs inserted via the Command Palette should also be tracked and dynamically updated when headings are added or removed, again with real Markdown, otherwise it would be static and soon outdated.

It would also be cool if a TOC defined via a codeblock could be converted into real Markdown in case you want to export the file or something.

I don't have much experience with your plugin, but it seems like this feature request calls into question what purpose codeblock TOCs would serve if real inserted Markdown would behave the same but with the additional benefit of being portable.

In short, dynamic TOCs are great, but I'd much prefer if it was real Markdown code (VS Code has a plugin which does this FR nicely).

Thanks!

Automatic Table of Contents on Publish.Obsidian.md

Dear all,

The ability to limit minLevel or maxLevel is very useful.

Is it possible to apply the function to Published webpages and mobile?

style: nestedList # TOC style (nestedList|inlineFirstLevel)
minLevel: X # Include headings from the specified level
maxLevel: X # Include headings up to the specified level
includeLinks: true # Make headings clickable
debugInConsole: false # Print debug info in Obsidian console

Thank you!

Table Renders some titles weirdly

Have a " | " character in some titles, and this adds one to the beginning as well

Assuming it's due to how they're parsed(?), but this is a minor bug so feel free to take your time

Latex Equation Support

There seems to be no Automatic TOC generator that yet supports LaTeX in the headings. Please add this to your feature list.
image

Default settings

It would be a lot neater to have a way of setting defaults for this addition.

For example, basically all of my notes have a top-level h1, so I'd prefer to hide these from the TOCs generated. I can add minLevel: 2 in each codeblock, but setting them for my entire workspace would be a lot cleaner. I can imagine that this can be useful for other settings as well

Feature request: manually update option

Update automatically is convenient, but when my markdown note gets larger, this function will affect the performance of the whole Obsidian application. Hope to give the control of updating ToC to users! Thank you!!

Add support for nested ordered list

Currently, only unordered lists are supported. I would like support for ordered lists.

The end result would be something like this:

% The code block below
```toc
title: # Table of Contents
style: nestedOrderedList
```
% results in the following toc
# Table of Contents
1. First heading
2. Second Heading
    1. First Sub-Heading
    2. Second Sub-heading
3. Third Heading

% given these headings in the document
# First heading
# Second Heading
## First Sub-Heading
## Second Sub-heading
# Third Heading

Ability to create a directory of the current document in another document

Hello, it is a great honor to use this plug-in you developed on Obsidian.

Here I would like to propose a new idea, you can add a command to document 1 , so that it can generate the directory of document 2ใ€‚

In this way, confusion can be avoided when the document is written.

For example: When I edit a document, I have two Windows open at the same time, one to show the directory framework (for example, document 1) and one to write the actual document (for example, document 2).

Thanks again!

TOC for embeded notes

I don't know if its possible, but i have a long doc that display lots of embeded notes ( ![[Note1.md]] ).
I want to make a TOC who can display even the title in the embeded

Allow inlineFirstLevel to be also for another level

The option style: inlineFirstLevel is great to show the ToC inline, instead of vertically. However, many of my notes do not contain any first level headings at all (because of styling reasons) making this option not work. Would it please be possible to make the option be either something like:
inlineFourthLevel
or adding another option like: inlineLevel: 4

Conflicts with the tag summary plug-in

Thank you for developing this plug-in. When I use automatic-table-of-contents at the beginning of the page, the contents labeled in the following contents disappear in the tag summary. When I removed this directory, the relevant content appeared again in the label usage document statistics.

Exclude or ignore specific headings by text

Hi. It would be useful to be able to exclude a specific heading by text. The ideal API would be as follows (the last line):

style: nestedList
exclude: ["Contents", "References"]

This would then hide only the subheadings called "Contents" and "References" from the rendered TOC. An alternative syntax would be to use regex.

For a real-world example of how this would work in other systems, check out Confluence's Table of Contents macro (screenshot below).

Image of Confluence' Table of Contents' exclude headings feature

Index in a PDF

Thanks for this nice Plugin, I got a question, is it possible to make the index and its links clickable in a exported PDF?

It (the links) didn't work for me in the PDF.

[FR]: Allow for embedded markdown headings to be part of the automatic TOC

If your working with multiple files and combining them into a single file. Then the table of content loses purpose as its no longer able to track embedded headings. A solution could be adding an option to add notes: which the user could link the note they embedded directly, or the plugin could just directly identify the headings inside the embeds and add them into the TOC.

image
What it could maybe look like?
image

An example of what the embed could look like:

title: 
notes: thisNote, anotherNote, anotherNote # Or maybe it could detect which notes have been embedded in the file and automatically add it in instead of adding it in manually
style: nestedList # TOC style (nestedList|nestedOrderedList|inlineFirstLevel)
minLevel: 0 # Include headings from the specified level
maxLevel: 0 # Include headings up to the specified level
includeLinks: true # Make headings clickable
debugInConsole: false # Print debug info in Obsidian console

Checklist

  • Check in the readme if your feature request is linked to a documented limitation
  • [-] Is your feature request related to a problem?
  • Describe the solution you'd like
  • Provide a Markdown block that helps describing your request, if relevant

Proposed display changes: headings with links, headings with bold / italics

Headings with links displayed incorrectly and non-functional navigation:

  • Occasionally I have headings with links in them, example: ### [[CSharp#|C#]] Process Injection:
  • The Table of Contents displayed for such a heading is: [}} Process Injection:](app://obsidian.md/index.html#{{CSharp#-C#}}%20Process%20Injection:)
  • As seen above the displayed link is }} Process Injection: and navigation does not work

Headings with bold or italic:

  • I often use headings with bold or italic, example: ## AV Signature Detection Bypass: **Custom Runner and Obfuscated Shellcode**
  • The Table of Contents displayed for such a heading is: [AV Signature Detection Bypass: **Custom Runner and Obfuscated Shellcode**](app://obsidian.md/index.html#AV%20Signature%20Detection%20Bypass:%20**Custom%20Runner%20and%20Obfuscated%20Shellcode**)
  • I would like to see the markdown for bold or italics stripped from the resulting ToC entry since it does not actually bold it in the link but displays the markdown "*" instead

Quick and dirty addition of title "Table of Contents"

This is a quick and dirty addition of a title to the TOC plugin, like in Typora.

This how it the TOC block will look after the modification:
image

Instructions

  1. Modify line 108. Instead of const use let.
  2. Modify line 111. Add a level 2 heading as the title "Table of Contents" to the variable markdown.

Like this:

image

Headings named "undefined"

Thank you for this plug-in! This is a function I wished for quite some time.

Unfortunately it doesn't work for me yet.
Alle headings are named "undefined"
I used the documented insert.

Screenshot -2023-09-25 at 14 21 57

Consider sanitizing HTML tags from TOC entries

Some plugins, eg. Highlightr plugin inject markup via HTML tags which messes up the TOC:

image

It would be nice if the plugin could strip any HTML tags, a simple regex <(?:"[^"]*"['"]*|'[^']*'['"]*|[^'">])+> replace to '' might do it.

Example payload:
<mark style="background: #FFF3A3A6;">Some title</mark>

Preserving the markup as opposed to escaping it would also be nice, but is more a nice to have.

Possibility to set starting point of ToC

Hi,

I'd like to be able to set a "starting point" for the table of contents. Say I do not want the first h1 and sub headings to be part of the toc. Ex:

# document information

## table of contents

``table-of-contents
first-heading: 2
``
## changelog

## other stuff

# first section in toc

## etc

# second section in toc

## etc

Would result in table of contents starting from "first section in toc":

  • first section in toc
    • etc
  • second section in toc
    • etc

Hope this makes sense. Thanks.

๐Ÿ’ฅ Could not render table of contents (Invalid regular expression: /[[/gs: Unterminated character class)

Greetings,
Ever since the most recent update, whenever I try to generate a simple automatic table of contents, I get this message :
๐Ÿ’ฅ Could not render table of contents (Invalid regular expression: /[[/gs: Unterminated character class)

image

Here is the code I am using :
image

I am using Win 10, Obsidian 1.5.3. Here are the other plugins I use :

Automatic Table of Contents

cMenu

Colored Tags

Commander

Dataview

Homepage

Iconize

Linter

Metadata menu

Multi column markdown

Omnisearch

Pretty bibtex

Recent files

Ribbon divider

Smart typography

Sort and permute lines

Tag wrangler

Text extractor

Zotero Integration

TOC renders as code block

The headings are correct and display the links perfectly. I can't click on it though since it's embedded in a code block.

grafik

I've been waiting for a plugin like this for so long! Thank you so much for putting in the effort and time!

Ignore emojis

I like emojis in the beginning of a title, but I would like them to be stripped from the TOC because they make too much noise there:

image

What about a title? And configure the size of the border?

Dear @johansatge , thanks for the implementation. Very good, works perfectly when exported to PDF. Amazing!

I was wondering: what do you think about adding a parameter to allow the user to define a title? It would turn into a self-contained block.

And what about configuring the size of the border? Right now the block of the TOC has a thick border so, when I add a title before it, the visual is a little strange.

Nonetheless, congratulations and thank you again!

Table of Contents in a seperate file

Hi friend, I love this plugin so much it is awesome. One thing I would love is being able to put the table of contents for a note in a separate note.

The reason being is that I take notes for my lessons and each lesson is in a separate note in a folder for that class. Then I make a quick reference for that folder to quickly get to the chapters I need. But if I make a table of contents inside of a note for another note than that would be perfect! You could include the specific note or notes that you would like to make that table of contents for in the code block and then it would go through like normal.

Thanks again for your great plugin!
Have a great day.

[BUG]: Link appearing when display=none

Higher rank css rules over power the css rule of link causing the display none to be shown.
We should probably add display: none !important; for the link so that its not over ruled by previous rules.

image

Solved with a bit of css.

.block-language-table-of-contents li a[style="display: none;"] {
    display: none !important;
}
title: 
style: nestedOrderedList # TOC style (nestedList|nestedOrderedList|inlineFirstLevel)
minLevel: 0 # Include headings from the specified level
maxLevel: 0 # Include headings up to the specified level
includeLinks: true # Make headings clickable
debugInConsole: false # Print debug info in Obsidian console

Checklist:

  • Check in the readme if the bug is linked to a documented limitation
  • Describe what the bug is
  • Paste a Markdown block that helps reproducing the described issue
  • Upload a screenshot with the rendered result if relevant
  • [-] Describe the environment (OS, Obsidian version, installed plugins)

Problem with pinned notes

If you've generated a Table of Contents (TOC), whether normal or documented, within a note and pinned that note, clicking any entry from the generated TOC will open a new tab with the location instead of navigating to the heading within the currently opened document.

Please see the attached screen recording below:

compressed.screen.recording.mov

minLevel

Dear @johansatge ,
appreciated, very usefull plugin.
Do you plan to add a minLevel option to exclude the (redundant) title of the document, which is generally at the first level?
Best regards.

Feature Request: TOC of currently focused file in Side Panel

Simply the ability to open the dynamic ToC for the currently focused file in a dedicated section in the Side Panel.

Pros:

  • Access to table of content for any file without necessiting to add the ToC code block inside said file
  • Allows to keep the ToC as easy and quick to access as possible while scrolling through the file, without needing to scroll back to the ToC to quickly reach another section of the file

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.