benjypng / chrome-extension-logseq-quickcapture

chrome-extension-logseq-quickcapture

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ability to customize link format being captured

Soleone opened this issue · comments

Currently when using the extension it uses a format that isn't optimal to me in a couple of ways:

  1. It appends a timestamp that I don't want.
  2. I would also prefer to not have the whole title of the page be part of the link.
  3. Additionally I don't need to use the [[quick capture]] tag, I already have it configured to go into my #Bookmarks page, so that's the only page reference I need.

Instead I would like to use this simple format:

Title of the page - [link](https://actual.url/path)

Is there any chance you could add another textfield to the settings that lets us customize the format and insert the following 3 variables for now:

  • time
  • title
  • url

So in my example I'd set the textfield to {title} - [link]({url}).

The current default for users out there would be this format I guess: **{time}** [[quick capture]]: [{title}]({url})

Thanks for considering! It would really go a long way for a clean bookmark list. If you don't have time to implement this let me know and I can see what I can do, but also don't have a lot of time at the moment.


Update: I did look at this closed issue where it's suggested that custom capture template for quick capture can be configured in Logseq. So I went an edited my config.cdn and added the following:

:quick-capture-templates 
  {:text "{text} - [link]({url})"
   :media "{url}"}

When when I try this, for example for this page here it inserts the following into Logseq:

- [link](Ability to customize link format being captured · Issue )

I thought maybe that's an issue because of the # sign in the title (#9). So I tried another page, e.g. https://google.com and for that it inserts:

- [link]([Google](https://www.google.com/))

🔴 So it seems like it's not properly splitting up the capture into text and url and just puts everything into url and text is blank? Anything that can be done about that? And also any way by chance the # symbol in the title breaking the link can be fixed? Thanks!

My understanding is that the callback url should look like this for Google for example:

logseq://x-callback-url/quickCapture?url=https://google.com/&title=Google

Right now it looks like both are crammed into url and title is not being passed in properly. Is that something you would adjust?

How it appears in Logseq is customisable within Logseq itself, and not the extension. Open your config.edn and look for the Quick Capture options. I have extracted the excerpt below for your reference:

 ;; Quick capture templates for receiving content from other apps.
 ;; Each template contains three elements {time}, {text} and {url}, which can be auto-expanded
 ;; by receiving content from other apps. Note: the {} cannot be omitted.
 ;; - {time}: capture time
 ;; - {date}: capture date using current date format, use `[[{date}]]` to get a page reference
 ;; - {text}: text that users selected before sharing.
 ;; - {url}: URL or assets path for media files stored in Logseq.
 ;; You can also reorder them or use only one or two of them in the template.
 ;; You can also insert or format any text in the template, as shown in the following examples.
 ;; :quick-capture-templates
 ;; {:text "[[quick capture]] **{time}**: {text} from {url}"
 ;;  :media "[[quick capture]] **{time}**: {url}"}