Skip to content

Latest commit

 

History

History
363 lines (224 loc) · 25.9 KB

md-file.md

File metadata and controls

363 lines (224 loc) · 25.9 KB

The .md file

slides.md contains the text, presenter notes, sections, and slide order. You can edit it in any text editor. MarkdownPoint watches the folder and shows your saved changes right away.

The objects' positions, styles, and animation are in the .mdpoint file. A text block's id matches the id of its object.

This is the whole file of a presentation with three slides:

---
markdownpoint: "1.0"
id: 318494ee-4e44-456f-818a-ec761b41fec2
footer: "Plain text decks"
---

<!-- section: start -->
# Start

<!-- slide: title -->

<!-- text: eyebrow -->
MarkdownPoint

<!-- text: title -->
File format==.==

<!-- text: body -->
Your slides are Markdown files you own.

<!-- notes -->
Presenter notes go here. Only the presenter sees them.

<!-- slide: points -->

<!-- text: title -->
Two files, one deck==.==

<!-- text: body -->
- **slides.md** has the words
- **presentation.mdpoint** has each slide’s layout, objects, look, and animation
- The theme is a folder in **themes**

<!-- section: finish -->
# Finish

<!-- slide: close -->

<!-- text: body -->
The words are Markdown==.==

The title slide drawn by MarkdownPoint The points slide drawn by MarkdownPoint The close slide drawn by MarkdownPoint

Writing in Obsidian

Create the presentation in MarkdownPoint. Put it in your Obsidian vault's folder or a folder inside it. Then choose “Open in Obsidian” in the File menu. Obsidian opens the presentation's slides.md in that vault. The command is dimmed when the presentation isn't in a vault or Obsidian isn't installed.

Write your slide text and presenter notes in Obsidian with the MarkdownPoint plugin. Open slides.md in Live Preview to edit all the slides and notes in one document. Use the outline to add or move slides. Use Source mode to edit the Markdown and its markers directly. Keep presentation.mdpoint, the themes, and the media next to slides.md.

A line ending inside a paragraph is a space on the slide. Turn on “Strict line breaks” in Obsidian's Editor settings. Reading view then shows it as the slide does. To break a line, end it with a backslash or two spaces.

Use the plugin's “Open in MarkdownPoint” command to save the presentation and return to the desktop app. Work on the layout, images, 3D, and animation there. The two apps use the same files throughout.

When you add or delete a slide, the plugin updates both presentation files. When editing the source directly, follow the rules below for changes that affect both files. Use the supported Markdown for slide content. Obsidian wikilinks and note embeds don't become slide content.

Slide and text markers

Comment markers separate slides and text blocks. Each marker gives the id of its slide or object. A heading or horizontal rule doesn't start a slide.

Each marker is on a line of its own. End every marker with a line break, even at the end of the file. Spaces or tabs before or after a marker, after its <!--, after its colon, or before its --> don't change it. Between code fences, a marker-shaped line is code.

The ids in the markers connect the two files. Keep a slide's id when changing its title or moving it. If you change the id, update it in both files.

Frontmatter

Start the file with frontmatter between two --- lines. Each --- line holds nothing else, not even a space. A byte order mark before the first --- is skipped. The frontmatter's lines end in LF or CRLF. MarkdownPoint uses the following keys and writes them in this order. Write each one on a single line as key: value:

  • markdownpoint: the format version in quotes, such as markdownpoint: "1.0".
  • id: the presentation's lowercase UUID. Use the same value as in the .mdpoint file.
  • save-id: the id of the save that last changed the file. A save of a presentation in a connected Dropbox or OneDrive account's folder writes a new id only when the file has no save-id or the save changes anything in it besides its save-id. The .mdpoint file has the same id in its save-id or its md-save-id. Other saves and other tools leave it unchanged.
  • footer: the footer text. It's one line with no control characters or line breaks.

Put footer in double quotes if it contains a space followed by #. Otherwise the # starts a comment. Also quote it if it contains a colon followed by a space, or if it starts with punctuation such as [, *, or - . Quote it, too, if YAML 1.2's core schema reads it as null, a boolean, or a number, such as ~, true, 001, or .5. Without quotes, some of these values aren't text in YAML. MarkdownPoint refuses them. MarkdownPoint always writes the footer in double quotes.

You can add your own keys for information used by your tools or workflow. MarkdownPoint ignores them and saves them as written.

Sections

<!-- section: id --> starts a section. An id starts with a lowercase letter from a to z. The rest is a to z, 0 to 9, and single hyphens. It ends with a letter or digit, such as intro or q3-numbers. Under it, a level-1 heading gives the section's name: # Name. Blank lines can stand between them. The name is the heading's words without their marks or links. Anything else in the heading, such as a field, an image, or a comment, is an error. A paragraph id is a comment too. A section's block contains nothing else. Sections are optional, but once there is one, every slide must be in a section.

Slides

<!-- slide: id --> starts a slide. Only a marker starts a slide. A slide continues until the next slide or section marker, or the end of the file. Slides appear in the order they're listed. To move a slide, move its lines. The .mdpoint file doesn't change. In git, a moved slide shows as lines deleted in one place and added in another. Merging the move with an edit to that slide's words gives a conflict over the whole slide.

Each slide also has an entry in the .mdpoint file under the same id. The order of entries there doesn't matter. layout is the theme layout the slide uses.

{
  "close": {"layout": "one-liner"},
  "points": {"layout": "content-with-header", "scheme": "sky"},
  "title": {"layout": "title"}
}

A new slide needs both its marker and its entry. To delete or rename a slide, change both files.

Text

<!-- text: id --> starts an object's text. The text continues until the next marker. Here eyebrow, title, and body are placeholders from the slide's layout. For any other object, the id is its id in the .mdpoint file. Shapes, tables, and charts get their text the same way. A Markdown table under the id of an image or a video placeholder fills it only when the slide's override in the .mdpoint file sets type to chart or table. Otherwise, the table shows in the master's default text box.

Paragraphs are separated by one or more blank lines. An empty paragraph is a line that starts with <br> and has only spaces or tabs after it. It has a blank line before and after it. Two <br> lines in a row with nothing else are one empty line with a line break. Blank lines right after a marker or before the next marker are only separators. A Markdown formatter can add or remove them without changing the slide. A code block that is never closed runs to the end of the file. Its blank lines are part of its code, except a blank last line of the file.

Presenter notes

<!-- notes --> starts the presenter notes of a slide. The audience never sees them. Notes use the same Markdown as slide text and can appear anywhere among the blocks of their slide. A paragraph id in presenter notes is read as it is in slide text and is never shown. No step can name it. MarkdownPoint doesn't give ids to paragraphs in notes. It saves notes as written and doesn't warn about a repeated or misspelled id in them.

Horizontal rules

A line of ---, ***, or ___ is a horizontal rule. On a slide, it spans its text box. It can appear anywhere in a text or notes block: at the start, between paragraphs, or at the end. A --- at the end of a slide belongs to the slide's last block.

Leave a blank line above a rule. Directly under a line of text, --- isn't a rule. It makes that line a heading.

A --- must be inside a block. Directly under a slide's marker, before its first text or notes marker, it's an error.

Escapes

A comment line is marker-shaped when it holds one lowercase word, such as <!-- todo -->, or a lowercase word, a colon, and an id or two ids joined by a dot, such as <!-- todo: card.title -->. Spaces or tabs can stand in it where they can in a marker. To keep a marker-shaped line inside its block, write a backslash after <!--, as in <!--\ slide: example -->. A line that reads as an incorrectly written marker takes the backslash too. MarkdownPoint writes the backslash for every such note it saves, and removes it when it reads the file. The line is then the comment you meant.

This slide has a rule, a comment, and an escaped marker. Neither comment is shown:

<!-- slide: rules -->

<!-- text: title -->
Rules and comments==.==

<!-- text: body -->
A rule runs across its text box.

---

<!-- Check these numbers before the talk. -->

<!--\ slide: draft -->

Neither comment above shows on the slide.

The rules slide drawn by MarkdownPoint

Markdown

Text objects, tables, and presenter notes use Markdown. The reference lists everything that's supported.

Marks, links, and colors

<!-- slide: marks -->

<!-- text: title -->
Marks, links, and colors==.==

<!-- text: body -->
Words can be **bold**, *italic*, ==highlighted==, ~~struck through~~, or `code`. The 2 in x<sup>2</sup> is raised, and the one in H<sub>2</sub>O is lowered.

[A link](https://markdownpoint.com) opens a webpage, and [these words]{color=accent} are in the accent color.

The marks slide drawn by MarkdownPoint

==highlighted== and [colored]{color=accent} text are MarkdownPoint additions. A color is either a role from the slide's color scheme, such as accent, or a hex color: [text]{color="#2F7D4F"}.

Superscript and subscript use HTML's tags: x<sup>2</sup> and H<sub>2</sub>O. GitHub and Obsidian show them too. They are two thirds of the size around them. Superscript is raised by 30% of that size, and subscript is lowered by 25%.

Words can also have their own weight: [text]{font-weight=600}. The weight is 100, 200, 300, 400, 500, 600, 700, 800, or 900. In italic text, words can stand upright: [text]{font-style=normal}. normal is its only value. To set more than one of these, use one span: [text]{color=accent font-weight=600 font-style=normal}. They can come in any order. Each value can be bare or in single or double quotes. A value stays on one line. Spaces, tabs, or one line break can stand between them and inside the braces. MarkdownPoint writes the color first, then the weight, then font-style. A span with any other key, a repeated key, or a value its key doesn't accept stays as written in the file. MarkdownPoint skips that attribute and applies the others. When a key repeats, only its first counts. **Bold** overrides a word's own weight, and a word's own weight overrides the weight a text style gives to italic or highlighted words. *Italic* overrides font-style=normal.

Code can have a color and a link, but no other mark. Bold, italic, highlight, strikethrough, superscript, subscript, a weight, and font-style don't apply to code. MarkdownPoint writes such a mark only around the words next to the code: **slides are `code` you** becomes **slides are** `code` **you**.

Lists

<!-- slide: lists -->

<!-- text: title -->
Lists==.==

<!-- text: body -->
- A bullet
  - A deeper bullet
- Another bullet

1. First
2. Second

The lists slide drawn by MarkdownPoint

To nest an item under the one above, indent it to where that item's text starts: two spaces under - , three under 1. . A numbered list can start at any number with up to nine digits.

An empty item contains <br>: - <br>. An empty item with a list nested under it is just its marker. With a <br> line there, GitHub and other apps that read CommonMark would include the nested list in that line. In GitHub and other apps that read CommonMark, a nested numbered list that starts at a number other than 1 needs a blank line before it.

To start another list immediately after one, change the list marker. MarkdownPoint uses * after -, or 1) after 1..

Fields

<!-- slide: fields -->

<!-- text: title -->
Fields==.==

<!-- text: body -->
This is slide {{slide-number}} of {{slide-count}}. It is in section {{section-number}}: {{section-name}}.

The fields slide drawn by MarkdownPoint

A field shows a value that MarkdownPoint fills in, such as the slide number. The reference lists every field and how it counts. Slide numbers count only the slides that are shown. With slides A, B, and C, and B skipped, {{slide-number}} of {{slide-count}} on C shows 2 of 2. Section numbers count only the sections that hold a shown slide. The footer field shows the footer set in the frontmatter. A name that isn't a field, such as {{author}}, shows as written. MarkdownPoint keeps it and warns about it.

Quotes and inline code

<!-- slide: quote -->

<!-- text: title -->
Quotes and code==.==

<!-- text: body -->
> Plain text in, a point made beautifully out.

```js
const deck = "slides.md"
```

The quote slide drawn by MarkdownPoint

Tables

A table is its own object. It is written as a Markdown table.

<!-- slide: table -->

<!-- text: title -->
Tables==.==

<!-- text: prices -->
| Plan | Seats | Price |
| --- | --- | --- |
| Solo | 1 | Free |
| Team | 10 | $8 |

Its position, columns, minimum row heights, and style are in the .mdpoint file. A row grows taller when its words need more room. The table is as tall as its rows:

[
  {
    "id": "prices",
    "type": "table",
    "frame": {"x": 120, "y": 380},
    "inset": 24,
    "text-style": "body",
    "column-widths": [840, 420, 420],
    "min-row-heights": [140, 140, 140],
    "alternating-rows": true
  }
]

The table slide drawn by MarkdownPoint

Code blocks

A code block is written between two fences. A fence is three or more backticks or tildes. The closing fence uses the same character and is at least as long. Only spaces or tabs can follow it. The language named after the opening fence sets how the code is colored. The name can be in any case, and js works as well as javascript. The reference lists every name. Add {lines:true} after the language to number the lines.

A code block can also be in a quote or a list item. It ends at its closing fence or when the quote or item ends. A theme's text follows the same rules. A code block left open there ends with the object's words. A link definition can't contain a fence. After [x]: /url (title, a fence on the next line opens a code block.

Characters

A character reference is read as the character it names. &amp; is &, and &copy; and &#169; are both ©. In code, a reference shows as written. Anywhere else, put a backslash before the & to keep the reference as written: \&amp;. MarkdownPoint writes that backslash when you type a reference in the app.

In a list item, each tab at the start of a line is read as the spaces up to the next multiple of four columns. MarkdownPoint writes every tab in an item's words as &#9;. A tab or four spaces at the start of a paragraph would start a code block, and spaces after a list item's marker would belong to the marker. Right after a list, a paragraph indented as far as the last item's text would become part of that item. In those places, MarkdownPoint writes the first tab or space as &#9; or &#32;.

Where it differs from CommonMark

Bold and italic follow CommonMark except in one way. In CommonMark, a run of * between punctuation and a letter or a digit can open only when the letter or digit follows it, and close only when the letter or digit comes before it. In MarkdownPoint, such a run can both open and close. So **C++**17 is read as a bold “C++” followed by “17”, and **Note:**This as a bold “Note:” followed by “This”. In CommonMark, the asterisks in both stay as written.

The same rule applies to Chinese and Japanese. Both are written without spaces between words. In これは**「重要」**です, “「重要」” is bold. The CJK-friendly amendment to CommonMark reads these cases the same way. Unlike the amendment, MarkdownPoint applies the rule in every script, and only to *.

The rule changes how one rare case is read. *(*foo*)* is read as italic parentheses around a plain “foo”. In CommonMark, it is one italic inside another. A run of _ is read as in CommonMark.

The style can change anywhere in a word. **Mark**down is read back as a bold “Mark” followed by “down”. When asterisks inside one word can't express the changes, MarkdownPoint puts each run in a span with no attributes. A word that is bold, then bold italic, then italic is written [**Mark**]{}[***do***]{}[*wn*]{}. A span with no attributes adds no formatting of its own.

In a list item, a line of code that isn't indented stays in the item's code block when the line above it is code. It ends the item and the code block when the line above it is blank, starts with # or a fence, is a rule such as ---, or is indented four spaces or more past the item's text. It ends them too when it is itself a rule or starts with #, >, a list marker, a fence, or an HTML block. In CommonMark, any line that isn't indented ends them.

In a list item, a nested list ends the paragraph above it when it starts at a number other than 1 or when its first line is only *, +, 1., or 1). A line with only an HTML tag other than <br>, such as </pre>, ends the paragraph too. In CommonMark, the list and </pre> continue the paragraph. Outside list items, MarkdownPoint reads them as CommonMark does.

Lists and quotes nest at most 100 deep in all: the outermost is the first level, and a list in a quote is one level deeper. A deeper marker stays as written.

Unsupported Markdown

MarkdownPoint keeps this Markdown in the file as written, and the slide shows it as plain text:

  • images
  • HTML tags other than <br>, <sup>, and <sub>
  • footnotes
  • task-list boxes, such as - [ ] item
  • bare addresses, written without < and >
  • reference links, such as [the guide][g], and their definitions, such as [g]: https://markdownpoint.com

Reference links stay plain text in every 1.x version. <br> adds a line break in a text block or a table cell. To put an image on a slide, add an image object in the .mdpoint file.

An HTML comment inside a text or notes block is a note to yourself. It's kept in the file and never shown. A comment at the end of a slide belongs to the slide's last block. A table's or a chart's block contains only its table. A comment can't follow it.

A paragraph id isn't a note. The next section describes it.

Paragraph ids

To bring a paragraph in on a click, a step in the .mdpoint file names the paragraph by its id. The id is a comment at the end of the paragraph's last line, as in Our results <!-- id: k3x9a2 -->. Headings get an id the same way. A list item's id ends the last line of its first paragraph. An empty list item's id follows its <br>, as in - <br> <!-- id: k3x9a2 -->. Any other empty paragraph or heading can't have an id. Neither can a list item that's empty except for a task-list box, as in - [ ] or - [ ] <br>. MarkdownPoint warns about an id on a later paragraph of a list item. No step can name it there. An id follows the same rules as a section's id: a to z, 0 to 9, and single hyphens, starting with a letter and ending with a letter or digit. Spaces and tabs around the comment and inside it don't matter. MarkdownPoint writes the comment after one space as shown. A formatter that wraps long lines can move the comment onto a line of its own. It's still the paragraph's id there if no blank line comes before it.

MarkdownPoint writes the ids. When a paragraph is split, the first part keeps its id and the second part is a new paragraph. When two paragraphs are joined, the joined paragraph keeps the first one's id. A list item keeps its id when all its words are deleted. Do the same when you edit the words by hand. When a merge joins two versions of a paragraph with the id at the end of each, MarkdownPoint reads one id. It writes the id once the next time you edit that text block or run mdpoint format. Keep each id at the end of its paragraph, and don't give a new paragraph an id. MarkdownPoint gives it one.

Each id belongs to one paragraph of its text. A copied line or a merge can leave two paragraphs with the same id. The first keeps it, and the later one is read as a new paragraph. MarkdownPoint warns about this and names the line. When it saves that text, it writes the later paragraph without the id. It also warns about a comment that looks like a misspelled id, such as <!-- ID: k3x9a2 -->, <!-- id k3x9a2 -->, or an id alone on its line after a blank line. Each of these is read as a note.

Editing by hand

MarkdownPoint can't read the file if it contains any of these, among other problems:

  • text, a comment, or a --- outside a text or notes block
  • a comment after a table, or after a chart's table
  • a marker written incorrectly, such as <!-- Slide: intro -->, or the same marker twice
  • a section without its # Name line
  • markdownpoint without quotes, or with a major version other than 1
  • a slide marker without its entry in the .mdpoint file, or an entry without its marker
  • a code block outside a quote or a list item that is never closed and contains a marker
  • a merge conflict that git left outside a code block: from a line that starts with <<<<<<< and a space to a later line that starts with >>>>>>> and a space
  • one of MarkdownPoint's own frontmatter keys not written as key: value on one line, such as "footer": Q3

A comment line counts as an incorrectly written marker when it starts with a marker's word in any letter case and has at most one other word. A closing slash, or words after -->, don't change this. A comment that starts with such a line is a note to yourself when its first --> ends a later line and comes before the next <!--.

MarkdownPoint then shows the file, the line, and the problem, and it won't open the presentation. If the presentation is already open, MarkdownPoint waits for the fix and never overwrites your file.

Inside a code block, a merge conflict's lines are part of the code. A slide can show them. A real conflict there stays on the slide until you resolve it.

A layout's placeholder keeps its id. Renaming it in MarkdownPoint changes only its label. The slides' text blocks and overrides stay the same. If you change a placeholder's id by hand in the layout file, also change the text blocks and overrides of every slide that uses that layout to the new id. When a block names no object, and the placeholder-layout of the slide's override for the block's id names a layout with a text placeholder of that id, the block shows as that placeholder. Without such an override, the block shows in the master's default text box.

A table's column widths and minimum row heights in the .mdpoint file are listed in the table's order. When you add or remove a column or a row by hand, add or remove its width or height at the same position. MarkdownPoint warns when a table has more widths or heights than columns or rows.

A chart's colors in the .mdpoint file are listed in the order of the chart's table. Its series-colors have one for each series column, and its category-colors one for each category row. When you add, remove, or move a column by hand, add, remove, or move its color in series-colors at the same position. Do the same for a row in category-colors.

Validating the files

mdpoint validates a presentation folder without the app running. It reports problems with the files, such as missing images, models, and fonts.

To install it, open MarkdownPoint's Settings, choose “Coding agents”, and click “Install” under “Command line”. Run mdpoint validate in the presentation folder. For JSON output, run mdpoint --presentation <folder> --json validate.

Each issue has a severity of error or warning, a code, and a message. Most issues also have a path. For presentation.mdpoint, the path selects the value one key after another. Once an object's id can be read, the path names the object by its id, such as slides.intro.objects.title.opacity. For slides.md, it is the frontmatter key or the section, such as frontmatter.footer or sections.intro. For an issue in a slide's words, it is the slide or the object in presentation.mdpoint, such as slides.intro.objects.title. An operation names it the same way. An issue about a missing or unreadable file has no path. It names the file as file instead. An issue about something written in a file also has a location: the file, and its line when it's known. An issue in slides.md usually has its line. An invalid-json or merge-conflict issue in presentation.mdpoint has its line when it's known. The Agent's README lists every field. The disposition describes how MarkdownPoint handles the problem: show-presentation, skip-object, refuse-slide, or refuse-presentation. The command exits with status 1 if any issue is an error.

Saving and formatting

Saving preserves the formatting of unchanged frontmatter, slides, and text blocks. Edited parts are written in MarkdownPoint's standard Markdown. Run mdpoint format to reformat both presentation files.