All Projects → Aidurber → obsidian-plugin-dynamic-toc

Aidurber / obsidian-plugin-dynamic-toc

Licence: MIT license
An Obsidian plugin for creating Tables of Contents that stay updated with your document

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to obsidian-plugin-dynamic-toc

longform
A plugin for Obsidian that helps you write and edit novels, screenplays, and other long projects.
Stars: ✭ 311 (+78.74%)
Mutual labels:  obsidian-plugin
oz-image-in-editor-obsidian
This Obsidian plugin to view Images, Transclusions, iFrames and PDF Files within the Editor without a necessity to switch to Preview.
Stars: ✭ 243 (+39.66%)
Mutual labels:  obsidian-plugin
obsidian-linked-data-vocabularies
Add linked data to the YAML of your Obsidian notes.
Stars: ✭ 53 (-69.54%)
Mutual labels:  obsidian-plugin
obsidian-icon-swapper
Allows swapping out Obsidian's icons
Stars: ✭ 30 (-82.76%)
Mutual labels:  obsidian-plugin
obsidian-link-archive
Link Archive plugin for Obsidian
Stars: ✭ 94 (-45.98%)
Mutual labels:  obsidian-plugin
nldates-obsidian
Work with dates in natural language in Obsidian
Stars: ✭ 263 (+51.15%)
Mutual labels:  obsidian-plugin
obsidian-todoist-plugin
Materialize Todoist tasks in Obsidian notes
Stars: ✭ 521 (+199.43%)
Mutual labels:  obsidian-plugin
obsidian-search-on-internet
Add context menu items in Obsidian to search the internet.
Stars: ✭ 79 (-54.6%)
Mutual labels:  obsidian-plugin
obsidian-rtl
RTL support for Obsidian.md
Stars: ✭ 51 (-70.69%)
Mutual labels:  obsidian-plugin
Highlightr-Plugin
A minimal and aesthetically pleasing highlighting menu that makes color-coded highlighting much easier 🎨.
Stars: ✭ 321 (+84.48%)
Mutual labels:  obsidian-plugin
obsidian-plugin-template
Template for Obsidian.md Plugins
Stars: ✭ 32 (-81.61%)
Mutual labels:  obsidian-plugin
obsidian-convert-url-to-iframe
Plugin for Obsidian.md to convert a selected URL to an iframe.
Stars: ✭ 132 (-24.14%)
Mutual labels:  obsidian-plugin
obsidian42-text-transporter
Text Transporter - advanced text management for Obsidian. Part of the Obisidan42 family of Obsidian plugins.
Stars: ✭ 100 (-42.53%)
Mutual labels:  obsidian-plugin
statusbar-pomo-obsidian
A status bar pomodoro timer plugin for Obsidian.
Stars: ✭ 51 (-70.69%)
Mutual labels:  obsidian-plugin
obsidian-task-collector
Plugin for https://obsidian.md/ that assists with managing tasks within a document.
Stars: ✭ 77 (-55.75%)
Mutual labels:  obsidian-plugin
obsidian-tracker
A plugin tracks occurrences and numbers in your notes
Stars: ✭ 661 (+279.89%)
Mutual labels:  obsidian-plugin
obsidian-metatable
An Obsidian plugin to display the frontmatter section as a fully expanded table.
Stars: ✭ 115 (-33.91%)
Mutual labels:  obsidian-plugin
obsidian-pangu
为 Obsidian 笔记加上「盘古之白」,排版强迫症者的福音。 | A small plugin aims to add space between Chinese Characters and English Alphabet, and it is a boon for typographically compulsive people.
Stars: ✭ 40 (-77.01%)
Mutual labels:  obsidian-plugin
obsidian-query2table
Represent files returned by a query as a table of their YAML frontmatter (for obsidian.md)
Stars: ✭ 24 (-86.21%)
Mutual labels:  obsidian-plugin
obsidian-spaced-repetition
Fight the forgetting curve by reviewing flashcards & entire notes on Obsidian.md
Stars: ✭ 667 (+283.33%)
Mutual labels:  obsidian-plugin

⚠️ Notice

I'm unable to find the time to keep this repository well maintained, and up-to-date with Obsidian. Life gets in the way. This plugin should be forked/rebuilt by someone who is willing to find the time to build a plugin that the Obsidian community deserves.

Obsidian Dynamic ToC

An Obsidian plugin to generate Tables of Contents that stay up to date with your document outline. Heavily inspired from hipstersmoothie/obsidian-plugin-toc

Foreword

This plugin attempts to parse your document headings and generate a markdown table of contents for them. There have been a handful of issues raised which are due to how people are using headings. Headings offer a lexical structure to a document, they are not intended to be used for style.

The following is an example of inconsistent heading depth. Instead of a level 4 heading it should be a level 3 heading.

## Level 2

#### Level 4

The following is an example of consistent heading depth. After a level 2 heading the next level is 3

## Level 2

### Level 3

👉 You can of course choose to structure your documents as you wish, but this plugin may not work effectively. I do attempt to make some exceptions but I will hide them behind settings to not interfere with peoples work flows, reduce stability, and to keep development time low. See Inconsistent Heading Depth

Usage

Code Block

It's really simple to use, just add a code block to your document:

👉YAML does not support tabs, only use spaces (source)

Defaults

```toc
style: bullet | number | inline (default: bullet)
min_depth: number (default: 2)
max_depth: number (default: 6)
title: string (default: undefined)
allow_inconsistent_headings: boolean (default: false)
delimiter: string (default: |)
varied_style: boolean (default: false)
```

Example

```toc
style: number
min_depth: 1
max_depth: 6
```

You can specify the options on a case-by-case basis in your documents, or you can override the defaults in settings. If you have settings you always want to use, your usage just becomes:

```toc

```

Inline Style

Inline styles render the highest level of heading such as H2 ## Heading 2, you can couple this with the delimiter option to generate a breadcrumbs like effect for your headings.

See Feature Request: Inline Links

Varied Style

Varied style allows for setting the topmost level of your headings, and the rest of the levels to the opposite style.

For example if you have varied_style set to true and your list style is bullet, the first level will be bullet and the subsequent headings will be number style.

Style: Bullet

Style: Number

See Feature Request: Mixed List Style

External Rendering Support

You can also add custom injection for compatibility with markdown readers such as Markor or Gitlab with the External Rendering Support setting. Such as:

  • [toc]/[TOC]
  • Or [[_TOC_]]

This feature is to allow for consistency with another tool of your choice such as GitLab.

If you have another convention that is required for a markdown reader of your choosing. Create an issue with the name of the viewer and the convention that's used.

Support All

You can skip individual selection and support all renderers by checking "Support all external renderers" in settings.

! If you add a new line between each identifier, you will get a new table of contents for each

[/toc/]

{{toc}}

[[__TOC__]]

[toc]

! If you add them all next to each other you will get a single block

[/toc/]
{{toc}}
[[__TOC__]]
[toc]

Insert Command

You can insert a table of contents by using the command palette and selecting "Insert table of contents" and selecting the table of contents to insert

Insert command

Table of contents options. Note that you will only see:

  1. "Code Block" if you have no external renderers set in settings
  2. "Code Block" and a single external renderer if set in settings
  3. All possible options if you have "Support all external renderers" set in settings

Remember you can set a hotkey in Obsidian for this command for even faster access.

Titles

You can add a title to every injected table of contents by using the Title option in setttings or inline inside a codeblock for example:

```toc
title: "## Table of Contents"
```

⚠️ If you are adding Markdown syntax to your title in the code block, you must wrap it in double quotes.

Inconsistent Heading Depth

As mentioned in the foreword above, this is not recommended, but there is a setting you can enable which will try and support you the best it can.

Given a heading structure such as:

## Level 2

#### Level 4

##### Level 5

## Level 2

### Level 3

With this option enabled, it will produce the following table of contents:

⚠️ Notice that the Level 4 and Level 3 headings are at the same depth

Contributing

yarn install

Development

To start building the plugin with what mode enabled run the following command:

yarn dev

Releasing

To start a release build run the following command:

yarn release
git push --follow-tags origin main

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].