Skip to content

Commit

Permalink
Describe path-based and ID-based links in the README
Browse files Browse the repository at this point in the history
  • Loading branch information
wgslr committed May 22, 2020
1 parent 46f980b commit 090a945
Showing 1 changed file with 35 additions and 2 deletions.
37 changes: 35 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,39 @@ The graph refreshes automatically every time you:
## Concepts

- Title is always the first markdown heading of depth 1, i.e. `# Title`.
- Any link or reference to a local file causes the extension to attempt parsing it. The title is required but links are optional (it results in a lone node with no edges in such case).
- Graph is not directed. It doesn't show which file has the link and which one is linked.
- Files which do not have a title do not appear in the graph
- Files can link to other files usin path-based or ID-based links
- The graph is not directed. It doesn't show which file has the link and which one is linked.
- Directory structure is not relevant for the graph. All that matters is the mutual links between files.

### Path-based links

Regular markdown links syntax with a relative or absolute file. For example: `[link name](./other-file-in-this-dir.md)`.

### ID-based links

A file can be given an ID. The ID is a first string matching a configured pattern (see Settings) found in the file.

File having an ID can be linked using double-bracketed ("wiki-style") links. For example:

```md
<!-- file1.md -->

# This is a file having an id

This is its id: 20200522225822
```

```md
<!-- file2.md -->

# This is a file linking to another

See the other file: [[20200522225822]]
```

This feature is heavily inspired by [Zettlr](https://github.com/Zettlr/Zettlr), therefore its [documentation](https://docs.zettlr.com/en/reference/settings/#the-id-regex) may give useful background.

## Examples

Here are some examples to better explain the above.
Expand Down Expand Up @@ -58,6 +87,10 @@ Controls in which column should the graph appear. Refer to [Column values](###co

Controls in which column should clicked files open. Refer to [Column values](###column-values). Defaults to `one`.

### `markdown-links.fileIdRegexp`

A [regular expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) used to find the file id for use in wiki-style links.

### Column values

- `active` – in the currently focused column.
Expand Down

0 comments on commit 090a945

Please sign in to comment.