Markdown

File Formats

Markdown

Markdown is a lightweight markup language for creating formatted text using a plain-text editor. It is commonly used for documentation, notes, and web content.

Headings

H1 (one #)

H2 (two #)

H3 (three #)

Paragraphs

This is a paragraph of text.
(Separate paragraphs with a blank line.)

Formatted text

Italics (*text* or _text_)
Bold (**text** or __text__)
Bold & Italic (***text***)
Strikethrough (~~text~~)

Lists

  • Unordered list item
  • Another item
    • Nested item
      (Use -, *, or + for bullets.)
  1. Ordered list item
  2. Another item
    1. Nested item
      (Numbers auto‐increment; indent to nest.)

OpenAI
(Syntax: [label](URL "optional title"))

Images

Alt text

(Syntax: ![alt text](URL "optional title"))

Quotes

Prefix lines with > for quotes.

Code block

// Triple backticks + language hint
function greet() {
  console.log("Hello, world!");
}

Inline code: `const x = 42;`
(Code spans use backticks.)

Tables

Column 1Column 2Column 3
CellCellCell

(Syntax: | col | col | with a |---| separator row.)

Horizontal Rule


(Syntax: --- or *** on its own line.)

Task Lists

  • Completed task
  • Incomplete task

(Syntax: - [x] for done, - [ ] for not done.)

Escaping Characters

*Not italic* `Not code`

(Prefix any special character with \ to render it literally.)

OpenAI

(Syntax: [label][id] then define [id]: URL anywhere in the file.)

Linking to Headings

Go to Tables

(Syntax: [label](#heading-in-lowercase-with-hyphens))

Footnotes

Here is a claim that needs a source.1

(Syntax: [^id] inline, then [^id]: to define it.)

Footnotes

  1. This is the footnote text.

File Formats

YAML

YAML is a human-readable data serialization language that is often used for writing configuration files.

YAML

%YAML 1.2 # Version directive (optional)
%TAG ! tag:example.com,2025: # Tag handle shortcut (optional)
--- # Document start marker

1. Scalars

name: John Doe # plain (unquoted) string
age: 30 # integer
active: true # boolean (true/false, yes/no, on/off)
score: 3.14 # float
missing: null # null (~ also works)

single_quoted: "I can't do that" # single-quoted, escape single-quote by doubling
double_quoted: "Line1\nLine2" # double-quoted, supports escape sequences

2. Multiline Scalars

address: | # literal style: preserves newlines
  123 Main St.
  Suite #5
  Cityville

bio: > # folded style: folds newlines into spaces
  YAML is a human-
  friendly data format.

  It supports multiple
  multiline styles.

3. Collections

interests: # sequence (block style)
  - coding
  - hiking
  - cooking

primes: [2, 3, 5, 7, 11] # sequence (flow style)

user: # mapping (block style)
  id: 1001
  username: alice

coords: { x: 10, y: 20 } # mapping (flow style)

4. Nested Structures

servers:
  - name: frontend
    ip: 10.0.0.1
    ports: [80, 443] # inline sequence example
  - name: backend
    ip: 10.0.0.2
    ports:
      - 8080
      - 8443

5. Anchors & Aliases

defaults: &defaults # define anchor
  timeout: 30
  retries: 3

serviceA:
  <<: *defaults # merge in defaults
  endpoint: /api/a

serviceB:
  <<: *defaults
  endpoint: /api/b
  retries: 5 # override one value

6. Tags & Data Types

explicit_string: !!str 123 # force "123" to be a string
explicit_int: !!int "42" # force "42" to be an integer
release_date: !!timestamp 2025-05-23 # timestamp

7. Custom Tags

invoice: !Invoice # application-specific tag
  id: INV-100
  due: 2025-06-01 # interpreted as timestamp by !!timestamp