Comments (7)
What should happen when you click on such link in a TaskPaper file?
from taskpaper-mode.
Hey @saf-dmitry
You should simply go to the org-roam page indicated. Though it would be nice if the [[ ... ][...]]
for the links was honoured so that you only see the "title" of the link you'd be heading to rather than the full linking style. Does that make sense?
from taskpaper-mode.
@wakatara TaskPaper mode already supports inline Markdown links in form [Description](URI)
as described in the manual. When markup hiding is enabled, only the description part is displayed as hyperlink making the link more readable.
You can delegate opening id:
links to Org-roam by adding the following lines to your Emacs init file:
(defun my-org-open-uri (uri)
(when (string-prefix-p "id:" uri)
(org-open-link-from-string (format "[[%s]]" uri))
t))
(add-hook 'taskpaper-open-uri-hook 'my-org-open-uri)
Now you can write something like this in your TaskPaper documents:
- Ping [Boss](id:F5531E65-5ECB-465C-9384-0B9BBF04C8B4) on that thing ...
Clicking on the link should take you to the corresponding Org-roam node (assuming Org-roam is already installed and configured).
See the corresponding example in the Scripting Guide and the documentation string of taskpaper-open-uri-hook
for more details and inspiration.
from taskpaper-mode.
Hey! Thanks for the quick response. The link opening works great once you insert that function. Very helpful.
Ah, I think I must have miscommunicated my intent with the links though.
Org-roam links use org-mode style so are of the form [[link uri][description]]
rather than markdown []()
style so they are neither highlighted nor clickable. And of course, having the mark up hidden for those so they only display their description would be amazing as well.
from taskpaper-mode.
I understand that you suggest supporting Org mode link syntax. However, honestly I don't see any good reason to support Org links (as many other link syntaxes) in the TaskPaper mode.
Why are Markdown links not working for you?
This is nicely inserted with C-n i and a handy ivy narrowing to the thing you select.
Could you elaborate this a bit more? What does C-n i
exactly do? Is it bound to org-roam-node-insert
?
from taskpaper-mode.
Completely understand your position. If it wasn't for tools like org-roam and org-journal in emacs and a few others in the ecosystem, I'd strongly prefer markdown everywhere myself (in fact, trying to see if I can get md-roam with org-roam working.). I'm a much bigger proponent of markdown myself.
But... in using emacs, it feel like org-mode has a special place even if you choose not to use it for org-agenda (which I'm obviously doing if using taskpaper mode), so I'd assert that supporting the org-mode link protocol is about as important as markdown's.
In org-roam, C-c n i calls org-roam-node-insert which brings up minibuffer you can type into to fuzzy search a node (mine's integrated with ivy) or it create an org-capture buffer with a templated org-mode file to allow you to create a new entry. The insert also then inserts an org-mode link to the document in question into your existing buffer.
If you've ever seen Roam Research or Logseq, the idea with org-roam is that it creates bidrectional links that you can then traverse to navigate or surface your information or see the backlinks to it (which is the handy feature) in order to understand it in your collections of documents and "knowledge graph" better. It's pretty handy.
from taskpaper-mode.
You can convert an Org-roam link at point to Markdown syntax using the following function:
(defun my-org-convert-link ()
(interactive)
(require 'thingatpt)
(let ((re "\\[\\[\\(.*?\\)\\]\\(?:\\[\\(.*?\\)\\]\\)?\\]"))
(when (and (derived-mode-p 'taskpaper-mode)
(thing-at-point-looking-at re))
(let* ((uri (match-string-no-properties 1))
(desc (or (match-string-no-properties 2) uri)))
(delete-region (match-beginning 0) (match-end 0))
(insert (format "[%s](%s)" desc uri))))))
You could probably advise the org-roam-node-insert
function to automatically execute my-org-convert-link
after inserting a link in a TaskPaper buffer by adding something like this (not tested):
(advice-add 'org-roam-node-insert :after #'my-org-convert-link)
from taskpaper-mode.
Related Issues (15)
- Add this to MELPA or Marmalade or similar HOT 1
- [Feature Request] Semantic comprehension of ISO weeks eg @due(w26) or @week(w26) by date queries? HOT 3
- Undo taskpaper-narrow-to-subtree? HOT 1
- Pressing C-c C-c clears the query string (not working) HOT 1
- About shortcut key. HOT 2
- How to do structured search like XPath? HOT 4
- moving and tagging with "project" HOT 1
- "Fill" commands and settings don't work in *.taskpaper files HOT 1
- custom tag done via taskpaper-tag-faces not working HOT 2
- C-c C-d: put date time HOT 1
- Please don't bundle third-party libraries HOT 6
- Saved searches: Wrong type argument: stringp
- taskpaper-refile-subtree: Wrong type argument: listp HOT 2
- how do I `Widen buffer to remove narrowing`? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from taskpaper-mode.