mq-db 0.1.13

Markdown-specialized embedded database with interval-indexed block storage and hierarchical query support
Documentation
<!--
  Source for docs/assets/ogp.png. Regenerate after edits with:
  "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \
    --headless --disable-gpu --hide-scrollbars --window-size=1200,630 \
    --screenshot=docs/assets/ogp.png assets/ogp.html
-->
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
  href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap"
  rel="stylesheet"
/>
<style>
  :root {
    /* dark ("manuscript by candlelight") palette — matches docs/index.html
       @media (prefers-color-scheme: dark) :root values */
    --c-paper: #1b1714;
    --c-paper-alt: #231e1a;
    --c-paper-deep: #383028;
    --c-ink: #ece4d8;
    --c-ink-dim: #a89c8c;
    --c-accent: #d9714f;
    --c-accent-hover: #e68c6c;
    --c-mark: #d6a84c;
  }
  * { box-sizing: border-box; }
  html, body {
    margin: 0; padding: 0;
    width: 1200px; height: 630px;
    background-color: var(--c-paper);
    font-family: "Inter", sans-serif;
    color: var(--c-ink);
    overflow: hidden;
  }
  /* Social platforms crop og:image to varying aspect ratios (2:1, 1.91:1, and
     square thumbnails on some unfurlers) before display, trimming from every
     edge. Keep all content inside a safe area well clear of the 1200x630
     bounds so nothing load-bearing (logo, headline) gets clipped. */
  .card {
    width: 1200px;
    height: 630px;
    padding: 64px 76px 56px;
    display: flex;
    flex-direction: column;
    position: relative;
  }
  .topbar {
    display: flex;
    align-items: center;
  }
  .brand {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .brand span {
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
    font-size: 26px;
    letter-spacing: -0.02em;
    color: var(--c-ink);
  }
  h1 {
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
    font-size: 56px;
    line-height: 1.1;
    letter-spacing: -0.025em;
    margin: 30px 0 20px;
    max-width: 920px;
  }
  h1 em {
    font-style: normal;
    color: var(--c-accent);
  }
  p.tagline {
    font-family: "Inter", sans-serif;
    font-size: 20px;
    line-height: 1.55;
    color: var(--c-ink-dim);
    max-width: 780px;
    margin: 0 0 28px;
  }
  p.tagline b {
    color: var(--c-ink);
    font-weight: 600;
  }
  .panel {
    border: 1px solid var(--c-paper-deep);
    border-radius: 10px;
    background: var(--c-paper-alt);
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(42,36,32,0.06);
  }
  .panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid var(--c-paper-deep);
  }
  .dots { display: flex; gap: 7px; }
  .dots span {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--c-ink-dim); opacity: 0.35;
  }
  .panel-head .label {
    font-family: "Inter", sans-serif;
    font-size: 13px;
    color: var(--c-ink-dim);
  }
  .panel-head .tag {
    font-family: "JetBrains Mono", monospace;
    font-size: 13px;
    color: var(--c-mark);
  }
  pre {
    margin: 0;
    padding: 20px 24px 22px;
    font-family: "JetBrains Mono", monospace;
    font-size: 15px;
    line-height: 1.62;
    white-space: pre;
  }
  .kw { color: var(--c-accent); }
  .str { color: var(--c-mark); }
  .cm { color: var(--c-ink-dim); font-style: italic; }
</style>
</head>
<body>
  <div class="card">
    <div class="topbar">
      <div class="brand">
        <svg width="34" height="34" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
          <ellipse cx="50" cy="78" rx="32" ry="12" fill="#B3402C"/>
          <rect x="18" y="28" width="64" height="50" fill="#B3402C"/>
          <ellipse cx="50" cy="28" rx="32" ry="12" fill="#B3402C"/>
          <path d="M30 66 L30 46 L40 58 L50 46 L60 58 L70 46 L70 66" fill="none" stroke="#FAF6EF" stroke-width="7" stroke-linecap="round" stroke-linejoin="round"/>
        </svg>
        <span>mq-db</span>
      </div>
    </div>

    <h1>Your Markdown is<br />already <em>a database.</em></h1>

    <p class="tagline">
      Interval-indexed block storage for Markdown — query it with <b>SQL</b> or <b>mq</b>,
      persist it to a compact page-file format. No SQLite dependency.
    </p>

    <div class="panel">
      <div class="panel-head">
        <div class="dots"><span></span><span></span><span></span></div>
        <div class="label">sql&gt; every block nested under a heading, in one comparison</div>
        <div class="tag">under()</div>
      </div>
      <pre><span class="cm">-- all blocks nested under the "Architecture" heading</span>
<span class="kw">SELECT</span> block_type, content <span class="kw">FROM</span> blocks
<span class="kw">WHERE</span> under(pre, post, arch.pre, arch.post)
<span class="kw">ORDER BY</span> pre;</pre>
    </div>
  </div>
</body>
</html>