|
| 1 | +--- |
| 2 | +title: "Editorial Marks" |
| 3 | +--- |
| 4 | + |
| 5 | +## Overview |
| 6 | + |
| 7 | +Editorial marks allow you to annotate your text with suggestions, highlights, and comments during the editing and review process. In `quarto-markdown`, these marks use a special bracket syntax and are converted to Pandoc AST spans with specific CSS classes that can be styled or processed by filters. |
| 8 | + |
| 9 | +## Syntax |
| 10 | + |
| 11 | +Editorial marks use a square bracket syntax with special marker characters: |
| 12 | + |
| 13 | +- `[!! text]` - Highlight |
| 14 | +- `[++ text]` - Insertion suggestion |
| 15 | +- `[-- text]` - Deletion suggestion |
| 16 | +- `[>> text]` - Comment |
| 17 | + |
| 18 | +The opening bracket is followed by two marker characters, then a space, and then the content to be marked. The mark is closed with a closing bracket. |
| 19 | + |
| 20 | +## Conversion to Pandoc AST |
| 21 | + |
| 22 | +When converted to Pandoc AST, editorial marks become `Span` elements with specific CSS classes: |
| 23 | + |
| 24 | +- `[!! ...]` → `Span ("", ["quarto-highlight"], []) [...]` |
| 25 | +- `[++ ...]` → `Span ("", ["quarto-insert"], []) [...]` |
| 26 | +- `[-- ...]` → `Span ("", ["quarto-delete"], []) [...]` |
| 27 | +- `[>> ...]` → `Span ("", ["quarto-edit-comment"], []) [...]` |
| 28 | + |
| 29 | +These classes can be used to apply styling in HTML output or to process the marks with Pandoc filters. |
| 30 | + |
| 31 | +## Examples |
| 32 | + |
| 33 | +### Highlight |
| 34 | + |
| 35 | +Use `[!! text]` to highlight important sections that need attention: |
| 36 | + |
| 37 | +This paragraph contains [!! an important section] that should be reviewed. |
| 38 | + |
| 39 | +```markdown |
| 40 | +This paragraph contains [!! an important section] that should be reviewed. |
| 41 | +``` |
| 42 | + |
| 43 | +### Insertion Suggestion |
| 44 | + |
| 45 | +Use `[++ text]` to suggest text that should be added: |
| 46 | + |
| 47 | +The document needs [++ additional context here] to be complete. |
| 48 | + |
| 49 | +```markdown |
| 50 | +The document needs [++ additional context here] to be complete. |
| 51 | +``` |
| 52 | + |
| 53 | +### Deletion Suggestion |
| 54 | + |
| 55 | +Use `[-- text]` to suggest text that should be removed: |
| 56 | + |
| 57 | +This sentence has [-- unnecessary words] that can be deleted. |
| 58 | + |
| 59 | +```markdown |
| 60 | +This sentence has [-- unnecessary words] that can be deleted. |
| 61 | +``` |
| 62 | + |
| 63 | +### Comment |
| 64 | + |
| 65 | +Use `[>> text]` to add editorial comments or notes: |
| 66 | + |
| 67 | +The conclusion [>> needs more supporting evidence] requires revision. |
| 68 | + |
| 69 | +```markdown |
| 70 | +The conclusion [>> needs more supporting evidence] requires revision. |
| 71 | +``` |
| 72 | + |
| 73 | +### Multiple Marks in One Paragraph |
| 74 | + |
| 75 | +You can use multiple editorial marks in a single paragraph: |
| 76 | + |
| 77 | +This paragraph has [!! a highlight], [++ an insertion], [-- a deletion], and [>> a comment] all together. |
| 78 | + |
| 79 | +```markdown |
| 80 | +This paragraph has [!! a highlight], [++ an insertion], [-- a deletion], and [>> a comment] all together. |
| 81 | +``` |
| 82 | + |
| 83 | +### Nested Formatting |
| 84 | + |
| 85 | +Editorial marks can contain other inline formatting: |
| 86 | + |
| 87 | +The section needs [++ **bold text** and *italic text*] to emphasize the point. |
| 88 | + |
| 89 | +```markdown |
| 90 | +The section needs [++ **bold text** and *italic text*] to emphasize the point. |
| 91 | +``` |
| 92 | + |
| 93 | +## Use Cases |
| 94 | + |
| 95 | +Editorial marks are particularly useful for: |
| 96 | + |
| 97 | +- **Collaborative editing**: Team members can suggest changes without directly modifying the text |
| 98 | +- **Review workflows**: Reviewers can highlight issues and suggest improvements |
| 99 | +- **Track changes**: Similar to word processor track changes, but in plain text |
| 100 | +- **Editorial comments**: Editors can leave notes without disrupting the flow of the document |
| 101 | + |
| 102 | +## Processing Editorial Marks |
| 103 | + |
| 104 | +Since editorial marks are converted to spans with CSS classes, you can: |
| 105 | + |
| 106 | +1. **Style them in HTML output**: Use CSS to visually distinguish different mark types |
| 107 | +2. **Process with Lua filters**: Write Pandoc Lua filters to convert marks to other formats |
| 108 | +3. **Accept/reject suggestions**: Build tools to process insertion and deletion suggestions |
| 109 | +4. **Generate reports**: Extract all comments and highlights for review |
| 110 | + |
| 111 | +### Example CSS Styling |
| 112 | + |
| 113 | +```css |
| 114 | +.quarto-highlight { |
| 115 | + background-color: yellow; |
| 116 | +} |
| 117 | + |
| 118 | +.quarto-insert { |
| 119 | + color: green; |
| 120 | + text-decoration: underline; |
| 121 | +} |
| 122 | + |
| 123 | +.quarto-delete { |
| 124 | + color: red; |
| 125 | + text-decoration: line-through; |
| 126 | +} |
| 127 | + |
| 128 | +.quarto-edit-comment { |
| 129 | + color: blue; |
| 130 | + font-style: italic; |
| 131 | +} |
| 132 | +``` |
| 133 | + |
| 134 | +## Availability |
| 135 | + |
| 136 | +Editorial marks are currently only available when using `quarto-markdown-pandoc`. This syntax will be integrated into Quarto's markdown processing in future releases. |
| 137 | + |
| 138 | +## Limitations |
| 139 | + |
| 140 | +- Editorial marks only support inline content, not block-level elements |
| 141 | +- The marker characters (`!!`, `++`, `--`, `>>`) must be followed by a space |
| 142 | +- Editorial marks cannot be nested within each other |
0 commit comments