← Writing

Markdown playground

Everything this blog can render — math, diagrams, inline SVG, code. Use it as a cheat sheet.

This post is a reference for writing. Delete it whenever you want.

Text

Regular paragraphs, bold, italic, inline code, links and footnotes1.

Blockquotes look like this.

  • Lists
  • work
    • as expected
ColumnAnotherNumbers
ab1.00
cd42.00

Math

Inline: the Sharpe ratio is S=E[Rp−Rf]σpS = \frac{\mathbb{E}[R_p - R_f]}{\sigma_p}.

Block:

β^=(X⊤X)−1X⊤yf(x)=∫−∞∞f^(ξ) e2πiξx dξ\hat{\beta} = (X^\top X)^{-1} X^\top y \qquad f(x) = \int_{-\infty}^{\infty} \hat{f}(\xi)\, e^{2\pi i \xi x}\, d\xi

Diagrams (Mermaid)

flowchart LR
  A[Market data] --> B{Signal?}
  B -- yes --> C[Size position]
  B -- no --> A
  C --> D[Execute order]
  D --> E[(Journal)]
sequenceDiagram
  participant Bot
  participant Exchange
  Bot->>Exchange: POST /order
  Exchange-->>Bot: 201 filled

Inline SVG

MDX files accept raw SVG. Use currentColor and var(--accent) so it follows light/dark mode:

An inline SVG that follows the theme.

Or a file from public/: ![alt](/images/diagram.svg).

Code

def sharpe(returns, rf=0.0):
    excess = returns - rf
    return excess.mean() / excess.std(ddof=1)
npm run dev   # preview at http://localhost:4321

Footnotes

  1. Footnotes are rendered at the bottom. ↩