iainc / Markdown-Annotations

Markdown Annotations embed authorship in text while preserving its readability and portability.
https://ia.net
103 stars 2 forks source link

Version: 0.1

Markdown Annotations

Introduction

Over the past year, AI took the world by storm. We observed its effects on apps, learned to write with AI, and released iA Writer 7, our answer to a lot of issues that AI creates for writers. We believe that authorship in plain text is new, useful, and prerequisite to working responsibly with AI text generation.

We experimented with authorship markup directly in text. The markup always got in the way when editing because every other word can have a different author. And the markup made the text difficult to read.

We store authorship as a separate block at the end of a file. This keeps texts easy to read and share, but requires a tool to update and show authorship. We think it’s the right tradeoff.

Markdown Annotations embed authorship in text while preserving its readability and portability.

---
Annotations: 0,95 SHA-256 1132bf5e376a605f5beed4b204456114  
@Human: 0,20 33,4 45,6 62,4  
&AI: 20,13 37,8 51,11 66,29  
...

We’ve put a lot of thought, time, and effort into this idea and the implementation. We are open to working with other apps to adapt the idea in some form, ideally establishing a standard.

While the format is open, avoid cloning our work. Draw inspiration from what we made. Change it. Improve it. Design it yourself. Work on it until it is substantially better. If you can’t beat our design, then let it be and do something else.

Annotations

A Markdown file consists of a text, followed by an annotation block, followed by the end of file.

An annotation block consists of:

An annotation consists of:

An annotation key can consist of any characters other than a colon. Colons must be escaped as \: to be included in the annotation key. Annotation keys omit the leading and trailing whitespace.

An annotation value can consist of any characters.

Annotation values can continue over multiple lines using continuation lines. Their indentation must be two spaces greater than the indentation of the preceding annotation key. The indentation of the first continuation determines the minimum indentation length of subsequent continuation lines. The indentation is excluded from the annotation value. Any initial spaces or tabs beyond the minimum indentation will be included in the annotation value, including in empty lines.

Hash Annotation

A complete annotation block must begin with a hash annotation, which is used to validate annotation ranges. The hash annotation key should be “Annotations”, optionally translated into the language of the document. The hash annotation value consists of:

The hash annotation character range should contain the range of the entire text. The hash annotation character range must, at the very least, include all annotated character ranges. This allows tools that do not support annotations to append text at the end.

Last Newline

The hash annotation character range can omit the last newline. When the last newline is omitted, it’s excluded from text. This allows tools to ensure that there’s an empty line between the text and the annotation block. It’s recommended to keep an empty line between the text and the annotation block because it prevents tools that are not aware of annotations from rendering the last line of the file as a heading.

Error Handling

When the hash annotation is omitted or invalid, tools that support annotations should warn users that annotations may be misplaced, and allow users to review annotations. Users must choose to discard or keep the annotations before continuing editing the file.

Author Annotations

Author annotation keys consist of:

Author identifier consists of:

Author annotation values consist of:

A character range consists of:

Character ranges must always refer to grapheme cluster indexes in text to ensure that annotations remain valid regardless of environment or file encoding.

Authorship

Author annotations that do not contain any content are considered to be authorship annotations.

To Be Announced

We’re planning to introduce several types of author annotations in the future. We have clear vision for these upcoming author annotation types, and we will update the spec as they become available.


Annotations: 0,6310 SHA-256 0650af9e723d7401b1a63e81582eb7bd
@Anton Sotkov: 15 20,107 128,186 490,642 1319 1562,632 2197,29 2227,18 2267,356 2624,15 2680,19 2705,21 2732,14 2752,4 2764,2846 5611,699
@Oliver Reichenstein: 314,176
@Iain Humm: 2194,3 2226 2245,22 2623 2639,40 2699,6 2726,6 2746,6 2756,8 5610
...