Add ExactAttachment header

This commit is contained in:
Charles Southerland
2020-06-25 00:36:08 -05:00
parent e5c50c3f46
commit 7145cb49b3
3 changed files with 54 additions and 18 deletions

View File

@@ -29,6 +29,8 @@ File in extended format should follow specification
<!-- Parent: <parent 1> -->
<!-- Parent: <parent 2> -->
<!-- Title: <title> -->
<!-- ExactAttachment: <local path> -->
<!-- Attachment: <local path> -->
<page contents>
```
@@ -61,6 +63,33 @@ follows include tag:
<yaml-data> -->
```
Mark also supports attachments. The standard way involves declaring an
`Attachment` along with the other items in the header, then have any links
start with an `attachment://` pseudo-URL:
```markdown
<!-- Attachment: <path> -->
<beginning of page content>
An attached link is [here](attachment://<path>)
```
The standard attachment mechanism may not work in some circumstances (e.g.
keeping content as close to identical as possible between GitHub and
Confluence), so `ExactAttachment` has been introduced:
```markdown
<!-- ExactAttachment: <path> -->
<beginning of page content>
An attached link is [here](<path>)
```
*NOTE* Be careful with `ExactAttachment`! If your path string is a subset of
another longer string or referenced in text, you may get undesired behavior.
Mark also supports macro definitions, which are defined as regexps which will
be replaced with specified template: