Forum Archive

Linking out to other notes

zielperson

Link to another document?

Can I write an extension (or is there one) that links me to another document?
I like the way dropbox paper does it, but I am not convinced of paper (privacy issues)

My idea

Write ++name and the workflow will change ++name to "name" and link it via a button.

When I press the button and
- the file exists - take me there
- the file does not exist - create an empty note

zipit

It is - as far as I know - not possible to open documents programmatically in editorial (the OpenDocument workflow node only works for constants). However I did tinker a bit around which made me came up with this little workflow [1]. It will try to preview a markdown file from a relative file path in a markdown link as a HTML preview. The workflow will select the link closest to your current cursor position. The workflow is also merely more than a concept, you will have to flesh it out on your own.

Here [2] is an example document to test it on (you will also have to create a file file_b.md in the same folder, a folder moo, and a file file_c.md in this folder moo to make the links work. If you put your cursor on one of the links it will open a preview window with the rendered content of that file.

Cheers
zipit

[1] http://www.editorial-workflows.com/workflow/5870624836681728/DraBnh7o3RY
[2] https://pastebin.com/UGzsSqMN

omz

@zipit

It is - as far as I know - not possible to open documents programmatically in editorial (the OpenDocument workflow node only works for constants).

It is actually possible to use a variable there – just select "Variable..." from the copy/paste menu (same goes for all other single-line workflow parameters).

zipit

@omz

It is actually possible to use a variable there – just select "Variable..." from the copy/paste menu (same goes for all other single-line workflow parameters).

Hm, which node do you mean? The Open Document node does not seem to work with inputs for me. It does not have the variable button, Input as a variable does not work and the docs state:

Open Document

Input: N/A

Output: Same as input

zipit

Never mind, I did figure it out. It is a bit confusing though that in some cases the variable button is hidden in the context menue.

zipit

After the clarification from omz I did update the workflow a bit. Aside from the ability to open files in the editor and to create files and folders I mostly added some documentation for the code and the workflow. It works a bit like symbol browsing now . I also did streamline the syntax a bit, so that you can do fancy stuff like going folders up :p

http://www.editorial-workflows.com/workflow/5870624836681728/DraBnh7o3RY

zielperson

Wow... really nice.
Thank you!