zadam / trilium

Build your personal knowledge base with Trilium Notes
GNU Affero General Public License v3.0
26.97k stars 1.89k forks source link

Markdown Note source #3049

Open uGeek opened 2 years ago

uGeek commented 2 years ago

Describe feature

Would it be possible to add the Note Source Markdown option, to display all the code in Markdown? same as it does in html but another option below in Markdown syntax.

Thank you very much and congratulations for making Trilium the best service and most complete of notes

Additional Information

No response

zadam commented 2 years ago

Hi, note source is to display underlying storage of the note and for text notes we use HTML.

You can use the export dialog to convert the note into markdown:

image

uGeek commented 2 years ago

Yes, I know. I said it so I don't have to export a file and save it. Being able to copy directly without the need to export. Copy all or part of the note if necessary.

For example, I generate my articles or notes with Trilium and if I want to publish them on the blog, it is tedious to have to export it to a file. In the end it is not a problem for me, because I have made a pandoc script that converts from html to markdown, I have no problem, but it would be very practical if the option existed, since markdown is much more friendly than html. But the current option of displaying the source note in html I also like.

The current export methods in files generating the directories, subdirectories,.... and all your notes is fantastic.

I meant aside from the current export methods, preview the note with markdown syntax to copy directly from the browser.

meichthys commented 2 years ago

@uGeek Copying from Trilium to Blog probably wouldn't work well anyway since the Headings in Trilium are mangled slightly. See here: https://github.com/zadam/trilium/issues/1369#issuecomment-798830025

56independent commented 1 year ago

1+. I often like to share the crazy ideas i come up with using Rentry, and exporting to markdown is often too cumbersome as i then have to open the file, copy the content, and delete the file.

It seems rather simple; just make a button and function which takes the exported markdown content and redirect it into a new tab. Then, with appropiate selection constraints selecting only the body, one can ctrl+a and ctrl+cwithin just 500 ms and share their content on the web (or we could just directly pipe it into the clipboard should the button say copy markdown content). As such, i seek to implement it given the green flag from the developer, the green flag of mergation should the quality meet the developers expectations.

56independent commented 1 year ago

I am now working on this project and have about 25% of the base changes done for this feature to exist. Later on, i'll clean up what i've done and open the pull request.

I feel that having a button say "Copy markdown source" and another "Show note source" would be quite unmatching, so i'll instead make a button that says "Show markdown note source", and then allow copying.

uGeek commented 1 year ago

it's fantastic!!!

thank you