dendron icon indicating copy to clipboard operation
dendron copied to clipboard

Folding option for Note Reference in Markdown Preview

Open anantone opened this issue 3 years ago • 3 comments

Please select if your request is either something new or an enhancement

  • [ x ] Enhancement of an existing Feature.
  • [ ] Request of a new feature.

Please select the area your request applies to. (Multiple selections are Possible. You can leave blank if you're not sure.)

  • [ ] Workspace - VSCode workspace, vaults, Intellisense/autocomplete, Dendron settings
  • [ ] Lookup - Dendron's Lookup Command
  • [ x ] Views - Dendron Preview, Tree View, Side Panels in the UI
  • [ ] Schema - Dendron Schemas
  • [ ] Pod - Data import from / export to Dendron
  • [ ] Publish - External Site Publish
  • [ x ] Markdown - Markdown features, such as syntax support and features

Is your feature request related to a problem? Please describe

I'm using the note reference link i.e. ![[note]] to transclude a number of notes into a single note. More specifically, to see the parts of a document (written in individual notes) in a "master" document file, allowing me to have a global overview of the document while working on the parts. The problem is that as the parts become long, I don't get an overview anymore in the master document, as I have to scroll through each part to see the next one.

Describe the solution you'd like

It would be really practical to be able to fold the link previews, for instance by clicking on the header (where there currently are "From" and a "Go to text"), and unfold them by clicking again.

Describe alternatives you've considered

It is possible to use the tree view (or links, etc.) and navigate between files. This would be more convenient!

Additional context

I guess what I'm looking for in a more general way is a way to have a Table of Contents where entried can fold/unfold individually to hide/show their content, as a way to toggle most conveniently between global and partial views of a long document. I'm sure there are entirely different ways to approach that, and would welcome any suggestion. Thank you!

anantone avatar Sep 11 '22 16:09 anantone

@anantone, have you tried adding headers to your master document? VS Code allows for folding with Markdown headers by default.

Additionally, this would populate the Outline section of the Primary Side Bar, which you can use to skip around the document to the sections you want to see. As an alternative, you could also create a table of contents in the document itself by adding links to each header. There are Markdown extensions (Markdown All in One being one such) that automate this process.

Would either of these options meet your needs?

micharris42 avatar Sep 11 '22 23:09 micharris42

Thank you for the suggestion @anantone, I agree that would be a very useful feature. We'll track this internally and let you know if we make progress.

adding headers to your master document? VS Code allows for folding with Markdown headers by default.

@micharris42 I think @anantone wants the folding feature in the preview, not the markdown editor

There are Markdown extensions (Markdown All in One being one such) that automate this process.

While useful, the extension has many conflicting behaviors when used with Dendron. We generally recommend disabling it when in a Dendron workspace. (see this note for more info)

hikchoi avatar Sep 12 '22 03:09 hikchoi

Thank you both for the feedback.

@micharris42 I think @anantone wants the folding feature in the preview, not the markdown editor

Indeed, it would be for the preview, as in the editor the visible content is just the links in ![[note]] format.

For a different use, it is possible in the editor to fold/unfold paragraphs, which is very nice (I am using Markdown Fiction writer extension for this).

But yes:

the extension has many conflicting behaviors when used with Dendron

This is the case for a number of extensions that I've tried. In particular to get scroll sync between editor and preview, which would be really useful! My experience with VSCode extensions with Dendron is trial and error, some parts will work, some not, and picking and choosing to achieve desired set up is very time consuming... Integrated solutions within Dendron, when possible, seem much preferable!

have you tried adding headers to your master document? Additionally, this would populate the Outline section of the Primary Side Bar, which you can use to skip around the document to the sections you want to see. As an alternative, you could also create a table of contents

This would sort of work as a classical "top-down" approach with headers and ToC, but my use case is mostly the other way: start with parts, build the master from them. I could technically paste the parts into headers of the master, but then how do I keep them synced with the original file (which I may edit on its own)? I mostly need to write and edit in each separate file, and visualize the whole in the (synced) master.

We'll track this internally and let you know if we make progress.

@hikchoi Great! Looking forward to it.

Many thanks.

anantone avatar Sep 12 '22 06:09 anantone