sleek icon indicating copy to clipboard operation
sleek copied to clipboard

Support for Markdown-style URL syntax (automated)

Open amigo421 opened this issue 2 years ago • 9 comments

The great feature: markdown-style URL syntax allows store a bookmarks . thanks a lot for this!

this is a suggestion to slightly automate such bookmarks storing (potential scenario):

  • as usual: insert some (valid) URL (fake address) "https://mypage.com" into todo item and save this
  • improvement: sleek (on save event, in background process) try to auto-retrieve webpage title (e.g. "My page title" from the web and convert plain URL text in note into formatted URL syntax with retrieved title and previously entered URL:

[My page title](https://mypage.com)

amigo421 avatar Jun 12 '22 13:06 amigo421

@amigo421 I like the idea. The only obstacle could be very long titles. Often those are cluttered with waste or attempts to manipulate search engines. Do you have any idea how to deal with that?

ransome1 avatar Jun 14 '22 06:06 ransome1

@ransome1 I was inspired by the using such functionality daily in Obsidian MD with plugin: zolrath/obsidian-auto-link-title: Automatically fetch the titles of pasted links

to be honest,

  • there was no one case when I thou to make the title shorter... full title was okay for me. but if you set hard/customized limit for title (some const max chars) it would also okay for me.
  • regarding the format - you are right, sometimes "odd" symbols are there )) but parsing/cutting such things makes the logic too complex for such simple feature from my perspective.

again - simple obsidian plugin makes this auto-formatting with all data "as-is" and this is really useful. maybe try to implement simplest case and look at community opinion? )

amigo421 avatar Jun 14 '22 13:06 amigo421

@amigo421 I added a small prototype for something like this. Could you take a look at it and tell me if this is working as expected? https://github.com/ransome1/sleek/releases/tag/v1.2.2-rc.1

More works needs to be done on it, but this release can help us fine tuning this feature.

ransome1 avatar Jun 15 '22 08:06 ransome1

@ransome1 tried to use this.

  • title extraction works in most cases. sometimes , the title is not extracted from parameterized urls, but this is not a big problem. I'll collect a few ones later to check
  • about the functionality: I mean another thing. You extracted the title and show this in todo list view, but editing mode still contains plain url. I mean real replacement from url to markdown-style format with square brackets and parentheses in the source (todo.txt) the processed title/url 2022-06-14 [My page title](https://mypage.com) due:2022-06-15 +dev @url

amigo421 avatar Jun 15 '22 08:06 amigo421

Let me see what I can do about the markdown conversion.

Another concern with this I can think of, can be users not wanting or expecting sleek to alter their inputs. So maybe it might be a good idea to disable it by default.

ransome1 avatar Jun 15 '22 12:06 ransome1

default disabled - agreed, due of specific (not wide) usage of the functionality

from my perspective, I'm taking such todos/bookmarks for the storing web items and then make a tasks from some of them :

  1. e.g. goods and , later, add "due" to purchase some ones
  2. collect (urls) to some sightseeings for a travel with todo/due to visit
  3. urls to articles for read with planned due dates etc...

all similar scenarios are covered by sleek effectively , just readable todo's text makes this easy. and automation of this is a reason for this ticket )

amigo421 avatar Jun 15 '22 12:06 amigo421

This is a really good start! I agree that having the links converted to markdown instead of keeping them as links only would be preferable.

In my head:

  1. Convert links to markdown
  2. Once converted to markdown, the link is considered processed and Sleek won't fetch the title again
  3. Also, it would be great with an option to specify max numbers of chars allowed in title

ghost avatar Jun 23 '22 18:06 ghost

@amigo421 @stianmandarin unfortunately what appeared as a quick win turned out to be more complex as expected. I was hoping I could use the markdown parser to retrieve website data asynchronously. But it turned out not to be possible at this point. So we need a different approach and as this feature isn't high priority, I needed to parked it temporarily. I'll get back to you, when there is progress again.

ransome1 avatar Jul 01 '22 06:07 ransome1

@ransome1 No worries, mate!

ghost avatar Jul 01 '22 07:07 ghost

If this will be implemented, then I suggest an option to save links

  • as they are
  • using markdown syntax
  • using AsciiDoc url macro syntax https://docs.asciidoctor.org/asciidoc/latest/macros/url-macro/ like https://asciidoctor.org[]

I switched from Markdown to AsciiDoc for all my notes and I am very happy. Especially because of includes and xref, which makes it much easier to link between notes and to reuse content.

Of course, when opening links, all 3 syntax used to store the link should be supported. It should be possible to mix. Because tasks are created using different ways. For example I often use Android Simpletask to share a link, and the link will be as supported by Simpletask.

aisbergde avatar Sep 24 '22 09:09 aisbergde

This is an automated response. We acknowledge your report, and we appreciate your engagement. However, as there has been no recent activity in this thread, it has been marked as stale. If you have any further feedback or if the matter is still relevant, please do not hesitate to respond. Otherwise, this thread will be automatically closed in 15 days from now.

github-actions[bot] avatar Aug 04 '23 12:08 github-actions[bot]