text icon indicating copy to clipboard operation
text copied to clipboard

Outline view of headings for quick navigation (table of contents)

Open jancborchardt opened this issue 6 years ago • 11 comments

Here’s some examples of how other apps use headings to automatically create an outline for quick navigation. This is always shown on the left and we could do that too.

Dropbox Paper

Very nicely designed, non-obtrusive by default, with h1 and h2 levels highlighted on the left: https://blog.dropbox.com/topics/product-tips/paper-hidden-gems dropbox


Google Drive

h1 and h2 are shown normally, and it seems starting with h3 they are indented: google docs outline


FoldingText

foldingtext outline

jancborchardt avatar Jun 27 '19 09:06 jancborchardt

I was just looking around for an issue mentioning a better overview of headlines and stumbled over this. Great idea!

thopanX avatar Jun 28 '19 21:06 thopanX

like this too!

feutl avatar Jul 01 '19 12:07 feutl

Any idea if this still considered and how one can try to help?

b3 avatar Mar 03 '21 14:03 b3

This idea is great and would make the Collectives app even better!

As a complement (or maybe it would be a workaround?), it would be great to make sections collapsible (https://github.com/nextcloud/text/issues/1841)

biva avatar Sep 08 '21 10:09 biva

I would love seeing this feature implemented. I use nextcloud text a lot and this would help declutter long notes.

rinurinu avatar Nov 11 '21 10:11 rinurinu

We can actually add any mature Wiki-Software to the list of apps which have this feature, including Gitlab markdown-pages and perhaps Github. Comparison with Wiki-Software is perhaps a bit unfair if we look at the text-app alone. However, as the Nextcloud-Wiki app, which calls itself "collectives", is using "text"-app as backend it seems that many features yet missing from the collectives can only be implemented if they are also present in the text app. Besides TOC and general inter-page links (links to headings in the same document and to headings in other documents) also foot-notes come into my mind.

rotdrop avatar Feb 17 '22 10:02 rotdrop

Comparison with wiki may be unfair, but comparison with other collaborative editing tools may not be that unfair. This features (TOC visibility and direct access to section through it) is a very common and almost essential features of any collaborative editing tool such as Hedgedoc, OnlyOffice or Collabora Online.

As I said I really think this feature is a must-be and I would like to help it exist.

Any idea where to begin?

b3 avatar Feb 17 '22 18:02 b3

Comparison with wiki may be unfair, but comparison with other collaborative editing tools may not be that unfair. This features (TOC visibility and direct access to section through it) is a very common and almost essential features of any collaborative editing tool such as Hedgedoc, OnlyOffice or Collabora Online.

I also would very much like to have such a feature. I like the integration of kind-of-a-wiki into Nextcloud, and of course also the collaborative features. It is little bit sad that inter-page linking is not yet implemented.

I wonder if it would maybe easier to start with linking to headings inside pages and build the automatic TOC on top of that? Clearly the TOC wants to link to the headings in the document, so it needs support for hyper-links pointing to anchors in the same document. If these inside-page links are there (including of course that the editor jumps to the linked-to heading) then building the top would just be a matter of parsing the document and collecting the headings.

I am not involved in the development of "text", so I do not really no where to start.

rotdrop avatar Feb 17 '22 18:02 rotdrop

Comparison with wiki may be unfair, but comparison with other collaborative editing tools may not be that unfair. This features (TOC visibility and direct access to section through it) is a very common and almost essential features of any collaborative editing tool such as Hedgedoc, OnlyOffice or Collabora Online.

I also would very much like to have such a feature. I like the integration of kind-of-a-wiki into Nextcloud, and of course also the collaborative features. It is little bit sad that intra-page linking is not yet implemented. Actually, linking to headings inside documents, including the current one, i.e. linking to HTML-anchors (ok, its markup, but when it is finally rendered in the web-browser the task is to link to HTML anchors)

I wonder if it would maybe easier to start with linking to headings inside pages and build the automatic TOC on top of that? Clearly the TOC wants to link to the headings in the document, so it needs support for hyper-links pointing to anchors in the same document. If these inside-page links are there (including of course that the editor jumps to the linked-to heading) then building the TOC would just be a matter of parsing the document and collecting the headings.

I am not involved in the development of "text", so I do not really no where to start.

rotdrop avatar Feb 17 '22 18:02 rotdrop

As I said I really think this feature is a must-be and I would like to help it exist. Any idea where to begin?

Contributions in this area are of course very welcome. Let me try to summarise the necessary steps there a bit:

As we recently switched to tiptap v2 as the library being used for the editor, I think having a first look at the table of contents implementation in the documentation would be a good start:

https://tiptap.dev/guide/node-views/examples#table-of-contents

This should be adaptable to the text app, to be more specific in https://github.com/nextcloud/text/blob/master/src/components/EditorWrapper.vue where the actual editor instance is being used.

UI wise this would need to be implemented a bit differently, so that there is not a TOC node at the beginning of the document but it is a separate UI element next to the actual content.

If you have any further questions or need additional help, let us know.

juliusknorr avatar Feb 18 '22 09:02 juliusknorr

Seems like this is highly desired right now. Is anyone currently working on a branch for this? If not, I am willing to tackle #2173 first over the weekend, then perhaps this issue as well.

Bronson-Brown-deVost avatar Mar 10 '22 17:03 Bronson-Brown-deVost