sleek
sleek copied to clipboard
Support for Markdown-style URL syntax (automated)
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 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 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 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 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
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.
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 :
- e.g. goods and , later, add "due" to purchase some ones
- collect (urls) to some sightseeings for a travel with todo/due to visit
- 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 )
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:
- Convert links to markdown
- Once converted to markdown, the link is considered processed and Sleek won't fetch the title again
- Also, it would be great with an option to specify max numbers of chars allowed in title
@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 No worries, mate!
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.
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.