omnivore-app / logseq-omnivore

Logseq plugin to fetch articles and highlights from Omnivore
MIT License
279 stars 15 forks source link

Investigate how we should handle org-mode #60

Open jacksonh opened 1 year ago

jacksonh commented 1 year ago

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

jacksonh commented 1 year ago

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

dlgoebel commented 1 year ago

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

tompre commented 1 year ago

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?

alexppg commented 11 months ago

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!

coffeepenbit commented 10 months ago

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.

tompre commented 10 months ago

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.