logseq-omnivore icon indicating copy to clipboard operation
logseq-omnivore copied to clipboard

Investigate how we should handle org-mode

Open jacksonh opened this issue 3 years ago • 6 comments

https://discuss.logseq.com/t/getting-started-with-org-mode/6633

jacksonh avatar Dec 16 '22 07:12 jacksonh

Some info in here: https://github.com/omnivore-app/logseq-omnivore/issues/59

jacksonh avatar Dec 16 '22 07:12 jacksonh

I came here to make this request! the plug in is great, but while it naturally seems to handle the difference between .md and .org in terms of header level ie. ## vs **, it doesn't translate quotes from the .md style > to the .org style which looks like

#+BEGIN_QUOTE

#+END_QUOTE

It also doesn't translate links, which in .org take the form [[url][text]] rather than the .md [text](url)

It would be great if you could implement a solution for this - happy to help if I can! Thanks

dlgoebel avatar Jan 02 '23 16:01 dlgoebel

You can to change your templates to generate Org-mode compliant code. Example articleTemplate:

[[{{{omnivoreUrl}}}][{{{title}}}]]
:PROPERTIES:
:collapsed: true
:site: [[{{{originalUrl}}}]{{#siteName}}[{{{siteName}}}]{{/siteName}}]
{{#author}}
:author: {{{author}}}
{{/author}}
{{#labels.length}}
:labels: {{#labels}}[[{{{name}}}]] {{/labels}}
{{/labels.length}}
:date_saved: {{{dateSaved}}}
:END:

and highlightTemplate:

Highlight [[{{{highlightUrl}}}][⤴️]]
:PROPERTIES:
:date-highlighted: {{{dateHighlighted}}}
{{#labels.length}}
:labels: {{#labels}}[[{{{name}}}]] {{/labels}}
{{/labels.length}}
:END:
#+begin_quote
{{{text}}} 
#+end_quote

Maybe there should be documentation on that.

Can I contribute somewhere?

tompre avatar Feb 14 '23 10:02 tompre

When using a single page, even with the templares it still uses markdown in the main header. But still pretty useful, thanks for the templates!

alexppg avatar Jul 13 '23 09:07 alexppg

When using a single page, even with the templares it still uses markdown in the main header. But still pretty useful, thanks for the templates!

If there was an option to change the headings from # that would be fantastic. I believe that option, along with the above templates, would be sufficient.

coffeepenbit avatar Aug 21 '23 11:08 coffeepenbit

Changing the headings would be a simple change. Just adding two new fields to the settings.

From what I see in the code, this would be only a few lines that have to be changed. I could create a pull request for that.

It is however only a quick fix as a lot of other problems still exist. The highlights will still contain markdown or HTML and thus will not render in org-mode.

tompre avatar Aug 24 '23 10:08 tompre