- This builds on top of File explorer from within Logseq
- It is supposed to be used on the right pane, for copying links to the main pane.
- Simple
click
on button Copy md link
to put in the clipboard a markdown link of the form [name](<file:///path>)
, ready to be pasted on the main pane.

Code
const LS = logseq.api
const Module = logseq.Module
const FS = Module.FileSystem
.setStatic(function appendButtonsForBlock(div, block){
const blockId = block.uuid
if (block.properties.foldername) div.append(
FS.button("Read", FS.onReadClicked, blockId)
)
div.append(
FS.button("Copy md link", FS.onCopyPathClicked, blockId)
)
})
.setStatic(function onCopyPathClicked(blockId, e){
const block = LS.get_block(blockId)
fs.access(FS.fullPathOfBlock(block), (err)=>{
if (err) return info("doesn't exist")
const name = FS.nameOfBlock(block)
const path = FS.fullPathOfBlock(block)
navigator.clipboard.writeText("[" + name + "](<file:///" + path + ">)")
Module.Msg.ofStatus("copied", "success")
})
})
const fs = FS.fs