Skip to content

Latest commit

 

History

History
172 lines (114 loc) · 4.72 KB

links.org

File metadata and controls

172 lines (114 loc) · 4.72 KB

Links

<<ThisIsATarget>>

Links in org mode are a nested set of square brackets

images/links.gif

[[ Reference ][ Description ]]

Pressing enter on a link in sublime will try to follow the link. If the link is a web reference org will try to open a web browser.

The link system I am using is based on the original orgmode for sublime text and is fairly extensible. Custom handlers can be built to allow you to link easily to your own services.

There are several special ways of locating within a file within a reference.

[[<PROTOCOL>:<FILENAME>::<LOCATOR>][<NAME>]]

To manually specify locators using special symbols:

Custom Id
#<IDNAME>
Header
*<HEADING TEXT>
Row Col
Row::Col

If your locator is only text and non numerical there is an order to how the text is matched:

  • Target
  • Custom Id
  • Header

Targets

Targets are like anchors in an html file. A target is specified using double angle brackets.

<<TEXT>>

Linking to a Target

Images

Org supports the ability to show images inline in the document These are done with Sublimes phantom support under an image link and do not count as lines of text. Org can download links off the web that reference images into a cache and display them locally. This can lock up sublime while the images are downloaded so turn on visualization with care.

  • OrgShowAllImages - Shows all image links in the document
  • OrgHideAllImages - Hides all image links in the document
  • OrgShowImage - Shows a single image link in the document
  • OrgHideImage - Hides a single image link in the document

images/orgimages.gif

NOTE: You can ask that sublime visualize images by default in a file using a startup comment:

#+STARTUP: inlineimages

File and Line Number

A link can be more than just the filename. You can link to a specific line number like so:

[[file:links.org::3][File and Line Number Example]]

File and Line Number Example

Linking to Headings

You can link to a heading using a star.

[[file:./links.org::*Images][Images Example]]

Images Example

You can link without the star but it can match other things.

[[file:./links.org::Images][Images Example]]

Images Example

Custom Ids

Org has the concept of custom IDs. These are defined as a CUSTOM_ID property in a property drawer. To link to a heading with one of these IDs:

[[file:./links.org::#a-custom-id][Custom Id Example]]

Custom Id Example

How OrgExtended Helps With Links

OrgExtended has a couple of ways that it tries to help with authoring links.

The Org Link To File Command

The “Org Link To File” command lets you quickly create links between your org files. This is a powerful and quick way to create links between files.

images/link_to_file.gif

The system will, by default, place the #+TITLE: comment as the desciption field of the link if present.

Autocomplete

The autocompletion system knows about your orgDirs and org files. When you start typing a link the autocompletion system will kick in and will try to suggest files as you type the name of the file.

images/autocomplete.gif

Create Link Here On Clipboard

Selecting a header and using the “Org Create Link” command will create a link on your clipboard that you can paste somewhere else.

It will take into account custom IDs if present.

images/clipboard_link.gif

Snippet

OrgExtended has a snippet for creating links:

<l

Finding Things

Searching Links

So you know you have a link to someplace somewhere and you don’t quite remember where the link was. OrgExtended can help with quick search through all your links across all files.

"Org Search Links" 

images/search_links.gif

Backlinks

Org Roam is an amazing package that works in conjunction with org mode. We do not have nearly the same functionality of that package, but we are slowly working in that direction. Org Roam supports the concept of back links. This is a display of the links that reference the current view rather than the links the current view references.

images/backlinks.gif

Extending Link Processing

TODO: Describe how to do this.