Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table of contents #533

Closed
barsanuphe opened this issue May 19, 2019 · 16 comments
Closed

Table of contents #533

barsanuphe opened this issue May 19, 2019 · 16 comments

Comments

@barsanuphe
Copy link

It would be nice if there was an option to toggle a table of contents for a given text node. It would allow efficient navigation in long, well structured notes.

(recent user, sorry if such a thing already exists and I missed it)

@zadam
Copy link
Owner

zadam commented May 19, 2019

Hello, personally I prefer to have smaller notes which are structured in the note tree as opposed to long documents structured by headings. But of course this might not be always applicable.

Table of contents is currently not supported. It's actually more of a feature in the editing component and adding this is tracked on CKEditor's project. Once they add support for ToC, I'll definitely consider adding it to Trilium.

@barsanuphe
Copy link
Author

Thanks for the quick response, I'll track the CKEditor feature request then!

@jaroet
Copy link

jaroet commented Nov 19, 2019

Hello,
I also prefer using multiple smaller notes in a subtree. When a note (say the main note in a subtree) has no content the underlying notes are currently shown in a grid view, using 0.37.2.

Although nice I find that un-easy to navigate. As you read the underlying notes already (name and content) I guess it would be relatively easy to generate a Table of Content of underlying notes (only names) with correct indentation showing the level in the subtree.

This makes navigating/overviewing a subtree relatively easy instead of using the tree. Might be a small enahancement. It will keep the tree for high level navigation with detail navigation for the current subtree in the note itself. If the depth of subtree level could be configured (1 level, 2 or even 3 level) that would be great.

And if it could be added manually even better. So a short descriptive note about this subtree followed by a Table of Content.

@leeyaunlong
Copy link

Hello, personally I prefer to have smaller notes which are structured in the note tree as opposed to long documents structured by headings. But of course this might not be always applicable.

Table of contents is currently not supported. It's actually more of a feature in the editing component and adding this is tracked on CKEditor's project. Once they add support for ToC, I'll definitely consider adding it to Trilium.

it seems theckeditor finished this function: ckeditor/ckeditor5#1942

@zadam
Copy link
Owner

zadam commented May 12, 2020

It was closed as duplicate, the real issue is this: ckeditor/ckeditor5#966

@Pascalio
Copy link

Hello! Sorry to bump this issue.
I'm not sure if the original request was meant so, but rather than having a table of content at the beginning of the document it would be neat to have a ToC view in a side pane - or a pop-up... ToC at the beginning of the document is good to quickly jump somewhere when you open it, but no good for navigation back and forth in it.
Besides, I see the idea of having small notes in a subtree, this is great too; but it's no good when you need to edit many sections kind of simultaneously, taking a line from under that section to under this one, transforming lines under different sections according to each other, copying a line quickly from one section to another... All of this is easier with long documents with headings rather than with a subtree of notes, since the overview doesn't allow edition in subnotes, which is needed for the above...
Alternatively, maybe editing the subnotes from the overview, without leaving this overview, maybe this could be an alternative solution...?

@perfectra1n
Copy link

This would be an absolutely killer feature for notes that go on longer than originally intended. Again, love the work you do zadam, thanks for making the wonderful application.

@popey456963 popey456963 changed the title [Feature request] Table of contents Table of contents Jul 29, 2020
@archonic
Copy link

archonic commented Feb 4, 2021

I believe this can be closed as a duplicate. Feel free to upvote the original request here: ckeditor/ckeditor5#966

@antoniotejada
Copy link

FWIW I wrote a simple but fully featured ToC widget plugin

  • The ToC is live and automatically updated as new headers are added to the note.
  • Clicking on the ToC navigates the note.

image

https://gist.github.com/antoniotejada/54940b85d456ed3f0e6c99f915b435fe

@sigaloid
Copy link
Contributor

That widget is awesome! You should post it to the discussions: https://github.com/zadam/trilium/discussions/new?category=show-and-tell

@antoniotejada
Copy link

That widget is awesome! You should post it to the discussions: https://github.com/zadam/trilium/discussions/new?category=show-and-tell

Thanks and done! #2799

@archonic
Copy link

Good stuff @antoniotejada! I'll give it a spin.

@finzzz
Copy link

finzzz commented May 7, 2022

@antoniotejada Thank you!! I have been waiting for this features for years

One thing I would like to add suggestion is that,
When I only have H3 and H6 in the note,

### TITLE
###### SUB1
###### SUB2

It renders into

Table of Contents
1. TITLE
                            1. SUB1
                            2. SUB2

Is it possible to make it automatically adjusts the tab and also configure numbering, like so:

Table of Contents
- TITLE
  - SUB1
  - SUB2

I think this will look cleaner

@antoniotejada
Copy link

@finzzz

One thing I would like to add suggestion is that, When I only have H3 and H6 in the note,
Is it possible to make it automatically adjusts the tab and also configure numbering, like so:

Not really inclined to do that, and sounds messy, it's not just checking the next entry, you would need to check the whole table to see that the level is really missing in all entries of the table.

Out of curiosity, why do you skip levels like that?

@finzzz
Copy link

finzzz commented May 7, 2022

@antoniotejada
It's my habit to skip 2/3 levels of heading when I'm not sure if I would add new main heading in the future.
For example, if I would take this kind of note about postgresql:

#### Installation
#### Administration

Then along the way adding new header to it

### Common
#### Installation
#### Administration
### Specific Ops
#### A
### Errors
#### B

If I don't do that, I would have to edit the entire note from

## Installation
## Administration

to

## Common
### Installation
### Administration
## Specific Ops
### A
## Errors
### B

I know this is a non standard way of taking notes, and I'm already satisfied with current plugin.
So, I'm not hoping the feature I suggested will be implemented.

@zadam
Copy link
Owner

zadam commented Jul 8, 2022

Added in 0.53.X

@zadam zadam closed this as completed Jul 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests