AI Learning Dashboard — Master Document

The complete reference for your Markdown engine, rendered live. This single document consolidates the engine showcase, the CSS class cheat sheet, the user guide, the capability report, and the chart gallery. Served at / by dashboard_server.py, styled by style.css, on port 8031.

What this engine is — a live, self-contained Markdown preview server with math, diagrams, charts, Python widgets, cross-references, and hot reload.

How to read this — five chapters, top to bottom. Use the Master Contents to jump, or the per-chapter jump tables that open each section.

Master Contents

Chapter Contents
Engine Showcase → AI Learning Dashboard — Master Document Every feature, rendered live with copy-paste syntax
CSS Class Cheat Sheet → CSS Class Cheat Sheet Every class with examples
Dashboard User Guide → Dashboard User Guide Step-by-step usage of each capability
Capability & Architecture Report → Capability & Architecture Report Pipeline, diagrams, math patterns
Chart & Diagram Gallery → Chart & Diagram Gallery Reference charts and flowcharts
Engine Showcase
Jump to Jump to
Section 1 Document library Section 11 Mermaid diagrams
Section 2 Running the server Section 12 Chart.js
Section 3 Typography & headings Section 13 SVG diagrams
Section 4 Colors & badges Section 15 Cross-references
Section 5 Cards & columns Section 16 Checkboxes & copy
Section 6 Tables Section 17 Footnotes, lists, more
Section 7 Images & figures Section 14 Code highlighting
Section 8 Video Section 18 Inline elements & disclosure
Section 9 Math (KaTeX) Section 19 Python widgets
Section 10 Math utility classes Section 20 Export & editor
Section 11 Mermaid diagrams Section 21 Server routes
Section 12 Chart.js Section 22 Full class index
Auto-generated table of contents — the [TOC] capability

Library

Document Library

Every Markdown file in the project, styled with the dashboard. Click to open.

Widget not found: file_index

Tip — the list above is generated live by the file_index widget. /files is the built-in equivalent page.


Run

Running the Server

# from the project root
python dashboard_server.py
# then open http://localhost:8031/

Live status —

Widget not found: project_status

Server clock —

Local time
03:06:36
Saturday, 26 September 2026
synced from /api/clock every second
Setting Value
Host / port 0.0.0.0 : 8031
Home page index.md, else ai_notes.md
Stylesheet style.css (hot-reloaded)
Widgets folder widgets/*.py
Poll interval 200 ms (content + CSS), 1 s (clock)
Table 2.1: Running the Server

Hot reload — edit any .md, style.css, or widget and the browser updates with no manual refresh. Scroll position is preserved.


Typography

Typography & Headings

Headings # … ###### are styled globally — no class needed:

Tag Size Weight
h1 2.7rem 700
h2 2.3rem 700
h3 1.8rem 700
h4–h6 1.5 → 1.1rem 700
Table 3.1: Typography & Headings

Lightweight title classes (decorative, not in the TOC):

title-thin — airy section divider
title-light — soft heading
title-colored — accent heading

Lightweight heading blocks .b1 / .b2 / .b3:

b1 — 1.6rem, weight 200
b2 — 1.25rem, weight 300
b3 — 1rem, weight 300, muted

Inline weight words: thin · light · regular · medium · semibold · bold

Numeric weights: 100 200 300 400 500 600 700 800 900

<div class="title-thin">Section divider</div>
<div class="b1">Lightweight title</div>
<span class="semibold">semibold</span>   <span class="fw-700">700</span>

Color

Colors, Backgrounds & Badges

Text colors: black · dark · body · muted · soft · blue · green · red · yellow · orange · purple · pink

Soft background fills: bg-soft bg-blue-soft bg-green-soft bg-yellow-soft bg-red-soft bg-purple-soft

Badges: blue green yellow red purple gray

<span class="text-blue">blue</span>
<span class="bg-yellow-soft">highlight</span>
<span class="badge badge-green">done</span>

Cards & Layout

Note Cards & Columns

Default — neutral aside.
note-blue — tips, info, see-also.
note-green — success, completed steps.
note-yellow — warnings, caveats.
note-red — errors, critical notes.

Two columns (.col-2):

One — equal width.

Two — stacks on mobile.

Three columns (.col-3):

A

B

C

Four columns (.col-4):

1

2

3

4

<div class="note-card note-blue">Tip…</div>

<div class="col-3">
  <div class="col-card" markdown="1">**A**</div>
  <div class="col-card" markdown="1">**B**</div>
  <div class="col-card" markdown="1">**C**</div>
</div>

Tables

Tables

Wrap a table in a <div … markdown="1"> to constrain its width or tighten padding.

.table-mid .table-compact:

Model Params Year
Linear regression 2 1805
MLP thousands 1986
Transformer billions 2017
Table 6.1: .table-mid .table-compact

.table-narrow:

Key Value
lr 0.001
epochs 50
Table 6.2: .table-narrow
Class Effect
.table-narrow max-width 480px
.table-mid max-width 720px
.table-compact tight padding (combine with a width)
Table 6.3: .table-narrow

Alignment uses standard Markdown: |---|, |:--|, |:-:|, |--:|.


Images

Images & Figures

Files live in images/, served at /images/.... Supported: png, jpg, gif, webp, svg, ico.

Sizes (.img-xs … .img-full) — same image, inline:

xs

Figure 7.1: Images & Figures

sm

Figure 7.2: Images & Figures

Styles — rounded + border + shadow, centered:

styled

Figure 7.3: Images & Figures

Float — .img-left lets text wrap to the right (add <div style="clear:both"> after):

float

Figure 7.4: Images & Figures

This paragraph flows around the floated image. Use .img-left or .img-right to wrap body text beside a figure, and .img-inline when you want the image to sit in the text baseline without floating. Clear the float afterwards so the next block starts on its own line.

Figure widths — .fig-narrow / .fig-mid / .fig-wide wrap a captioned image (see Section 15).

Group Classes
Size .img-xs .img-sm .img-md .img-lg .img-xl .img-full
Align .img-left .img-center .img-right .img-inline
Style .img-rounded .img-border .img-shadow
Figure .fig-narrow .fig-mid .fig-wide
Table 7.1: Images & Figures
<img src="/images/logo.svg" class="img-md img-center img-rounded img-shadow">

Video

Video

Drop files in videos/ — served at /videos/... with HTTP range support, so scrubbing and seeking work. Width classes mirror the figure classes.

<video src="/videos/clip.mp4" class="video-mid" controls></video>
Class Max-width
.video-narrow narrow
.video-mid medium
.video-wide wide
.video-full 100%
Table 8.1: Video

Formats: mp4, webm, ogg, mov, mkv.


Math

Math — KaTeX

Identity $e^{i\pi} + 1 = 0$ — math renders inside headings too

Inline flows in text: the sigmoid is $\sigma(z) = \frac{1}{1+e^{-z}}$ and its derivative is $\sigma'(z) = \sigma(z)(1-\sigma(z))$.

Display:

$$ \mathcal{L} = -\frac{1}{N}\sum_{i=1}^{N}\Big[ y_i \log \hat{y}_i + (1-y_i)\log(1-\hat{y}_i) \Big] \tag{9.1} $$
Equation 9.1: Display

Standalone block — a line containing only $ opens/closes a display block:

$$ \nabla_\theta J = \frac{1}{m} X^\top (X\theta - y) \tag{9.2} $$
Equation 9.2: Display

Auto-numbered equation caption — each aligned row is tagged and linkable (see Equation 9.3 and the individual row Equation 9.3.2):

$$ \begin{align} \theta_{t+1} &= \theta_t - \eta\,\nabla J(\theta_t) \tag{9.3.1} \\ J(\theta) &= \frac{1}{2m}\sum_{i=1}^{m}\big(h_\theta(x_i) - y_i\big)^2 \tag{9.3.2} \end{align} $$
Equation 9.3: Gradient descent

KaTeX gallery — matrices, cases, sums, products, integrals, accents, colors:

$$ A = \begin{bmatrix} a_{11} & a_{12} \\ a_{21} & a_{22} \end{bmatrix} \qquad \begin{vmatrix} a & b \\ c & d \end{vmatrix} = ad - bc \tag{9.4} $$
Equation 9.4: Display
$$ f(n) = \begin{cases} n/2 & \text{if } n \text{ even} \\ 3n+1 & \text{if } n \text{ odd} \end{cases} \qquad \binom{n}{k} = \frac{n!}{k!\,(n-k)!} \tag{9.5} $$
Equation 9.5: Display
$$ \sum_{i=1}^{n} i = \frac{n(n+1)}{2}, \quad \prod_{i=1}^{n} i = n!, \quad \int_{-\infty}^{\infty} e^{-x^2}\,dx = \sqrt{\pi} \tag{9.6} $$
Equation 9.6: Display
$$ \hat{y} = \alpha\,\vec{x} \cdot \vec{w} + \textcolor{#2563EB}{b}, \qquad \lim_{x \to 0}\frac{\sin x}{x} = 1, \qquad \nabla \cdot \mathbf{E} = \frac{\rho}{\varepsilon_0} \tag{9.7} $$
Equation 9.7: Display
Inline: $E = mc^2$
Display: $$ \sigma(z)=\frac{1}{1+e^{-z}} $$
Standalone block: a line of just  $  ...  $  becomes $$ ... $$
Matrix:  $$ \begin{bmatrix} a & b \\ c & d \end{bmatrix} $$
Cases:   $$ \begin{cases} 1 & x>0 \\ 0 & x\le 0 \end{cases} $$

Math classes

Math Utility Classes

When KaTeX can't run (Mermaid labels, SVG text, table cells), style math by hand. .math-text = italic variables, .math-op = upright operators/words:

The model y = wx + b, where sin and log stay upright.

Class Purpose Scope
.math-text italic variables anywhere
.math-op upright operators/words anywhere
.m-math .m-op .m-num variables / operators / numbers inside .mermaid
.m-sf .m-sf-bold sans-serif text in diagrams inside .mermaid
.m-sub .m-sup subscript / superscript inside .mermaid
.m-hat x̂ accent — lowercase-only approximation; prefer $$\hat{x}$$ inside .mermaid
.m-label .m-small .m-large label sizing inside .mermaid
Table 10.1: Math Utility Classes

The m-* classes typeset math inside Mermaid HTML labels:

flowchart LR X["xi"] --> F["f(x)"] F --> Y["$$\hat{y}$$"] %% -- dashboard status styles -- classDef ok fill:#DCFCE7,stroke:#16A34A,stroke-width:1.5px,color:#052E16; classDef warn fill:#FEF9C3,stroke:#CA8A04,stroke-width:1.5px,color:#422006; classDef err fill:#FCE7EF,stroke:#DB2777,stroke-width:1.5px,color:#500724; classDef crit fill:#FEE2E2,stroke:#DC2626,stroke-width:1.5px,color:#450A0A; classDef off fill:#F1F5F9,stroke:#94A3B8,stroke-width:1.5px,color:#111827; classDef info fill:#EFF6FF,stroke:#3B82F6,stroke-width:1.5px,color:#0C1E3E;
Figure 10.1: Flowchart — Math Utility Classes
The variable <span class="math-text">x</span> with <span class="math-op">max</span>.

Diagrams

Mermaid Diagrams

Flowchart:

flowchart LR A[Raw data] --> B[Features] B --> C{Train / test?} C -->|train| D[Fit model] C -->|test| E[Evaluate] D --> E E --> F[Deploy] %% -- dashboard status styles -- classDef ok fill:#DCFCE7,stroke:#16A34A,stroke-width:1.5px,color:#052E16; classDef warn fill:#FEF9C3,stroke:#CA8A04,stroke-width:1.5px,color:#422006; classDef err fill:#FCE7EF,stroke:#DB2777,stroke-width:1.5px,color:#500724; classDef crit fill:#FEE2E2,stroke:#DC2626,stroke-width:1.5px,color:#450A0A; classDef off fill:#F1F5F9,stroke:#94A3B8,stroke-width:1.5px,color:#111827; classDef info fill:#EFF6FF,stroke:#3B82F6,stroke-width:1.5px,color:#0C1E3E;
Figure 11.1: Flowchart

Sequence diagram (mirrors this engine's live-reload loop):

sequenceDiagram participant B as Browser participant S as dashboard_server loop every 200 ms B->>S: GET ?timestamp=1 S-->>B: { mtime } end Note over B,S: only if changed B->>S: GET ?partial=1 S-->>B: fresh HTML
Figure 11.2: Sequence diagram — Flowchart

State diagram:

stateDiagram-v2 [*] --> Idle Idle --> Editing: open file Editing --> Saved: write Saved --> Editing: edit again Saved --> [*]
Figure 11.3: State diagram

Class diagram:

classDiagram class Widget { +str name +render(context, argument) str } class Server { +int PORT +render_markdown_to_html() } Server --> Widget : loads
Figure 11.4: Class diagram

Entity relationship:

erDiagram PROJECT ||--o{ MARKDOWN : contains MARKDOWN ||--o{ WIDGET : embeds MARKDOWN ||--o{ CAPTION : defines
Figure 11.5: ER diagram — Entity relationship

Pie chart:

pie showData title Time per feature "Math" : 25 "Diagrams" : 20 "Widgets" : 30 "Styling" : 25
Figure 11.6: Pie chart

Gantt:

gantt title Build plan dateFormat YYYY-MM-DD section Engine Server :done, s1, 2026-06-01, 5d Widgets :active, s2, 2026-06-06, 4d Showcase : s3, after s2, 3d
Figure 11.7: Gantt

User journey:

Read this as a satisfaction map, not a flowchart. Time runs left → right through two phases (Warm up, Deep work); the only data is the height of each face — the better that step felt, the higher it sits (5 = great, 1 = rough). So Open dashboard and Check answers (5) ride high, while Skim notes (3) dips.

journey title A study session section Warm up Open dashboard: 5: Me Skim notes: 3: Me section Deep work Solve problems: 4: Me Check answers: 5: Me
Figure 11.8: User-journey map — A study session

Git graph:

gitGraph commit id: "init" branch feature commit id: "widgets" commit id: "showcase" checkout main merge feature commit id: "release"
Figure 11.9: Diagram — Git graph

Mindmap:

mindmap root((Engine)) Render Markdown Math Mermaid Live Reload Checkboxes Widgets clock sine_graph
Figure 11.10: Mindmap

Quadrant chart:

quadrantChart title Effort vs impact x-axis Low effort --> High effort y-axis Low impact --> High impact quadrant-1 Do now quadrant-2 Plan quadrant-3 Skip quadrant-4 Quick wins Widgets: [0.3, 0.8] Theming: [0.6, 0.4] Docs: [0.2, 0.5]
Figure 11.11: Diagram — Quadrant chart
```​mermaid
flowchart LR
  A[Raw data] --> B[Features]
```

Charts

Chart.js

Live, interactive charts with custom hover tooltips. Bar:

Figure 12.1: Chart.js

Line:

Figure 12.2: Line

Doughnut, radar & scatter in a three-column grid:

Figure 12.3: Line
Figure 12.4: Line
Figure 12.5: Line

Polar area, bubble & stacked bar:

Figure 12.6: Polar area, bubble & stacked bar
Figure 12.7: Polar area, bubble & stacked bar
Figure 12.8: Polar area, bubble & stacked bar
<div id="my-chart"></div>
<script type="application/json" class="chartjs-config" data-target="my-chart">
{ "type": "line", "data": { "labels": ["A","B"], "datasets": [{ "data": [1,2] }] } }
</script>

SVG

SVG Diagrams & Charts

Widgets can emit inline SVG. Mark a shape .svg-chart-hover-item (plus .svg-chart-bar or .svg-chart-point) and add data-tooltip-title / data-tooltip-body — the engine wires up a floating tooltip automatically.

Hover the bars above — the tooltip is provided by the engine, not the SVG.


Code

Code Highlighting

Pygments highlights many languages; every block gets a Copy button. The language tag after the opening fence selects the lexer.

from dataclasses import dataclass

@dataclass
class Neuron:
    weights: list[float]
    bias: float = 0.0

    def activate(self, xs: list[float]) -> float:
        z = sum(w * x for w, x in zip(self.weights, xs)) + self.bias
        return max(0.0, z)  # ReLU
const poll = async (url) => {
  const res = await fetch(url, { cache: "no-store" });
  return res.json();          // live-reload heartbeat
};
python dashboard_server.py        # start
curl -s localhost:8031/api/clock  # JSON time
SELECT model, AVG(loss) AS mean_loss
FROM   runs
WHERE  epoch > 10
GROUP  BY model
ORDER  BY mean_loss ASC;
{ "type": "bar", "data": { "labels": ["a", "b"], "datasets": [{ "data": [1, 2] }] } }

Nested fences — code inside a list item or blockquote (via superfences):

  1. First, define the function:

    def square(x):
        return x * x
  2. Then call it.

Tip — fenced code works inside blockquotes too:

http://localhost:8031/

References

Cross-references, Captions & Anchors

The engine indexes labels across every file. Reference with @-prefixed ids; unknown ids are flagged red so you catch typos.

Prefix Target Defined by
@sec-id section heading ## Title {#sec-id}
@fig-id figure :::caption type="figure" id="fig-id"
@tab-id table :::caption type="table" id="tab-id"
@eq-id equation :::caption type="equation" id="eq-id"
@par-id sentence <span id="par-id" class="sentence-anchor">text</span>
Table 15.1: Cross-references, Captions & Anchors

A captioned figure (wrapped in .fig-narrow):

A captioned table:

Name Range
sigmoid (0, 1)
tanh (−1, 1)
ReLU [0, ∞)
Table 15.2: Common activation functions

Live, clickable references (click to flash the target): figure Figure 15.1 · table Table 15.2 · equation Equation 9.3 · row Equation 9.3.2 · section Section 19.

Cross-file reference — the index spans the whole project; this one resolves into classes.md and opens in a new tab: @sec-typography.

Sentence anchor — deep-link an exact line: this sentence is addressable as .

Broken reference is flagged so you notice: @fig-typo-here

:::​caption type="figure" id="fig-logo" title="..."
<img src="/images/x.png" class="img-full">
:::

Reference it: @fig-logo   ·   Anchor a line: [text]{#par-key}

Interactive

Checkboxes & Copy Buttons

Task checkboxes are persistent — ticking one writes back to index.md on disk, and the progress widget updates instantly:

Widget not found: task_progress

Every code block has an automatic Copy button in its corner:

def relu(x):
    return max(0.0, x)

Markdown+

Footnotes, Lists & More

Footnotes render at the bottom with a back-link.1 Abbreviations show on hover: KaTeX, ML, DPR. Strikethrough: deprecated. Subscript: H2O.

Definition list:

Backprop
Reverse-mode automatic differentiation through the network.
Epoch
One full pass over the training set.

Ordered + nested list:

  1. Preprocess
  2. Clean
  3. Normalize
  4. Train
  5. forward pass
  6. backward pass
  7. Evaluate

Blockquote with inline code and a link to classes.md:

The best way to learn the engine is to read its output side by side with its source. Everything on this page is plain Markdown plus a few HTML wrappers.

A claim.[^1]      ~~struck~~      H~2~O      `inline code`
*[ML]: Machine Learning
[^1]: The footnote text.

Inline & disclosure

Inline Elements & Disclosure

Keyboard keys with <kbd>: press ⌘ + S to save, Esc to cancel.

Highlight with <mark>: the engine supports highlighted text inline.

Insertions / deletions: added and removed render with semantic color.

Attribute lists — attach a class to inline emphasis or code: styled emphasis · styled code · bold accent.

Collapsible sections with <details>:

What does live reload actually poll?

It calls ?timestamp=1 every 200 ms; if the file's mtime changed it fetches ?partial=1 and swaps the content in place — preserving scroll position.

Show a hidden code snippet
print("revealed on demand")
Press <kbd>⌘</kbd> + <kbd>S</kbd>.   <mark>highlight</mark>.   <ins>add</ins> <del>cut</del>.
*emphasis*{.text-blue}

<details markdown="1">
<summary>Click to expand</summary>
Hidden **markdown** content.
</details>

Widgets

Python Widgets

Placeholders run a file in widgets/ and inject its HTML. All five bundled widgets, live:

clock — refreshed every second by the server:

Local time
03:06:36
Saturday, 26 September 2026
synced from /api/clock every second

project_status — pass a status string:

Widget not found: project_status

task_progress — counts the checkboxes in this file (see Section 16).

file_index — the live file grid (see Section 1).

sine_graph — an interactive plot; drag the sliders:

Widget not found: sine_graph

Syntax:

{​{ clock }}                 run widgets/clock.py
{​{ project_status: text }}  pass an argument string
{​{ file_index: folder }}    restrict to a subfolder

Add your own — drop a file in widgets/:

# widgets/hello.py
def render(context=None, argument=None):
    label = argument or "world"
    return f"<div class='py-widget'>Hello, {label}!</div>"

The context dict provides:

Key Value
project_root Path to the project root
current_md_file the file being rendered
current_url its /md/... URL
list_markdown_files helper → all .md paths
md_url_for_file helper → URL for a file
safe_project_path helper → sandbox-checked path
Table 19.1: Syntax

Export

Export & Editor Integration

Action How
Export this page to standalone HTML /export
Export any file open …/md/File.md?export=1
Open a file in VS Code /open-file?path=index.md
Table 20.1: Export & Editor Integration

Exported HTML inlines the CSS and drops the live-reload script, so it is fully self-contained and portable.


Routes

Server Routes

Method Route Purpose
GET / · /dashboard Home page (index.md)
GET /files Auto index of every .md file
GET /md/<path>.md Render a Markdown file
GET /md/<path>.md?partial=1 Content-only HTML (live reload)
GET /md/<path>.md?timestamp=1 JSON mtime (live-reload poll)
GET /md/<path>.md?export=1 Write standalone …_output.html
POST /md/<path>.md?toggle-checkbox=1 Persist a checkbox toggle
GET /css Current stylesheet (hot-reload source)
GET /images/<file> Serve an image
GET /videos/<file> Serve a video (range/seek aware)
GET /fonts/<name> Serve a system .otf / .ttf
GET /api/clock JSON {time, date, iso}
GET /export Export the home page to HTML
GET /open-file?path=… Open a project file in VS Code
GET /vendor/mermaid.min.js Locally vendored Mermaid
GET /vendor/mathjax/tex-svg.js Locally vendored MathJax
Table 21.1: Server Routes

Path safety — every file route is sandboxed to the project root. ../ escapes and ignored folders (.venv, node_modules, __pycache__, .git, caches) are rejected.


Class index

Full CSS Class Index

Every class in style.css, grouped. For styled, copy-paste examples open classes.md.

Typography .title-thin .title-light .title-colored · .b1 .b2 .b3 · .thin .light .regular .medium .semibold .bold · .fw-100….fw-900

Color & background .text-black/dark/body/muted/soft · .text-blue/green/red/yellow/orange/purple/pink · .bg-soft .bg-blue/green/yellow/red/purple-soft

Badges & cards .badge + .badge-blue/green/yellow/red/purple/gray · .note-card + .note-blue/green/yellow/red

Layout .col-2 .col-3 .col-4 .col-card · .md-file-grid .md-file-card

Images, figures, video & tables .img-xs…xl .img-full · .img-left/center/right/inline · .img-rounded/border/shadow · .fig-narrow/mid/wide · .video-narrow/mid/wide/full · .table-narrow/mid/compact

Math .math-text .math-op · .m-math/op/num/sf/sf-bold/sub/sup/hat/label/small/large (inside .mermaid)

Cross-refs & captions (auto) .caption-box .caption-content .caption-title .caption-label .caption-equation · .cross-ref .cross-ref-external .cross-ref-passage .missing-ref .sentence-anchor .xref-flash

Widgets (auto / structural) .py-widget .widget-label .widget-source .widget-error · .clock-widget .status-widget .task-progress-widget .file-index-list .sine-widget · .formula-box .slider-grid · .svg-diagram .svg-chart-bar .svg-chart-point · .code-block-wrapper .copy-code-button

Powered by dashboard_server.py + style.css · port 8031 · classes.md · /files

CSS Class Cheat Sheet

Open this file whenever you need to know what to write. Every class has syntax + a live example.

Jump to
Section 1 Headings · lightweight titles · font weights
Section 2 Text colors · background fills
Section 3 Note cards
Section 4 Image sizes · alignment · style
Section 5 Table width · compact padding · figure sizing
Section 6 Math variable/operator classes
Section 7 Cross-references · sentence anchors · captions
Section 8 Ready-to-copy combinations

Typography

Typography

Headings

Written with # — ######. Styled globally, no class needed.

Tag Size Weight
h1 2.7rem 700
h2 2.3rem 700
h3 1.8rem 700
h4 1.5rem 700
h5 1.2rem 700
h6 1.1rem 700
Table 1.1: Headings

Lightweight Title Classes

Thinner, lighter than bold headings. Great for section openers and sub-labels.

Syntax: <div class="b1">text</div>

Class Size Weight Color
.b1 1.6rem 200 inherited
.b2 1.25rem 300 inherited
.b3 1rem 300 #555555 muted
.title-thin 1.6rem 200 #111827 dark
.title-light 1.35rem 300 #111827 dark
.title-colored 1.35rem 300 #2563EB blue
Table 1.2: Lightweight Title Classes
b1 — ultra-light title
b2 — light subtitle
b3 — small muted label
title-thin — thin dark
title-light — light dark
title-colored — light blue

To customize — style.css sections 16 and 20.


Font Weight Utilities

Syntax: <span class="fw-300">text</span> or named alias <span class="light">text</span>

fw-100 Ultralight · fw-200 Thin · alias: thin · fw-300 Light · alias: light · fw-400 Regular · alias: regular · fw-500 Medium · alias: medium · fw-600 Semibold · alias: semibold · fw-700 Bold · alias: bold · fw-800 Heavy · fw-900 Black

Color

Colors

Text Colors

Syntax: <span class="text-blue">text</span>

text-black #000000 · text-dark #111827 · text-muted #64748B · text-soft #94A3B8
text-red #DC2626 · text-orange #EA580C · text-yellow #CA8A04 · text-green #16A34A · text-blue #2563EB · text-purple #7C3AED · text-pink #DB2777

To add a color — one line in style.css section 18: .text-teal { color: #0D9488 !important; }


Background Colors

Fills only — no padding or radius. Add inline style for those.

Syntax: <div class="bg-blue-soft" style="padding:8px 12px;border-radius:8px">text</div>

bg-soft
bg-blue-soft
bg-green-soft
bg-yellow-soft
bg-red-soft
bg-purple-soft

To add a background — one line in style.css section 19: .bg-teal-soft { background: #F0FDFA !important; }


Components

Note Cards

.note-card is the base. Add a color modifier for a left border + tinted background.

Syntax:

<div class="note-card note-blue">
Content — **bold** and *italic* work inside.
</div>

Class Border color Background
.note-card #E5E7EB #F8FAFC
.note-blue #2563EB #EFF6FF
.note-green #16A34A #F0FDF4
.note-yellow #CA8A04 #FEFCE8
.note-red #DC2626 #FEF2F2
Table 3.1: Syntax
Default — neutral. General asides.
note-blue — tips, info, see-also
note-green — success, completed steps
note-yellow — warnings, caveats
note-red — errors, critical notes

To add a color — style.css section 21: .note-purple { border-left: 4px solid #7C3AED; background: #F5F3FF; }


Images

Images

Drop files into images/ — served at /images/filename. Supported: jpg, png, gif, webp, svg.

Syntax: <img src="/images/file.png" alt="..." class="img-lg img-center img-rounded img-shadow">

Size classes

Class Max-width Use for
.img-xs 200px Thumbnails, icons
.img-sm 350px Small illustrations
.img-md 550px Standard figures
.img-lg 800px Wide diagrams
.img-xl 1100px Full-page figures
.img-full 100% Responsive / edge-to-edge
Table 4.1: Size classes

Alignment classes

Class Effect
.img-center Block + auto margin
.img-left Float left — text wraps right
.img-right Float right — text wraps left
.img-inline Inline-block, no float
Table 4.2: Alignment classes

After a floated image, add <div style="clear:both"></div>.

Style classes

Class Effect
.img-rounded border-radius 12px
.img-shadow Soft drop shadow
.img-border 1px solid #E5E7EB
Table 4.3: Style classes

Captioned figure

<div id="fig-cls-photo" class="caption-box caption-figure" markdown="1">
<div class="caption-content" markdown="1">
<img src="/images/photo.png" alt="photo" class="img-lg img-center img-rounded img-shadow">
</div>
<div class="caption-title"><span class="caption-label">Figure</span>: Caption text</div>
</div>

Then reference anywhere with @fig-cls-photo.

Live example — see Section 7 in Part I.


Tables & Figures

Tables & Figure Sizing

Table width

Wrap in a div — always add markdown="1" so the markdown parser processes the table inside.

<div class="table-narrow" markdown="1">

| Col | Col |
|---|---|
| ... | ... |

</div>
Class Max-width
.table-narrow 480px
.table-mid 720px
.table-compact Tight padding only — combine with a width class
Table 5.1: Table width

Caption-box width

Wrap the :::caption block in a div — also needs markdown="1".

<div class="fig-mid" markdown="1">

<div id="fig-cls-x" class="caption-box caption-figure" markdown="1">
<div class="caption-content" markdown="1">
<img src="/images/photo.png" class="img-full img-rounded">
</div>
<div class="caption-title"><span class="caption-label">Figure</span>: ...</div>
</div>

</div>
Class Max-width
.fig-narrow 480px
.fig-mid 700px
.fig-wide 1000px
Table 5.2: Caption-box width

Math & Diagrams

Math Utility Classes

Use when KaTeX isn't available — inside Mermaid labels, SVG text, or plain HTML.

Class Font Style Use for
.math-text KaTeX_Math italic Variables: x, W, θ
.math-op KaTeX_Main normal Operators: softmax, argmax
Table 6.1: Math Utility Classes

Syntax: <span class="math-text">x</span> · <span class="math-op">softmax</span>

f(x) = softmax(Wx + b)

In Mermaid nodes:

A["<span class='math-text'>W</span>₁"]


Cross-References & Anchors

Cross-References & Anchors

Writing a reference target

Target type Syntax
Section heading ## Heading {#sec-cls-my-id}
Figure / table / equation :::caption type="figure" id="fig-cls-my-id" title="..."
Sentence [Sentence text.]{#par-cls-my-id \| link label}
Table 7.1: Writing a reference target

Linking to a reference

Write @ref-id anywhere in any .md file. Same-file links scroll and highlight. Cross-file links open in a new tab with ↗.

Prefix Points to CSS class
@sec-cls- Section heading .cross-ref-section
@fig-cls- Figure caption .cross-ref-figure
@tab-cls- Table caption .cross-ref-table
@eq-cls- Equation caption .cross-ref-equation
@par-cls- Sentence anchor .cross-ref-passage
Table 7.2: Linking to a reference

Unknown refs show as a red badge. Cross-file refs get .cross-ref-external.

Sentence anchors

Make any sentence linkable — not just headings.

[The sentence to anchor.]{#par-cls-my-id | link label}

Live demo — this sentence is anchored and can be referenced from any file.

Reference it: anchor demo


Ready-to-Copy Patterns

Combinations

Section opener

<div class="b1">Topic Name</div>
<div class="b3 text-muted">Subtopic · Chapter N</div>
Topic Name
Subtopic · Chapter N

Highlighted inline term

The <span class="text-blue bold">learning rate</span> $\eta$ controls step size.
The learning rate $\eta$ controls step size.


Color-tinted badge

<span class="bg-yellow-soft text-dark" style="padding:2px 8px;border-radius:6px">Warning</span>
Warning


Note card with a sentence anchor

<div class="note-card note-blue">
<strong>Key idea</strong> — [sentence to anchor.]{#par-cls-my-id | link label}
</div>
Key idea — the gradient points toward steepest ascent, so we step in the opposite direction.

Reference it: gradient direction


Narrow table

<div class="table-narrow" markdown="1">

| A | B |
|---|---|
| ... | ... |

</div>

Constrained captioned figure

<div class="fig-mid" markdown="1">

<div id="fig-cls-x" class="caption-box caption-figure" markdown="1">
<div class="caption-content" markdown="1">
<img src="/images/photo.png" class="img-full img-rounded img-shadow">
</div>
<div class="caption-title"><span class="caption-label">Figure</span>: Caption</div>
</div>

</div>

Adding a New Class

  1. Open style.css
  2. Find the right section — colors → 18, cards → 21, images → 27
  3. Add your rule with literal values — no var()
  4. Update the spec-line comment at the top of that section
  5. Add a live example here or in showcase.md

No build step. Refresh the browser.


Dashboard User Guide

Complete reference for every dashboard feature — server setup, syntax, live examples, and copy-paste code.


Contents

Getting Started 1. Server & Routes

Typography & Text 2. Headings 3. Lightweight Titles 4. Body Text & Blockquotes 5. Font Weights

Color 6. Text Colors 7. Background Colors

Components 8. Note Cards 9. Code Blocks 10. Badges & Pills

Tables 11. Tables

Images & SVG 12. Images & SVG

Widgets 13. Widgets


Getting Started

1. Server & Routes

# start from the project root
python dashboard_server.py
# → http://localhost:8030

The server auto-reloads style.css on every request. Changes to dashboard_server.py require a restart.

Route Method Returns Notes
/ GET HTML index page Card grid of all .md files
/md/file.md GET Full HTML page Rendered Markdown with live reload
/md/file.md?partial=1 GET HTML fragment Used internally by live-reload JS
/md/file.md?timestamp=1 GET JSON {timestamp} Used internally to detect file changes
/md/file.md?export GET Plain text Writes file_output.html to project root
/md/file.md?toggle-checkbox=1 POST JSON {success} Writes checkbox state back to .md file
/css GET CSS text Serves style.css with no-cache header
/api/clock GET JSON {time, date, iso} Live clock from Python datetime.now()
/images/name.ext GET Image bytes Serves from images/ subfolder
/fonts/SF-Pro-Display-Bold.otf GET Font bytes Serves .otf/.ttf from /Library/Fonts/
/open-file?path=file.py GET Plain text Opens file in VS Code
/export GET Plain text Exports the default .md file
Table 1.1: Complete HTTP route reference

Typography & Text

2. Headings

H1 — 2.7rem · weight 700

H2 — 2.3rem · weight 700

H3 — 1.8rem · weight 700

H4 — 1.5rem · weight 700

H5 — 1.2rem · weight 700
H6 — 1.1rem · weight 700
# H1 heading
## H2 heading
### H3 heading
#### H4 heading
##### H5 heading
###### H6 heading

3. Lightweight Titles

Use instead of # headings for thinner, lighter labels.

b1 — 1.6rem · weight 200
b2 — 1.25rem · weight 300
b3 — 1rem · weight 300 · muted
title-thin — 1.6rem · weight 200 · dark
title-light — 1.35rem · weight 300 · dark
title-colored — 1.35rem · weight 300 · blue
<div class="b1">b1 — 1.6rem · weight 200</div>
<div class="b2">b2 — 1.25rem · weight 300</div>
<div class="b3">b3 — 1rem · weight 300 · muted</div>
<div class="title-thin">title-thin — 1.6rem · weight 200 · dark</div>
<div class="title-light">title-light — 1.35rem · weight 300 · dark</div>
<div class="title-colored">title-colored — 1.35rem · weight 300 · blue</div>

4. Body Text, Links & Blockquotes

Body text is SF Pro Display · 21px · weight 400 · line-height 1.4. Here is a hyperlink — blue #2563EB. Bold, italic, bold italic.

Blockquote — italic · color #845454 · left border #969595

Multiple paragraphs supported.

Body text is **bold**, *italic*, ***bold italic***, and [links](#anchor).

> Blockquote paragraph one.
>
> Paragraph two — multiple paragraphs supported.

5. Font Weights

Nine weights from ultralight to black — numeric classes .fw-100–.fw-900 or named aliases.

fw-100 Ultralight · fw-200 Thin · fw-300 Light · fw-400 Regular · fw-500 Medium · fw-600 Semibold · fw-700 Bold · fw-800 Heavy · fw-900 Black

<span class="fw-300">Light text</span>
<span class="fw-600">Semibold text</span>
<span class="fw-900">Black text</span>

<!-- Named aliases also work -->
<span class="thin">Thin</span>
<span class="light">Light</span>
<span class="medium">Medium</span>
<span class="semibold">Semibold</span>
<span class="bold">Bold</span>

Color

6. Text Colors

Neutral shades and seven accent colors — wrap any inline element with the class.

text-black · text-dark · text-muted · text-soft

text-red · text-orange · text-yellow · text-green · text-blue · text-purple · text-pink

<!-- Neutral shades -->
<span class="text-black">text-black</span>
<span class="text-dark">text-dark</span>
<span class="text-muted">text-muted</span>
<span class="text-soft">text-soft</span>

<!-- Accent colors -->
<span class="text-blue">text-blue</span>
<span class="text-green">text-green</span>
<span class="text-red">text-red</span>
<span class="text-orange">text-orange</span>
<span class="text-yellow">text-yellow</span>
<span class="text-purple">text-purple</span>
<span class="text-pink">text-pink</span>

7. Background Colors

Six soft tinted backgrounds — add padding and border-radius via inline style to taste.

bg-soft
bg-blue-soft
bg-green-soft
bg-yellow-soft
bg-red-soft
bg-purple-soft
<div class="bg-soft"        style="padding:8px 12px;border-radius:8px">bg-soft</div>
<div class="bg-blue-soft"   style="padding:8px 12px;border-radius:8px">bg-blue-soft</div>
<div class="bg-green-soft"  style="padding:8px 12px;border-radius:8px">bg-green-soft</div>
<div class="bg-yellow-soft" style="padding:8px 12px;border-radius:8px">bg-yellow-soft</div>
<div class="bg-red-soft"    style="padding:8px 12px;border-radius:8px">bg-red-soft</div>
<div class="bg-purple-soft" style="padding:8px 12px;border-radius:8px">bg-purple-soft</div>

Components

8. Note Cards

Callout blocks in five colors — note-card is the base class, add a color modifier for variants. Add markdown="1" when content uses markdown syntax.

Default — neutral background. General asides.
note-blue — tips, info, see-also
note-green — confirmations, completed steps
note-yellow — warnings, caveats
note-red — errors, critical notes
<div class="note-card">Default — neutral background.</div>
<div class="note-card note-blue"><strong>Blue</strong> — tips, info, see-also</div>
<div class="note-card note-green"><strong>Green</strong> — confirmations, completed steps</div>
<div class="note-card note-yellow"><strong>Yellow</strong> — warnings, caveats</div>
<div class="note-card note-red"><strong>Red</strong> — errors, critical notes</div>

<!-- With markdown content inside -->
<div class="note-card note-blue" markdown="1">

**Bold title** — body text, $math$, and `code` all work inside.

</div>

9. Code Blocks

Inline backticks for short snippets, fenced blocks for multi-line code — any language tag works for syntax highlighting.

Inline: w is the weight vector, b is bias, alpha is the learning rate.

def softmax(x):
    e_x = np.exp(x - np.max(x))
    return e_x / e_x.sum()
python dashboard_server.py   # Open http://localhost:8030
server:
  host: localhost
  port: 8030
{
  "amf": { "plmn": "00101", "tac": 1 },
  "gnb": { "band": 78, "txPowerDbm": 23 }
}
Inline: `code snippet here`

```python
def my_function(x):
    return x * 2
```

```bash
python script.py --flag value
```

10. Badges & Pills

Inline status labels in six colors — use them anywhere: headings, tables, sentences.

In Progress Done Review Blocked Experimental Archived

In context — model comparison

Model Status Accuracy
Logistic Regression Done 84.2%
Random Forest Done 89.1%
MLP In Progress —
Transformer Review 93.4%
Diffusion Model Blocked —
Table 10.1: In context — model comparison
<span class="badge badge-blue">In Progress</span>
<span class="badge badge-green">Done</span>
<span class="badge badge-yellow">Review</span>
<span class="badge badge-red">Blocked</span>
<span class="badge badge-purple">Experimental</span>
<span class="badge badge-gray">Archived</span>

Tables

11. Tables

Standard — full width

Function Formula Range Notes
Sigmoid $\sigma(x) = 1/(1+e^{-x})$ (0, 1) Smooth, saturates
Tanh $\tanh(x)$ (−1, 1) Zero-centered
ReLU $\max(0, x)$ 0 to ∞ Fast, sparse
Softmax $e^{x_i}/\sum_j e^{x_j}$ (0, 1) Probabilities
Table 11.1: Common activation functions and their properties

Narrow — .table-narrow (max-width 480px)

Use `markdown="1"` on the wrapper div
Variant Batch size
Batch GD Full dataset
Mini-batch m samples
SGD 1 sample
Table 11.2: Narrow — .table-narrow (max-width 480px)

Mid-width — .table-mid (max-width 720px)

Optimizer Momentum Adaptive LR Default LR
SGD No No 0.01
Adam Yes Yes 0.001
AdamW Yes Yes 0.001
RMSProp No Yes 0.001
Table 11.3: Mid-width — .table-mid (max-width 720px)

Compact — .table-compact (tight cell padding)

Layer Input Output Params
Embedding 50 000 512 25.6 M
Attention 512 512 2.1 M
FFN 512 2048 2.1 M
Output 512 50 000 25.6 M
Table 11.4: Compact — .table-compact (tight cell padding)

Column alignment — Left / Center / Right

Left Center Right
AMF — Access and Mobility Active 192.168.1.10
SMF — Session Management Active 192.168.1.11
UPF — User Plane Forward Idle 192.168.1.12
Table 11.5: Column alignment — Left / Center / Right

Captioned + constrained — inside .fig-mid (700px)

Optimizer Momentum Adaptive LR
SGD No No
Adam Yes Yes
RMSProp No Yes
Table 11.6: Optimizer comparison — momentum and adaptive learning rate

See Table 11.1 and Table 11.6.

<!-- Captioned full-width table -->
<div id="tab-l1-id" class="caption-box caption-table" markdown="1">
<div class="caption-content" markdown="1">
| Col A | Col B | Col C |
|---|---|---|
| val | val | val |
</div>
<div class="caption-title"><span class="caption-label">Table</span>: Table caption here</div>
</div>

<!-- Narrow (480px) -->
<div class="table-narrow" markdown="1">

| Col A | Col B |
|---|---|
| val | val |

</div>

<!-- Mid-width (720px) -->
<div class="table-mid" markdown="1">

| Col A | Col B | Col C |
|---|---|---|
| val | val | val |

</div>

<!-- Compact padding + mid-width -->
<div class="table-compact table-mid" markdown="1">

| Col A | Col B |
|---|---|
| val | val |

</div>

<!-- Column alignment -->
| Left | Center | Right |
|:---|:---:|---:|
| val | val | val |

<!-- Captioned + constrained width -->
<div class="fig-mid" markdown="1">

<div id="tab-l1-id2" class="caption-box caption-table" markdown="1">
<div class="caption-content" markdown="1">
| Col A | Col B |
|---|---|
| val | val |
</div>
<div class="caption-title"><span class="caption-label">Table</span>: Caption at 700px</div>
</div>

</div>

Images & SVG

12. Images & SVG

Drop files into images/ — served at /images/filename. SVGs scale perfectly at any size.

Size classes — xs · sm · md · lg · xl

img-xs — 200px

xs

Figure 12.1: Size classes — xs · sm · md · lg · xl
img-sm — 350px · centered

sm

Figure 12.2: Size classes — xs · sm · md · lg · xl
img-md — 550px · centered

md

Figure 12.3: Size classes — xs · sm · md · lg · xl
Class Max-width
.img-xs 200px
.img-sm 350px
.img-md 550px
.img-lg 800px
.img-xl 1100px
.img-full 100%
Table 12.1: Size classes — xs · sm · md · lg · xl

Icon inline with text

apple
Figure 12.4: Icon inline with text
Optimized for Apple Silicon — runs natively on M1 / M2 / M3

CSS color theming — same SVG, different fills

default
blue
green
red
muted
on dark

SVG in col-card grid

macOS
Desktop
iOS
Mobile
watchOS
Watch
tvOS
TV

Inline SVG with CSS fill & hover

Hover to turn blue — inline SVG path targeted with CSS

CSS Animations

spin
pulse
bounce
glow
@keyframes svg-spin   { from { transform: rotate(0deg) }   to { transform: rotate(360deg) } }
@keyframes svg-pulse  { 0%,100% { transform: scale(1) } 50% { transform: scale(1.15) } }
@keyframes svg-bounce { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-10px) } }
@keyframes svg-glow   { 0%,100% { filter: drop-shadow(0 0 0px #2563EB) } 50% { filter: drop-shadow(0 0 12px #2563EB) } }
.anim-spin   { animation: svg-spin   2s linear infinite; transform-origin: center }
.anim-pulse  { animation: svg-pulse  1.6s ease-in-out infinite }
.anim-bounce { animation: svg-bounce 1.2s ease-in-out infinite }
.anim-glow   { animation: svg-glow   1.8s ease-in-out infinite }

Gradient fill — SVG <defs>

Drop shadow & glow — CSS filter

drop-shadow
blue glow
pink glow
blur + shadow

Glassmorphism card

Figure 12.5: Glassmorphism card
Apple Silicon
M-series · unified memory · neural engine

Float & captioned figure

apple

Figure 12.6: Float & captioned figure

Text wraps around a floated SVG just like any image. Use .img-right or .img-left with any size class. The gradient $\nabla_\theta \mathcal{L}$ points toward steepest ascent — stepping opposite reduces loss.

Apple Logo

Figure 12.7: Apple logo — SVG served from /images/, rendered at img-md · centered · shadow

Apple Logo small

Figure 12.8: Same SVG constrained to 480px with .fig-narrow

Figure 12.7 (large) · Figure 12.8 (narrow wrapper)

<!-- Size classes -->
<img src="/images/file.svg" class="img-xs img-rounded img-border">
<img src="/images/file.svg" class="img-sm img-center img-shadow">
<img src="/images/file.svg" class="img-md img-center img-shadow">
<img src="/images/file.svg" class="img-lg img-center img-shadow">

<!-- Inline icon -->
<div style="display:flex;align-items:center;gap:10px">
  <img src="/images/icon.svg" style="width:22px;height:22px">
  <span>Text next to icon</span>
</div>

<!-- Float right — text wraps around it -->
<img src="/images/file.svg" class="img-xs img-right img-rounded img-shadow">
Text that wraps around the floated image...
<div style="clear:both"></div>

<!-- Captioned figure -->
<div id="fig-l1-id" class="caption-box caption-figure" markdown="1">
<div class="caption-content" markdown="1">
<img src="/images/file.svg" class="img-md img-center img-shadow">
</div>
<div class="caption-title"><span class="caption-label">Figure</span>: Figure caption</div>
</div>

<!-- Constrained to 480px -->
<div class="fig-narrow" markdown="1">

<div id="fig-l1-id-sm" class="caption-box caption-figure" markdown="1">
<div class="caption-content" markdown="1">
<img src="/images/file.svg" class="img-full img-rounded img-border">
</div>
<div class="caption-title"><span class="caption-label">Figure</span>: Narrow caption</div>
</div>

</div>

<!-- Gradient fill with <defs> -->
<svg viewBox="0 0 24 24">
  <defs>
    <linearGradient id="g" x1="0" y1="0" x2="1" y2="1">
      <stop offset="0%" stop-color="#2563EB"/>
      <stop offset="100%" stop-color="#7C3AED"/>
    </linearGradient>
  </defs>
  <path fill="url(#g)" d="…"/>
</svg>

Widgets

13. Widgets

Embed anywhere in Markdown with {​{ widget_name }} or {​{ widget_name: argument }}.

Clock

Displays Python server time — polls /api/clock every second.

{​{ clock }}
Local time
03:06:36
Saturday, 26 September 2026
synced from /api/clock every second

Task Progress

Scans the current file for - [x] and - [ ] checkboxes and draws a live progress bar. Checkboxes are clickable — they write directly back to the .md file.

{​{ task_progress }}
Widget not found: task_progress

Sine Graph

Interactive HTML5 canvas — drag sliders to update $A$, $B$, $C$, $D$ live.

{​{ sine_graph }}
Widget not found: sine_graph

File Index

Lists every .md file inside a folder as clickable cards.

{​{ file_index: . }}           ← entire project root
{​{ file_index: experiments }} ← subfolder only
{​{ file_index: projects }}    ← another subfolder
Widget not found: file_index

Project Status

Renders a custom status block defined in widgets/project_status.py.

{​{ project_status }}
Widget not found: project_status

Custom Widget — Minimal Template

Create widgets/my_widget.py — the server hot-reloads it automatically:

# widgets/my_widget.py
def render(context=None, argument=None) -> str:
    # context keys available:
    #   project_root       → Path to project directory
    #   current_md_file    → Path to the current .md file
    #   list_markdown_files → callable(base_dir) → list[Path]
    #   md_url_for_file    → callable(Path) → str
    #   safe_project_path  → callable(str) → Path | None

    label = argument or "My Widget"
    return f"""
<div class="py-widget">
  <div class="widget-label">{label}</div>
  <p>Put your custom HTML here.</p>
</div>
"""

Then embed with:

{​{ my_widget }}
{​{ my_widget: Custom Label }}

Math & Diagrams

14. Math — KaTeX

Inline and display

Inline $...$, display block $$...$$, and captioned equations with cross-reference IDs.

Inline: $\mathcal{L} = -\sum_i y_i \log \hat{y}_i$, $E = mc^2$, $x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}$

$$ \mathcal{L}(y, \hat{y}) = -\frac{1}{N} \sum_{i=1}^{N} \Bigl[ y_i \log \hat{y}_i + (1 - y_i) \log(1 - \hat{y}_i) \Bigr] \tag{14.1} $$
Equation 14.1: Binary cross-entropy loss
$$ \theta \leftarrow \theta - \eta \cdot \nabla_\theta \mathcal{L}(\theta) \tag{14.2} $$
Equation 14.2: Inline and display

See Equation 14.1.

<!-- Inline math -->
The loss $\mathcal{L} = -\sum_i y_i \log \hat{y}_i$ decreases as training progresses.

<!-- Display block (centered, larger) -->
$$
\theta \leftarrow \theta - \eta \cdot \nabla_\theta \mathcal{L}(\theta)
$$

<!-- Standalone $ block — shorthand display math -->
$
C = B \log_2\!\left(1 + \frac{S}{N}\right)
$

<!-- Captioned equation with cross-reference ID -->
<div id="eq-l1-my-id" class="caption-box caption-equation">
<div class="caption-content">
$
\mathcal{L}(y, \hat{y}) = -\frac{1}{N} \sum_{i=1}^{N}
  \Bigl[ y_i \log \hat{y}_i + (1 - y_i) \log(1 - \hat{y}_i) \Bigr]
$
</div>
<div class="caption-title"><span class="caption-label">Equation</span>: Equation label here</div>
</div>

<!-- Reference it anywhere -->
See @eq-l1-my-id.

KaTeX size comparison

Each row pairs a KaTeX expression with plain text at the same level.

Context Math Plain text
Body $\sigma(z) = 1/(1+e^{-z})$ sigmoid function
Table cell $\nabla_\theta \mathcal{L}$ gradient of loss
Subscript $x_i, W_{ij}, b_j$ indexed variables
Fraction $\eta = \frac{\partial \mathcal{L}}{\partial \theta}$ learning rate
Table 14.1: KaTeX size comparison

Fractions, sums, integrals

$$ \text{SINR} = \frac{P_\text{signal}}{\displaystyle\sum_{i \neq 0} P_i + N_0 B} \tag{14.3} $$
Equation 14.3: Fractions, sums, integrals
$$ \bar{x} = \frac{1}{n} \sum_{i=1}^{n} x_i \qquad \sigma^2 = \frac{1}{n}\sum_{i=1}^{n}(x_i - \bar{x})^2 \tag{14.4} $$
Equation 14.4: Fractions, sums, integrals
$$ E = \int_{-\infty}^{\infty} |x(t)|^2 \, dt \qquad X(f) = \int_{-\infty}^{\infty} x(t)\, e^{-j2\pi ft}\, dt \tag{14.5} $$
Equation 14.5: Fractions, sums, integrals

Limits & derivatives

$$ \lim_{d \to \infty} P_r(d) = 0 \qquad \frac{d}{dx}\sin(x) = \cos(x) \qquad \frac{\partial^2 u}{\partial t^2} = c^2\nabla^2 u \tag{14.6} $$
Equation 14.6: Limits & derivatives

Probability & statistics

$$ P(A \mid B) = \frac{P(B \mid A)\,P(A)}{P(B)} \qquad X \sim \mathcal{N}(\mu, \sigma^2) \qquad \mathbb{E}[X] = \int_{-\infty}^{\infty} x\,f(x)\,dx \tag{14.7} $$
Equation 14.7: Probability & statistics

Greek letters & common symbols

$$\alpha \beta \gamma \delta \epsilon \zeta \eta \theta \iota \kappa \lambda \mu$$ $$\nu \xi \pi \rho \sigma \tau \upsilon \phi \chi \psi \omega$$ $$\Gamma \Delta \Theta \Lambda \Xi \Pi \Sigma \Upsilon \Phi \Psi \Omega$$

Math in a table

Symbol Definition Typical Value
$f_c$ Carrier frequency 3.5 GHz
$\lambda = c/f_c$ Wavelength 8.6 cm
$B$ Channel bandwidth 20–100 MHz
$\alpha$ Path loss exponent 2 (free space), 3–4 (urban)
$N_0$ Noise power spectral density −174 dBm/Hz
$\text{SINR}$ Signal-to-Interference-plus-Noise Ratio 15–25 dB
Table 14.2: Math in a table

Superscripts & subscripts — all patterns

Pattern Syntax Renders as
Simple superscript $x^2$ $x^2$
Simple subscript $x_i$ $x_i$
Both $x_i^2$ $x_i^2$
Grouped superscript $x^{(i)}$ $x^{(i)}$
Layer weight $w^{[l]}$ $w^{[l]}$
Matrix element $W_{ij}$ $W_{ij}$
Chemical formula $\text{CO}_2$ $\text{CO}_2$
Scientific notation $10^{-3}$ $10^{-3}$
nth layer $n^{\text{th}}$ $n^{\text{th}}$
Table 14.3: Superscripts & subscripts — all patterns

15. Math Priority Classes

Use .math-text (italic variable) and .math-op (upright operator) when KaTeX isn't available — inside Mermaid labels, SVG <tspan>, or plain HTML.

Expression .math-text / .math-op KaTeX $...$
Linear output ŷ = softmax(Wx + b) $\hat{y} = \text{softmax}(Wx + b)$
Sigmoid σ(z) = 1 / (1 + exp(−z)) $\sigma(z) = 1/(1 + \exp(-z))$
ReLU ReLU(z) = max(0, z) $\text{ReLU}(z) = \max(0, z)$
Gradient update θ ← θ − η ∇L(θ) $\theta \leftarrow \theta - \eta\,\nabla L(\theta)$
Chain rule ∂L/∂W = ∂L/∂z · ∂z/∂W $\partial L/\partial W = \partial L/\partial z \cdot \partial z/\partial W$
Table 15.1: Math Priority Classes

SVG — inline <tspan> with math classes

σ(z) = 1 / (1 + exp(−z)) $\sigma(z) = 1/(1 + \exp(-z))$
θ ← θ − η ∇L(θ) $\theta \leftarrow \theta - \eta\,\nabla L(\theta)$

SVG diagram — labeled neuron

w₁ w₂ x₁ x₂ z=wᵀx +b ŷ σ(z)

<!-- In a span or table cell -->
<span class="math-text">σ</span>(<span class="math-text">z</span>) = 1 / (1 + <span class="math-op">exp</span>(−<span class="math-text">z</span>))

<!-- In an SVG <tspan> -->
<text font-family="SF Pro Display, system-ui, sans-serif">
  <tspan class="math-text">θ</tspan> ← <tspan class="math-text">θ</tspan> − <tspan class="math-text">η</tspan> ∇<tspan class="math-text">L</tspan>(<tspan class="math-text">θ</tspan>)
</text>

16. Mermaid Diagrams

Wrap any Mermaid syntax in ```mermaid fences. The server injects the CDN script automatically. Use $$...$$ for math inside diagram labels.

Flowchart — Left to Right

flowchart LR UE[User Equipment] --> gNB[gNodeB / RAN] gNB --> AMF gNB --> UPF AMF --> SMF SMF --> UPF UPF --> DN[(Data Network / Internet)] AMF --> UDM[(UDM — Subscriber DB)] %% -- dashboard status styles -- classDef ok fill:#DCFCE7,stroke:#16A34A,stroke-width:1.5px,color:#052E16; classDef warn fill:#FEF9C3,stroke:#CA8A04,stroke-width:1.5px,color:#422006; classDef err fill:#FCE7EF,stroke:#DB2777,stroke-width:1.5px,color:#500724; classDef crit fill:#FEE2E2,stroke:#DC2626,stroke-width:1.5px,color:#450A0A; classDef off fill:#F1F5F9,stroke:#94A3B8,stroke-width:1.5px,color:#111827; classDef info fill:#EFF6FF,stroke:#3B82F6,stroke-width:1.5px,color:#0C1E3E;
Figure 16.1: Flowchart — Left to Right

Flowchart — Top to Bottom with node shapes

flowchart TD A([Start]) --> B{Valid PLMN?} B -->|Yes| C[Send Auth Request] B -->|No| D[/Reject/] C --> E{Auth OK?} E -->|Yes| F[Registration Accept] E -->|No| G[/Auth Failure/] F --> H([End]) D --> H G --> H %% -- dashboard status styles -- classDef ok fill:#DCFCE7,stroke:#16A34A,stroke-width:1.5px,color:#052E16; classDef warn fill:#FEF9C3,stroke:#CA8A04,stroke-width:1.5px,color:#422006; classDef err fill:#FCE7EF,stroke:#DB2777,stroke-width:1.5px,color:#500724; classDef crit fill:#FEE2E2,stroke:#DC2626,stroke-width:1.5px,color:#450A0A; classDef off fill:#F1F5F9,stroke:#94A3B8,stroke-width:1.5px,color:#111827; classDef info fill:#EFF6FF,stroke:#3B82F6,stroke-width:1.5px,color:#0C1E3E;
Figure 16.2: Flowchart — Top to Bottom with node shapes

Flowchart — Subgraphs / Clusters

flowchart LR subgraph RAN UE --> gNB end subgraph Core5G AMF SMF UPF UDM end gNB -->|N2 NGAP| AMF gNB -->|N3 GTP-U| UPF AMF -->|N11| SMF SMF -->|N4 PFCP| UPF UPF -->|N6| Internet((Internet)) %% -- dashboard status styles -- classDef ok fill:#DCFCE7,stroke:#16A34A,stroke-width:1.5px,color:#052E16; classDef warn fill:#FEF9C3,stroke:#CA8A04,stroke-width:1.5px,color:#422006; classDef err fill:#FCE7EF,stroke:#DB2777,stroke-width:1.5px,color:#500724; classDef crit fill:#FEE2E2,stroke:#DC2626,stroke-width:1.5px,color:#450A0A; classDef off fill:#F1F5F9,stroke:#94A3B8,stroke-width:1.5px,color:#111827; classDef info fill:#EFF6FF,stroke:#3B82F6,stroke-width:1.5px,color:#0C1E3E;
Figure 16.3: Flowchart — Subgraphs / Clusters

Flowchart with KaTeX labels

flowchart LR X["$$\text{Input}\ x$$"] --> Z1["$$z_1 = W_1x + b_1$$"] --> A1["$$\text{ReLU}(z_1)$$"] --> Z2["$$z_2 = W_2a_1 + b_2$$"] --> Yhat["$$\hat{y}$$"] %% -- dashboard status styles -- classDef ok fill:#DCFCE7,stroke:#16A34A,stroke-width:1.5px,color:#052E16; classDef warn fill:#FEF9C3,stroke:#CA8A04,stroke-width:1.5px,color:#422006; classDef err fill:#FCE7EF,stroke:#DB2777,stroke-width:1.5px,color:#500724; classDef crit fill:#FEE2E2,stroke:#DC2626,stroke-width:1.5px,color:#450A0A; classDef off fill:#F1F5F9,stroke:#94A3B8,stroke-width:1.5px,color:#111827; classDef info fill:#EFF6FF,stroke:#3B82F6,stroke-width:1.5px,color:#0C1E3E;
Figure 16.4: Flowchart with KaTeX labels
flowchart LR X["$$\text{Input}\ x$$"] --> W1["$$W_1, b_1$$"] --> A1["$$\text{ReLU}(z_1)$$"] --> W2["$$W_2, b_2$$"] --> Out["$$\text{Output}\ \hat{y}$$"] %% -- dashboard status styles -- classDef ok fill:#DCFCE7,stroke:#16A34A,stroke-width:1.5px,color:#052E16; classDef warn fill:#FEF9C3,stroke:#CA8A04,stroke-width:1.5px,color:#422006; classDef err fill:#FCE7EF,stroke:#DB2777,stroke-width:1.5px,color:#500724; classDef crit fill:#FEE2E2,stroke:#DC2626,stroke-width:1.5px,color:#450A0A; classDef off fill:#F1F5F9,stroke:#94A3B8,stroke-width:1.5px,color:#111827; classDef info fill:#EFF6FF,stroke:#3B82F6,stroke-width:1.5px,color:#0C1E3E;
Figure 16.5: Neural network forward pass through layers

Sequence Diagram with autonumber

sequenceDiagram autonumber participant UE participant gNB participant AMF participant UDM UE->>gNB: RRC Setup Request gNB->>AMF: Initial UE Message (NGAP) AMF->>UDM: Authentication Data Request UDM-->>AMF: Authentication Data Response AMF-->>gNB: NAS Auth Request gNB-->>UE: NAS Auth Request UE->>gNB: NAS Auth Response gNB->>AMF: Registration Complete AMF-->>gNB: Registration Accept gNB-->>UE: Registration Accept
Figure 16.6: Sequence Diagram with autonumber

Sequence with KaTeX labels

sequenceDiagram participant D as Dataset participant M as Model participant O as Optimizer D->>M: $$\text{batch}\ (x, y)$$ M->>M: $$\text{forward pass} \to \hat{y}$$ M->>O: $$\text{loss}\ \mathcal{L}(y, \hat{y})$$ O->>M: $$\text{gradients}\ \nabla\mathcal{L}$$ O->>M: $$\text{update weights}\ \theta$$
Figure 16.7: Sequence with KaTeX labels

State Diagram

stateDiagram-v2 [*] --> Idle Idle --> Connecting: RRC Setup Request Connecting --> Registered: Registration Accept Connecting --> Idle: Rejection / Timeout Registered --> Idle: Detach / Release Registered --> DataTransfer: PDU Session Established DataTransfer --> Registered: PDU Session Released DataTransfer --> Idle: Radio Link Failure
Figure 16.8: State Diagram

Pie Chart

pie title Spectrum Allocation by Slice "eMBB — enhanced Mobile Broadband" : 60 "URLLC — Ultra-Reliable Low Latency" : 25 "mMTC — Massive Machine-Type" : 15
Figure 16.9: Pie Chart

Class Diagram

classDiagram class NetworkFunction { +String name +String ipAddress +start() +stop() +getStatus() String } class AMF { +String plmn +handleRegistration() +authenticate() } class SMF { +allocatePDUSession() +selectUPF() } class UPF { +applyPDR() +forwardPacket() } NetworkFunction <|-- AMF NetworkFunction <|-- SMF NetworkFunction <|-- UPF AMF --> SMF : N11 SMF --> UPF : N4 PFCP
Figure 16.10: Class Diagram

Gantt Chart

gantt title 5G Private Network Deployment dateFormat YYYY-MM-DD section Hardware Rack installation :done, hw1, 2025-01-01, 2025-01-07 Cabling & power :done, hw2, 2025-01-05, 2025-01-10 section Core Software open5gs install :done, c1, 2025-01-10, 2025-01-14 AMF/SMF configuration :done, c2, 2025-01-13, 2025-01-18 section RAN OAI gNB setup :active, r1, 2025-01-17, 2025-01-24 UE registration test : r2, 2025-01-22, 2025-01-28 section Validation iPerf throughput test : v1, 2025-01-26, 2025-02-02 SINR measurement : v2, 2025-01-30, 2025-02-05
Figure 16.11: Gantt Chart

Entity Relationship Diagram

erDiagram UE { string imsi string imei string msisdn } SUBSCRIPTION { string plmn int sst string sd } PDU_SESSION { string apn string ipv4 int qfi } UE ||--o{ SUBSCRIPTION : has UE ||--o{ PDU_SESSION : opens SUBSCRIPTION ||--|{ PDU_SESSION : governs
Figure 16.12: ER diagram — Entity Relationship Diagram

See Figure 16.5.

<!-- Basic flowchart -->

<div class="mermaid">
flowchart LR
  A --> B --> C

%% -- dashboard status styles --
classDef ok fill:#DCFCE7,stroke:#16A34A,stroke-width:1.5px,color:#052E16;
classDef warn fill:#FEF9C3,stroke:#CA8A04,stroke-width:1.5px,color:#422006;
classDef err fill:#FCE7EF,stroke:#DB2777,stroke-width:1.5px,color:#500724;
classDef crit fill:#FEE2E2,stroke:#DC2626,stroke-width:1.5px,color:#450A0A;
classDef off fill:#F1F5F9,stroke:#94A3B8,stroke-width:1.5px,color:#111827;
classDef info fill:#EFF6FF,stroke:#3B82F6,stroke-width:1.5px,color:#0C1E3E;
</div>


<!-- Flowchart with KaTeX node labels -->

<div class="mermaid">
flowchart LR
  A["$$\text{Input}\ x$$"] --> B["Layer 1"] --> C["$$\text{Output}\ \hat{y}$$"]

%% -- dashboard status styles --
classDef ok fill:#DCFCE7,stroke:#16A34A,stroke-width:1.5px,color:#052E16;
classDef warn fill:#FEF9C3,stroke:#CA8A04,stroke-width:1.5px,color:#422006;
classDef err fill:#FCE7EF,stroke:#DB2777,stroke-width:1.5px,color:#500724;
classDef crit fill:#FEE2E2,stroke:#DC2626,stroke-width:1.5px,color:#450A0A;
classDef off fill:#F1F5F9,stroke:#94A3B8,stroke-width:1.5px,color:#111827;
classDef info fill:#EFF6FF,stroke:#3B82F6,stroke-width:1.5px,color:#0C1E3E;
</div>


<!-- Sequence diagram with math labels -->

<div class="mermaid">
sequenceDiagram
  participant D as Dataset
  participant M as Model
  D->>M: $$\text{batch}\ (x, y)$$
  M->>M: $$\text{forward pass} \to \hat{y}$$
</div>


<!-- Captioned mermaid figure -->
<div id="fig-l1-my-diagram" class="caption-box caption-figure" markdown="1">
<div class="caption-content" markdown="1">

<div class="mermaid">
flowchart TD
  X --> L1 --> L2 --> Y

%% -- dashboard status styles --
classDef ok fill:#DCFCE7,stroke:#16A34A,stroke-width:1.5px,color:#052E16;
classDef warn fill:#FEF9C3,stroke:#CA8A04,stroke-width:1.5px,color:#422006;
classDef err fill:#FCE7EF,stroke:#DB2777,stroke-width:1.5px,color:#500724;
classDef crit fill:#FEE2E2,stroke:#DC2626,stroke-width:1.5px,color:#450A0A;
classDef off fill:#F1F5F9,stroke:#94A3B8,stroke-width:1.5px,color:#111827;
classDef info fill:#EFF6FF,stroke:#3B82F6,stroke-width:1.5px,color:#0C1E3E;
</div>

</div>
<div class="caption-title"><span class="caption-label">Figure</span>: Diagram caption</div>
</div>

17. Complex Math

KaTeX environments for matrices, piecewise functions, aligned derivations, and multi-index sums.

Matrix multiplication

$$ Z = XW^\top + b, \quad X \in \mathbb{R}^{N \times d},\; W \in \mathbb{R}^{k \times d},\; b \in \mathbb{R}^k \tag{17.1} $$
Equation 17.1: Matrix multiplication

Piecewise function

$$ \text{ReLU}(z) = \begin{cases} z & z > 0 \cr 0 & z \leq 0 \end{cases} \tag{17.2} $$
Equation 17.2: Piecewise function

Aligned equations

$$ \begin{align} \frac{\partial \mathcal{L}}{\partial W} &= \frac{\partial \mathcal{L}}{\partial \hat{y}} \cdot \frac{\partial \hat{y}}{\partial z} \cdot \frac{\partial z}{\partial W} \cr &= (\hat{y} - y) \cdot \sigma'(z) \cdot x \cr &= (\hat{y} - y) \cdot \hat{y}(1 - \hat{y}) \cdot x \tag{17.3.1} \end{align} $$
Equation 17.3: Aligned equations

Double summation

$$ \mathcal{L} = -\frac{1}{N}\sum_{i=1}^{N}\sum_{c=1}^{C} y_{ic}\log\hat{y}_{ic} \tag{17.4} $$
Equation 17.4: Double summation

Matrix form

$$ \begin{pmatrix} z_1 \cr z_2 \cr z_3 \end{pmatrix} = \begin{pmatrix} w_{11} & w_{12} \cr w_{21} & w_{22} \cr w_{31} & w_{32} \end{pmatrix} \begin{pmatrix} x_1 \cr x_2 \end{pmatrix} + \begin{pmatrix} b_1 \cr b_2 \cr b_3 \end{pmatrix} \tag{17.5} $$
Equation 17.5: Matrix form

Channel matrix

$$ \mathbf{H} = \begin{pmatrix} h_{11} & h_{12} & \cdots & h_{1N} \\ h_{21} & h_{22} & \cdots & h_{2N} \\ \vdots & \vdots & \ddots & \vdots \\ h_{M1} & h_{M2} & \cdots & h_{MN} \end{pmatrix} \qquad \mathbf{y} = \mathbf{H}\mathbf{x} + \mathbf{n} \tag{17.6} $$
Equation 17.6: Channel matrix
<!-- Piecewise function -->
$$
f(z) = \begin{cases} z & z > 0 \cr 0 & z \leq 0 \end{cases}
$$

<!-- Aligned equations -->
$$
\begin{aligned}
\frac{\partial \mathcal{L}}{\partial W} &= \frac{\partial \mathcal{L}}{\partial \hat{y}} \cdot \frac{\partial \hat{y}}{\partial z} \cdot \frac{\partial z}{\partial W} \\
  &= (\hat{y} - y) \cdot \sigma'(z) \cdot x
\end{aligned}
$$

<!-- Matrix -->
$$
\begin{pmatrix} z_1 \\ z_2 \end{pmatrix} =
\begin{pmatrix} w_{11} & w_{12} \\ w_{21} & w_{22} \end{pmatrix}
\begin{pmatrix} x_1 \\ x_2 \end{pmatrix} + \begin{pmatrix} b_1 \\ b_2 \end{pmatrix}
$$

18. Math Charts

Hand-crafted SVG charts with precise mathematical curves and KaTeX-style labels.

Activation Functions — σ(z), tanh(z), ReLU(z)

−4−2 024 10−1 z σ(z) sigmoid tanh(z) ReLU(z) Activation Functions

Normal Distribution — $\mathcal{N}(0,1)$

−2−1 012 0.10.20.3 peak = 0.399 68.27% −σ +σ Normal Distribution 𝒩(0, 1)

Interactive — Sine Wave Explorer

Drag any slider to update the curve in real time: $y = A \cdot \sin(Bx + C) + D$

Widget not found: sine_graph

Interactive — Gradient Descent on $\mathcal{L}(\theta) = \theta^2$

Click the curve to set a starting point, adjust the learning rate, then step or animate.

Click the parabola to place θ₀

References & Structure

19. Captions & Cross-References

Use :::caption to create numbered figures, tables, and equations. Reference them with @type-id anywhere — cross-file links open in a new tab with ↗.

Caption syntax

<!-- Figure -->
<div id="fig-l1-my-id" class="caption-box caption-figure" markdown="1">
<div class="caption-content" markdown="1">
<img src="/images/file.svg" class="img-md img-center">
</div>
<div class="caption-title"><span class="caption-label">Figure</span>: Figure caption text</div>
</div>

<!-- Table -->
<div id="tab-l1-my-id" class="caption-box caption-table" markdown="1">
<div class="caption-content" markdown="1">
| Col A | Col B |
|---|---|
| val | val |
</div>
<div class="caption-title"><span class="caption-label">Table</span>: Table caption text</div>
</div>

<!-- Equation -->
<div id="eq-l1-my-id" class="caption-box caption-equation">
<div class="caption-content">
$
\mathcal{L}(y, \hat{y}) = -\frac{1}{N}\sum_{i=1}^{N} y_i \log\hat{y}_i
$
</div>
<div class="caption-title"><span class="caption-label">Equation</span>: Equation name</div>
</div>

<!-- Reference anywhere in any .md file -->
See @fig-l1-my-id, @tab-l1-my-id, and @eq-l1-my-id.

All reference types

Ref type Syntax Points to
Section @sec-l1-xxx ## Heading {#sec-l1-xxx}
Figure @fig-l1-xxx :::caption type="figure" id="fig-l1-xxx"
Table @tab-l1-xxx :::caption type="table" id="tab-l1-xxx"
Equation @eq-l1-xxx :::caption type="equation" id="eq-l1-xxx"
Sentence @par-l1-xxx [text.]{#par-l1-xxx \| label}
Missing @unknown Renders as [?unknown] in red
Table 19.1: All reference types

Figure width containers

<!-- Narrow (480px) -->
<div class="fig-narrow" markdown="1">
<div id="fig-l1-id" class="caption-box caption-figure" markdown="1">
<div class="caption-content" markdown="1">
<img src="/images/file.svg" class="img-full">
</div>
<div class="caption-title"><span class="caption-label">Figure</span>: Caption</div>
</div>
</div>

<!-- Mid (700px) -->
<div class="fig-mid" markdown="1">
<div id="fig-l1-id" class="caption-box caption-figure" markdown="1">
<div class="caption-content" markdown="1">
<img src="/images/file.svg" class="img-full">
</div>
<div class="caption-title"><span class="caption-label">Figure</span>: Caption</div>
</div>
</div>

<!-- Wide (1000px) -->
<div class="fig-wide" markdown="1">
<div id="fig-l1-id" class="caption-box caption-figure" markdown="1">
<div class="caption-content" markdown="1">
<img src="/images/file.svg" class="img-full">
</div>
<div class="caption-title"><span class="caption-label">Figure</span>: Caption</div>
</div>
</div>

20. Sentence Anchors

Anchor any sentence with <span id="par-l1-id" class="sentence-anchor">text.</span> — the | label controls what @par-l1-id displays as. Must be on a single line.

During training, the model computes a forward pass to produce predictions $\hat{y}$, then backpropagates the error to compute gradients. This cycle repeats for every batch.

The key insight is that gradient descent works because the loss surface is locally approximated as a quadratic bowl — the gradient points toward steepest ascent, so stepping opposite reduces the loss.

Choosing the right learning rate $\eta$ is critical: too large and the optimizer overshoots; too small and training takes impractically long.

Jump to: forward pass · why it works · learning rate

[The sentence to anchor.]{#par-l1-my-id | display label}

Reference it anywhere: @par-l1-my-id

21. Task Lists

GitHub-style checkboxes — [x] for done, [ ] for pending. Checkboxes are clickable — they write directly back to the .md file via the server's toggle-checkbox endpoint.

- [x] Completed task
- [x] Another finished item
- [ ] Still to do
- [ ] Another pending item

Inline & Rich Text

22. Inline Text Styles

Strikethrough, highlight, change tracking, abbreviations

The old learning rate was 0.1 new default is 0.001. Batch size 512 → 256 works better.

The most important step is normalizing inputs before training. Without it, gradients can explode.

Batch size: 512 256. Learning rate: 0.01 0.001. Optimizer: SGD Adam.

SGD is slower than Adam but generalizes better. ReLU is the default activation.

Keyboard keys

Save: Cmd + S · Run: Shift + Enter · Comment: Cmd + / · Find: Cmd + F

~~strikethrough~~

<mark>highlighted text</mark>

<del>removed</del> <ins>added</ins>

<abbr title="Full Expansion">Abbr</abbr>

<kbd>Cmd</kbd> + <kbd>S</kbd>

23. Nested Lists

Indent 4 spaces per level — mix ordered and unordered at any depth.

- Level 1 item
    - Level 2 item
        - Level 3 item

1. Ordered item
    1. Nested ordered
        - Unordered sub-item
2. Back to top level

24. Collapsible Sections

<details> / <summary> — content supports full markdown, math, and code blocks.

What is backpropagation? Backpropagation computes $\frac{\partial \mathcal{L}}{\partial \theta}$ for every parameter by applying the chain rule layer by layer from output back to input. $$\frac{\partial \mathcal{L}}{\partial W^{(l)}} = \frac{\partial \mathcal{L}}{\partial z^{(l)}} \cdot \frac{\partial z^{(l)}}{\partial W^{(l)}}$$ The result is passed to the optimizer to update weights.
Why does vanishing gradient happen? When activation functions like sigmoid saturate, their derivatives approach zero. Multiplying many near-zero values during backprop makes gradients exponentially small in early layers. Common fixes: ReLU activations · residual connections · careful weight initialization (He, Xavier).
Adam optimizer — parameter summary
ParameterDefaultRole
lr0.001Step size
β₁0.9Momentum decay
β₂0.999Variance decay
ε1e-8Numerical stability
<details>
<summary>Section title (click to expand)</summary>

Content here — supports **bold**, *italic*, $math$, and code blocks.

$$\frac{\partial \mathcal{L}}{\partial W} = (\hat{y} - y) \cdot x$$

</details>

25. Multi-column Layout

Responsive grid cards — col-2, col-3, col-4 collapse to a single column on mobile. Add markdown="1" when content uses markdown.

2 columns

Underfitting

Model is too simple to capture the pattern. High bias, low variance.

Fix: larger model · more features · less regularization

Overfitting

Model memorizes training data. Low bias, high variance.

Fix: more data · dropout · weight decay · early stopping

3 columns

Batch GD

Uses full dataset per update. Smooth convergence, slow per step.

$\nabla \mathcal{L} = \frac{1}{N}\sum_i \nabla \ell_i$

Mini-batch GD

Uses $m$ samples. Best of both worlds. Standard in practice.

$\nabla \mathcal{L} \approx \frac{1}{m}\sum_i \nabla \ell_i$

SGD

One sample per update. Noisy but can escape local minima.

$\nabla \mathcal{L} \approx \nabla \ell_i$

4 columns — stat cards with badges

Train loss
0.042
↓ 12%
Val loss
0.061
↓ 8%
Accuracy
93.4%
↑ 2.1%
Epoch
47 / 100
Running
<!-- 2-column layout -->
<div class="col-2" markdown="1">
<div class="col-card" markdown="1">

**Left card** — supports full **markdown** and $math$.

</div>
<div class="col-card" markdown="1">

**Right card** — collapses to 1 column on mobile.

</div>
</div>

<!-- 3-column layout -->
<div class="col-3" markdown="1">
<div class="col-card" markdown="1">Column A</div>
<div class="col-card" markdown="1">Column B</div>
<div class="col-card" markdown="1">Column C</div>
</div>

<!-- 4-column stat cards -->
<div class="col-4">
<div class="col-card">
  <div class="b3 text-muted">Metric label</div>
  <div style="font-size:1.6rem;font-weight:700">value</div>
  <span class="badge badge-green">↑ change</span>
</div>
</div>

Layout Extras

26. Progress Bars & Meters

Inline CSS bars — pair a track div with a fill div and set width as a percentage.

Labeled bars

Accuracy
93%
F1 Score
87%
Recall
74%

Gradient bar with header

Training progress Epoch 47 / 100

Segmented / stacked bar

Train 60%
Val 20%
Test 20%
<!-- Labeled bar -->
<div style="display:flex;align-items:center;gap:12px;margin:10px 0">
  <span style="width:80px;font-size:13px;color:#475569">Label</span>
  <div style="flex:1;background:#F1F5F9;border-radius:999px;height:8px">
    <div style="background:#2563EB;height:8px;border-radius:999px;width:75%"></div>
  </div>
  <span style="font-size:13px;font-weight:600;color:#2563EB;width:36px">75%</span>
</div>

<!-- Gradient bar with header -->
<div style="display:flex;justify-content:space-between;margin-bottom:6px">
  <span style="font-size:13px;font-weight:600">Progress label</span>
  <span style="font-size:13px;color:#6B7280">47 / 100</span>
</div>
<div style="background:#F1F5F9;border-radius:999px;height:12px">
  <div style="background:linear-gradient(to right,#2563EB,#7C3AED);height:12px;border-radius:999px;width:47%"></div>
</div>

<!-- Segmented bar -->
<div style="display:flex;height:16px;border-radius:8px;overflow:hidden;gap:2px">
  <div style="background:#2563EB;width:60%">Train 60%</div>
  <div style="background:#16A34A;width:20%">Val 20%</div>
  <div style="background:#EA580C;width:20%">Test 20%</div>
</div>

27. Dividers & Separators

Plain horizontal rule


Gradient divider

Short accent bar

Labeled divider

SECTION BREAK

Dotted separator

Icon-centered divider

✦
<!-- Plain rule -->
---

<!-- Gradient divider -->
<div style="height:2px;background:linear-gradient(to right,transparent,#2563EB,transparent);margin:24px 0"></div>

<!-- Short accent bar -->
<div style="height:3px;background:#2563EB;width:60px;border-radius:999px;margin:16px 0"></div>

<!-- Labeled divider -->
<div style="display:flex;align-items:center;gap:12px;margin:20px 0">
  <div style="flex:1;height:1px;background:#E5E7EB"></div>
  <span style="font-size:12px;color:#9CA3AF;font-weight:500">LABEL</span>
  <div style="flex:1;height:1px;background:#E5E7EB"></div>
</div>

<!-- Dotted separator -->
<div style="border-top:2px dashed #E5E7EB;margin:20px 0"></div>

28. Timeline

A left-border div with color-coded dot markers — change the dot background per step. Supports inline math.

Initialize weights
Step 0 — Xavier / He initialization
Draw weights from $\mathcal{N}(0, \sqrt{2/n})$ to keep activations well-scaled.
Forward pass
Each batch — compute $\hat{y} = f(X; \theta)$
Push activations through every layer in sequence to produce predictions.
Compute loss
Evaluate $\mathcal{L}(y, \hat{y})$
Cross-entropy for classification, MSE for regression — scalar output to minimize.
Backpropagation
Chain rule — $\nabla_\theta \mathcal{L}$ for every parameter
Automatic differentiation walks backwards through the computation graph.
Update weights
Optimizer step — $\theta \leftarrow \theta - \eta \nabla_\theta \mathcal{L}$
Adam, AdamW, or SGD apply the gradients; repeat until convergence.
<div style="border-left:2px solid #E5E7EB;padding-left:20px;margin:16px 0">

  <div style="position:relative;margin-bottom:24px">
    <div style="position:absolute;left:-27px;top:4px;width:10px;height:10px;
                border-radius:50%;background:#2563EB;border:2px solid white;
                box-shadow:0 0 0 2px #2563EB"></div>
    <div style="font-weight:600">Event title</div>
    <div class="b3 text-muted">Subtitle or date</div>
    <div style="margin-top:4px;font-size:14px;color:#475569">
      Description — supports inline $math$ naturally.
    </div>
  </div>

  <!-- Repeat for each step, changing background color -->

</div>

Integration

Open a file in VS Code

[Open dashboard_server.py](/open-file?path=dashboard_server.py)
[Open style.css](/open-file?path=style.css)
[Open widgets/clock.py](/open-file?path=widgets/clock.py)

Open dashboard_server.py · Open style.css · Open widgets/clock.py

Relative .md links are automatically rewritten to /md/ dashboard URLs — works regardless of folder depth.

[Go to index](index.md)
[Notes](notes.md)
[Experiments](experiments/index.md)
[Project](projects/my_project.md)

Export to standalone HTML

Append ?export to any /md/ URL in the browser:

http://localhost:8030/md/guide.md?export

Generates guide_output.html in the project root — fully self-contained (CSS inlined, no server needed).


30. Feature Combinations

Real-world examples showing multiple features working together.

Note card + math + table

Link Budget Summary for the n78 (3.5 GHz) deployment:

Term Value
Tx power $P_t$ 23 dBm
Antenna gain $G_t + G_r$ 18 dBi
Free-space loss at 100m ~83 dB
Received power $P_r$ −42 dBm
Table 30.1: Note card + math + table

Using the Friis equation: $P_r = P_t G_t G_r \left(\tfrac{\lambda}{4\pi d}\right)^2$

Colored title + Mermaid + caption

PDU Session Establishment Flow
sequenceDiagram UE->>AMF: PDU Session Establishment Request AMF->>SMF: Nsmf_PDUSession_CreateSMContext SMF->>UPF: N4 Session Establishment (PFCP) UPF-->>SMF: N4 Session Establishment Response SMF-->>AMF: PDU Session Establishment Accept AMF-->>UE: PDU Session Establishment Accept
Figure 30.1: PDU session establishment — simplified N11 / N4 message sequence

See Figure 30.1 for the full session flow.

Note cards in a workflow

Step 1 — Configure AMF

Set plmn: "00101" and tac: 1 in /etc/open5gs/amf.yaml.

Step 2 — Start core NFs

sudo systemctl start open5gs-amfd open5gs-smfd open5gs-upfd
Verify with systemctl status open5gs-amfd.

Step 3 — Connect gNB

The N2 SCTP link should establish automatically. Check AMF logs:

journalctl -u open5gs-amfd -f | grep "gNB"

Troubleshooting — Registration Rejected

Check PLMN mismatch: UE PLMN must match AMF PLMN exactly, including leading zeros (00101 not 101).

Weight + color status table

Service Status Load Action
AMF Running 12% —
SMF Running 8% —
UPF High Load 87% Scale up
UDM Down — Restart
Table 30.2: Weight + color status table

Mixed layout — b1 title + note + equation + table + code

Gradient Descent
Optimization · iterative loss minimization

The goal is to minimize $\mathcal{L}(\theta)$ by iteratively stepping in the direction of the negative gradient.

Key idea — the gradient $\nabla_\theta \mathcal{L}$ points toward steepest ascent, so we move opposite.
$$ \theta^{(t+1)} = \theta^{(t)} - \eta \cdot \nabla_\theta \mathcal{L}\!\left(\theta^{(t)}\right) \tag{30.1} $$
Equation 30.1: Mixed layout — b1 title + note + equation + table + code
Variant Batch size Update
Batch GD Full dataset $\theta \leftarrow \theta - \eta \nabla \mathcal{L}$
SGD 1 sample One random sample per step
Mini-batch m samples Subset of m
Table 30.3: Mixed layout — b1 title + note + equation + table + code
for epoch in range(n_epochs):
    for x_batch, y_batch in dataloader:
        loss = model(x_batch, y_batch)
        loss.backward()
        optimizer.step()
        optimizer.zero_grad()
Tip — learning rate too large → diverges. Too small → slow. Use a scheduler.

31. Quick Reference Card

Category Feature Syntax
Server Start python dashboard_server.py
Export HTML Append ?export to any /md/ URL
Open in VS Code [label](/open-file?path=file.py)
Cross-file MD link [label](other.md) — auto-rewritten
Widgets Clock {​{ clock }}
Project status {​{ project_status }}
Task progress {​{ task_progress }}
Sine graph {​{ sine_graph }}
File index {​{ file_index: folder }}
Mermaid Any diagram ```mermaid ... ```
Flowchart LR flowchart LR
Flowchart TD flowchart TD
Subgraphs subgraph Name ... end
Sequence sequenceDiagram
Sequence autonumber Add autonumber after sequenceDiagram
State stateDiagram-v2
Gantt gantt
Pie pie title ...
Class classDiagram
ER diagram erDiagram
KaTeX in labels ["$$formula$$"]
Math Inline $formula$
Display block $$formula$$
Display shorthand Lone $ line opens/closes block
Captions Figure :::caption id="fig-l1-x" type="figure" title="…"
Table :::caption id="tab-l1-x" type="table" title="…"
Equation :::caption id="eq-l1-x" type="equation" title="…"
Cross-refs Figure @fig-l1-id
Table @tab-l1-id
Equation @eq-l1-id
Section @sec-l1-id
Sentence @par-l1-id
Section label ## Title {#sec-l1-id}
Sentence anchor [text]{#par-l1-id \| Label}
Note Cards Default <div class="note-card">
Blue <div class="note-card note-blue">
Green <div class="note-card note-green">
Yellow <div class="note-card note-yellow">
Red <div class="note-card note-red">
With Markdown Add markdown="1" to the div
Headings Lightweight <div class="b1/b2/b3">
Title variants <div class="title-thin/light/colored">
Font weight Numeric .fw-100 → .fw-900
Aliases .thin .light .regular .medium .semibold .bold
Text color Neutrals .text-black .text-dark .text-muted .text-soft
Colors .text-red .text-orange .text-yellow .text-green .text-blue .text-purple .text-pink
Backgrounds Classes .bg-soft .bg-blue-soft .bg-green-soft .bg-yellow-soft .bg-red-soft .bg-purple-soft
Images Size .img-xs .img-sm .img-md .img-lg .img-xl .img-full
Alignment .img-center .img-left .img-right .img-inline
Style .img-rounded .img-shadow .img-border
Tables Narrow (480px) <div class="table-narrow" markdown="1">
Mid (720px) <div class="table-mid" markdown="1">
Compact padding <div class="table-compact" markdown="1">
Left align col |:---|
Center align col |:---:|
Right align col |---:|
Figure containers Narrow (480px) <div class="fig-narrow">
Mid (700px) <div class="fig-mid">
Wide (1000px) <div class="fig-wide">
Columns 2-col <div class="col-2" markdown="1">
3-col <div class="col-3" markdown="1">
4-col <div class="col-4">
Card <div class="col-card">
Badges Blue <span class="badge badge-blue">label</span>
Green/Yellow/Red badge-green / badge-yellow / badge-red
Purple/Gray badge-purple / badge-gray
Math type Variable (italic) <span class="math-text">x</span>
Operator (roman) <span class="math-op">sin</span>
Inline Strikethrough ~~text~~
Highlight <mark>text</mark>
Change tracking <del>old</del> <ins>new</ins>
Abbreviation <abbr title="Full Name">Abbr</abbr>
Keyboard key <kbd>Cmd</kbd>
Task lists Done - [x] task
Pending - [ ] task
Collapsible Section <details><summary>Title</summary>…</details>
Table 31.1: Master syntax reference — every dashboard feature in one table

Capability & Architecture Report

This document considers the potential of the uploaded Markdown dashboard system as a technical documentation, AI-learning, RAN-engineering, and project-reporting workspace. It is designed for your current renderer, using native caption blocks, cross-references, Mermaid diagrams, Chart.js visualizations, KaTeX equations, and structured tables.

The key potential is that one .md file can become a live technical dashboard: explanation, diagrams, formulas, tables, charts, and references stay together in one maintainable source.

1. Executive summary

Your current setup has strong potential because it combines:

The result is not just a static note. It can be used as a living engineering report.

Use case Dashboard value Example content
AI learning notes High Equations, derivations, experiments, model diagrams
RAN troubleshooting Very high Alarm flows, topology, RCA, KPI charts
5G lab documentation Very high CU/DU/UE topology, Kubernetes state, SCTP paths
Project reporting High Status tables, progress charts, references
Personal knowledge base Medium-high Linked Markdown files, reusable templates
Table 1.1: High-level use cases for the Markdown dashboard.

As shown in Table 1.1, the strongest value is for topics where technical explanation + visual structure + formulas + measurable data must live together.

2. Rendering pipeline potential

The dashboard acts like a lightweight local publishing system. A Markdown file is read, preprocessed, converted to HTML, styled, and then enriched in the browser with Mermaid, Chart.js, and KaTeX.

flowchart LR A["Markdown source
.md file"] B["Python server
read + preprocess"] C["Reference index
sections, figures, tables, equations"] D["HTML output
Markdown converted to page"] E["Browser render
Mermaid + Chart.js + KaTeX"] F["Live dashboard
styled, linked, interactive"] A --> B --> C --> D --> E --> F %% -- dashboard status styles -- classDef ok fill:#DCFCE7,stroke:#16A34A,stroke-width:1.5px,color:#052E16; classDef warn fill:#FEF9C3,stroke:#CA8A04,stroke-width:1.5px,color:#422006; classDef err fill:#FCE7EF,stroke:#DB2777,stroke-width:1.5px,color:#500724; classDef crit fill:#FEE2E2,stroke:#DC2626,stroke-width:1.5px,color:#450A0A; classDef off fill:#F1F5F9,stroke:#94A3B8,stroke-width:1.5px,color:#111827; classDef info fill:#EFF6FF,stroke:#3B82F6,stroke-width:1.5px,color:#0C1E3E;
Figure 2.1: Markdown-to-dashboard rendering pipeline.

Figure 2.1 shows the main advantage: authoring remains simple, while the final output becomes visually rich.

3. Main capability matrix

Capability Input syntax Renderer Best for Potential
Sections # Title {#sec-l2-id} Markdown + preprocessor Navigable reports 5/5
Cross-reference @fig-l2-id, @tab-l2-id, @eq-l2-id, @sec-l2-id Python preprocessor Professional reports 5/5
Figures :::caption type="figure" Markdown + CSS Mermaid, SVG, images 5/5
Tables :::caption type="table" Markdown + CSS KPI, comparison, checklists 5/5
Equations :::caption type="equation" + $$...$$ KaTeX ML, DSP, RF, KPI formulas 5/5
Mermaid fenced mermaid block Mermaid.js Architecture and flows 5/5
Chart.js JSON config in HTML script Chart.js KPI and experiment plots 4/5
Live reload local server polling JavaScript Fast iterative writing 4/5
Python widgets widget placeholders/modules Python + HTML custom dashboards 4/5
Table 3.1: Capability matrix for the current dashboard concept.

Table 3.1 is the reason this system is suitable for your RAN, AI, SDR, and troubleshooting documentation workflows.

4. System architecture view

flowchart TB subgraph Authoring["Authoring layer"] MD["Markdown files"] CSS["style.css"] WID["widgets/ Python modules"] VID["videos/ assets"] end subgraph Server["Python HTTP server"] PATH["Path safety"] DISC["Markdown discovery"] PRE["Preprocessing"] REND["HTML rendering"] API["API endpoints"] end subgraph Browser["Browser runtime"] MMD["Mermaid"] KTX["KaTeX"] CJS["Chart.js"] UI["Live reload + copy buttons + checkboxes"] end MD --> DISC CSS --> REND WID --> PRE VID --> REND DISC --> PATH --> PRE --> REND --> Browser API --> UI MMD --> UI KTX --> UI CJS --> UI %% -- dashboard status styles -- classDef ok fill:#DCFCE7,stroke:#16A34A,stroke-width:1.5px,color:#052E16; classDef warn fill:#FEF9C3,stroke:#CA8A04,stroke-width:1.5px,color:#422006; classDef err fill:#FCE7EF,stroke:#DB2777,stroke-width:1.5px,color:#500724; classDef crit fill:#FEE2E2,stroke:#DC2626,stroke-width:1.5px,color:#450A0A; classDef off fill:#F1F5F9,stroke:#94A3B8,stroke-width:1.5px,color:#111827; classDef info fill:#EFF6FF,stroke:#3B82F6,stroke-width:1.5px,color:#0C1E3E;
Figure 4.1: Conceptual architecture of the local Markdown dashboard.

The system in Figure 4.1 can grow into a full local technical documentation portal. The most important design decision is that the source stays as Markdown, not a heavy database or CMS.

5. Request sequence

sequenceDiagram participant U as User participant B as Browser participant S as Python server participant P as Preprocessor participant R as Browser runtime U->>B: Open / or /md/file.md B->>S: HTTP GET page S->>S: Resolve safe Markdown path S->>P: Build references and preprocess blocks P-->>S: HTML body S-->>B: Full HTML page + CSS + scripts B->>R: Run Mermaid, Chart.js, KaTeX R-->>U: Rendered dashboard
Figure 5.1: Sequence diagram for opening a Markdown dashboard page.

Figure 5.1 shows why the workflow feels fast: the Python side prepares the structure, while the browser renders the visual layers.

6. State model

stateDiagram-v2 [*] --> WaitingForRequest WaitingForRequest --> ResolveMarkdown: GET / or /md/file.md ResolveMarkdown --> BuildReferenceIndex BuildReferenceIndex --> PreprocessMarkdown PreprocessMarkdown --> RenderHTML RenderHTML --> BrowserEnhancement BrowserEnhancement --> Ready Ready --> CheckTimestamp: live reload interval CheckTimestamp --> Ready: no change CheckTimestamp --> RefreshContent: file changed RefreshContent --> BrowserEnhancement
Figure 6.1: Dashboard page state model.

The state model in Figure 6.1 is useful when debugging live reload, missing references, or rendering problems.

7. Quantitative potential model

A simple potential score can combine four factors:

$$ P = 0.30V + 0.25M + 0.25R + 0.20A \tag{7.1} $$
Equation 7.1: Weighted dashboard potential score.

Where:

For this dashboard, a reasonable qualitative estimate is:

Factor Meaning Score from 0 to 10 Reason
$V$ Visual expressiveness 9 Mermaid, Chart.js, KaTeX, tables, captions
$M$ Maintainability 8 Plain Markdown source, local files, reusable syntax
$R$ Reusability 8 Can be reused for AI, RAN, SDR, KPI, and reports
$A$ Automation readiness 7 Python server and widgets create automation path
Table 7.1: Estimated input scores for the dashboard potential model.

Using Equation 7.1 and Table 7.1:

$$ P = 0.30(9) + 0.25(8) + 0.25(8) + 0.20(7) = 8.1 \tag{7.2} $$
Equation 7.2: Estimated dashboard potential result.

So the current dashboard potential is approximately 8.1 / 10, assuming it is used for technical documentation and not only for simple notes.

8. Chart.js example: potential score by capability

The following Chart.js block is wrapped in a caption, so it can be referenced as Figure 8.1.

Figure 8.1: Estimated potential score by dashboard capability.

The strongest individual capability in Figure 8.1 is the cross-reference system, because it turns normal notes into report-style documentation.

9. Chart.js example: maturity roadmap

Figure 9.1: Possible maturity roadmap for the dashboard system.

Figure 9.1 suggests that the next growth area is automation maturity, especially if Python widgets are expanded.

10. Mermaid journey: authoring experience

journey title Markdown dashboard authoring journey section Write Create rough notes: 4: User Add equations: 4: User Add tables: 5: User section Structure Add captions: 5: User Add cross-references: 5: User Add sections: 4: User section Visualize Add Mermaid diagrams: 5: User Add Chart.js charts: 4: User section Publish locally Run dashboard server: 5: User Review in browser: 5: User
Figure 10.1: Authoring journey from raw notes to polished technical dashboard.

Figure 10.1 shows that the system supports an iterative workflow: write first, then structure, then visualize.

11. Recommended folder structure

flowchart TB ROOT["as1900_kpi_dashboard/"] ROOT --> PY["dashboard_server.py"] ROOT --> CSS["style.css"] ROOT --> IDX["index.md"] ROOT --> NOTES["notes/"] ROOT --> ASSETS["assets/"] ROOT --> WIDGETS["widgets/"] ROOT --> VIDEOS["videos/"] NOTES --> AI["ai_learning.md"] NOTES --> RAN["ran_troubleshooting.md"] NOTES --> SDR["sdr_projects.md"] NOTES --> KPI["kpi_reports.md"] ASSETS --> IMG["images/"] ASSETS --> DATA["data/"] %% -- dashboard status styles -- classDef ok fill:#DCFCE7,stroke:#16A34A,stroke-width:1.5px,color:#052E16; classDef warn fill:#FEF9C3,stroke:#CA8A04,stroke-width:1.5px,color:#422006; classDef err fill:#FCE7EF,stroke:#DB2777,stroke-width:1.5px,color:#500724; classDef crit fill:#FEE2E2,stroke:#DC2626,stroke-width:1.5px,color:#450A0A; classDef off fill:#F1F5F9,stroke:#94A3B8,stroke-width:1.5px,color:#111827; classDef info fill:#EFF6FF,stroke:#3B82F6,stroke-width:1.5px,color:#0C1E3E;
Figure 11.1: Recommended project folder structure.

The folder structure in Figure 11.1 keeps the dashboard scalable without making it complicated.

12. Best Markdown patterns

Pattern Recommended syntax Why it helps
Section ID ## Title {#sec-l2-title} Enables @sec-l2-title links
Figure caption :::caption id="fig-l2-x" type="figure" title="..." Enables automatic numbering
Table caption :::caption id="tab-l2-x" type="table" title="..." Keeps tables referenceable
Equation caption :::caption id="eq-l2-x" type="equation" title="..." Keeps formulas numbered
Passage anchor [important sentence]{#par-l2-x \| label} Allows paragraph-level reference
Cross-reference @fig-l2-x, @tab-l2-x, @eq-l2-x Avoids manual numbering
Table 12.1: Recommended authoring patterns for long-term maintainability.

Table 12.1 is the most important practical table if you continue building reusable Markdown reports.

13. Equation examples for AI and RAN notes

For AI/ML documentation, the dashboard can show cost functions clearly:

$$ J(w,b) = \frac{1}{2m}\sum_{i=1}^{m}\left(\hat{y}^{(i)} - y^{(i)}\right)^2 \tag{13.1} $$
Equation 13.1: Mean squared error cost function.

For KPI or alarm scoring, you can define weighted severity:

$$ S = \alpha A_c + \beta A_m + \gamma T_d + \delta I_k \tag{13.2} $$
Equation 13.2: Weighted alarm severity score.

Where $A_c$ is critical alarm count, $A_m$ is major alarm count, $T_d$ is duration, and $I_k$ is KPI impact. Equation 13.2 is useful for RAN troubleshooting reports.

14. Example RAN troubleshooting flow

flowchart TD A["Alarm or KPI degradation detected"] B["Confirm NE/site identity"] C["Check active alarms"] D["Check recent changes"] E["Check transport and management reachability"] F["Check radio/baseband state"] G["Check KPI trend before/after event"] H["Decide: configuration, hardware, transport, or software issue"] I["Document RCA + action + evidence"] A --> B --> C --> D D --> E --> F --> G --> H --> I %% -- dashboard status styles -- classDef ok fill:#DCFCE7,stroke:#16A34A,stroke-width:1.5px,color:#052E16; classDef warn fill:#FEF9C3,stroke:#CA8A04,stroke-width:1.5px,color:#422006; classDef err fill:#FCE7EF,stroke:#DB2777,stroke-width:1.5px,color:#500724; classDef crit fill:#FEE2E2,stroke:#DC2626,stroke-width:1.5px,color:#450A0A; classDef off fill:#F1F5F9,stroke:#94A3B8,stroke-width:1.5px,color:#111827; classDef info fill:#EFF6FF,stroke:#3B82F6,stroke-width:1.5px,color:#0C1E3E;
Figure 14.1: Reusable RAN troubleshooting flow for alarms and KPI degradation.

Figure 14.1 can become a standard template for your AirScale, Airspan, Ericsson, or Huawei troubleshooting notes.

15. Arrow-label diagrams for process explanations

Yes — for many engineering diagrams, the most important information is not only the node, but the relationship between two nodes. Mermaid supports this by placing text directly on the arrow. This makes the diagram more readable because the arrow explains what action, data, check, or dependency connects two blocks.

flowchart LR A["Markdown file"] B["Python server"] C["HTML page"] D["Browser renderer"] E["Final dashboard"] A -->|read .md content| B B -->|convert + preprocess references| C C -->|load scripts and CSS| D D -->|render Mermaid, Chart.js, KaTeX| E %% -- dashboard status styles -- classDef ok fill:#DCFCE7,stroke:#16A34A,stroke-width:1.5px,color:#052E16; classDef warn fill:#FEF9C3,stroke:#CA8A04,stroke-width:1.5px,color:#422006; classDef err fill:#FCE7EF,stroke:#DB2777,stroke-width:1.5px,color:#500724; classDef crit fill:#FEE2E2,stroke:#DC2626,stroke-width:1.5px,color:#450A0A; classDef off fill:#F1F5F9,stroke:#94A3B8,stroke-width:1.5px,color:#111827; classDef info fill:#EFF6FF,stroke:#3B82F6,stroke-width:1.5px,color:#0C1E3E;
Figure 15.1: Basic Mermaid flowchart with descriptions in the middle of arrows.

As shown in Figure 15.1, the text between |...| appears in the middle of the arrow. This is useful for explaining data flow, troubleshooting logic, or decision paths.

flowchart TD A["Alarm received"] B["Check alarm context"] C["Check recent changes"] D["Check transport path"] E["Check radio/baseband state"] F{"Root cause clear?"} G["Apply fix"] H["Escalate with evidence"] I["Document RCA"] A -->|identify NE, alarm ID, timestamp| B B -->|compare with site history| C C -->|rule out config/deployment change| D D -->|ping, route, VLAN, SFP, LWL check| E E -->|hardware + software status checked| F F -->|yes: known issue found| G F -->|no: unclear after checks| H G -->|verify alarm cleared + KPI stable| I H -->|attach logs, screenshots, timeline| I %% -- dashboard status styles -- classDef ok fill:#DCFCE7,stroke:#16A34A,stroke-width:1.5px,color:#052E16; classDef warn fill:#FEF9C3,stroke:#CA8A04,stroke-width:1.5px,color:#422006; classDef err fill:#FCE7EF,stroke:#DB2777,stroke-width:1.5px,color:#500724; classDef crit fill:#FEE2E2,stroke:#DC2626,stroke-width:1.5px,color:#450A0A; classDef off fill:#F1F5F9,stroke:#94A3B8,stroke-width:1.5px,color:#111827; classDef info fill:#EFF6FF,stroke:#3B82F6,stroke-width:1.5px,color:#0C1E3E;
Figure 15.2: RAN troubleshooting diagram with action descriptions on each arrow.

Figure 15.2 is closer to what you mean: the arrow itself explains the reason or action between two troubleshooting steps.

flowchart TD START(["Start report"]) DATA{"Need measured data?"} CHART["Add Chart.js block"] DIAG{"Need process or topology?"} MERMAID["Add Mermaid diagram"] MATH{"Need formula?"} EQ["Add KaTeX equation"] TABLE{"Need comparison/checklist?"} TAB["Add captioned table"] REF["Add cross-references"] DONE(["Complete dashboard page"]) START -->|define report purpose| DATA DATA -->|yes: KPI, score, trend| CHART DATA -->|no: continue structure| DIAG CHART -->|explain chart in caption| DIAG DIAG -->|yes: flow, state, sequence, topology| MERMAID DIAG -->|no: skip diagram| MATH MERMAID -->|reference as @fig-l2-id| MATH MATH -->|yes: model, score, RF/DSP formula| EQ MATH -->|no: continue| TABLE EQ -->|reference as @eq-l2-id| TABLE TABLE -->|yes: matrix, checklist, risk list| TAB TABLE -->|no: continue| REF TAB -->|reference as @tab-l2-id| REF REF -->|connect sections, figures, tables, equations| DONE %% -- dashboard status styles -- classDef ok fill:#DCFCE7,stroke:#16A34A,stroke-width:1.5px,color:#052E16; classDef warn fill:#FEF9C3,stroke:#CA8A04,stroke-width:1.5px,color:#422006; classDef err fill:#FCE7EF,stroke:#DB2777,stroke-width:1.5px,color:#500724; classDef crit fill:#FEE2E2,stroke:#DC2626,stroke-width:1.5px,color:#450A0A; classDef off fill:#F1F5F9,stroke:#94A3B8,stroke-width:1.5px,color:#111827; classDef info fill:#EFF6FF,stroke:#3B82F6,stroke-width:1.5px,color:#0C1E3E;
Figure 15.3: Decision-oriented dashboard workflow with labeled arrows.

Figure 15.3 can be reused as a template for future technical reports.

Purpose Mermaid syntax Meaning
Normal labeled arrow A -->|description| B Solid arrow with a label in the middle
Dotted labeled arrow A -.->|optional path| B Weak/optional relation
Thick labeled arrow A ==>|important path| B Strong or critical relation
Decision branch A -->|yes| B and A -->|no| C Labels explain the branch condition
Long label A -->|check VLAN, route, SFP, LWL| B Good for technical troubleshooting steps
Table 15.1: Mermaid arrow-label syntax examples.

The syntax in Table 15.1 is the cleanest way to create the diagram style you described.

16. Risk and limitation table

Risk Impact Mitigation
Too much raw HTML inside Markdown Medium Use reusable snippets and keep naming consistent
Chart.js config becomes long Medium Keep one chart per section or move reusable configs to widgets
Mermaid labels can become crowded Medium Use shorter node labels and captions for detail
Local-only dashboard Low-medium Export HTML when sharing is needed
Manual data entry Medium Add Python widget/data loaders later
Missing reference IDs Low Dashboard highlights missing @ref links
Table 16.1: Risks and limitations to consider.

Table 16.1 is not a blocker. These are normal maintainability risks for any lightweight documentation system.

17. Recommended development roadmap

Phase Goal Concrete improvement
1 Stabilize authoring Create reusable Markdown templates
2 Standardize reports Add templates for AI, RAN RCA, KPI, SDR
3 Improve charts Create reusable Chart.js snippets
4 Add data automation Load CSV/JSON files into Python widgets
5 Export/share Add clean HTML/PDF export workflow
6 Knowledge base Link many .md files with global cross-references
Table 17.1: Suggested improvement roadmap.

The roadmap in Table 17.1 would turn the dashboard from a viewer into a personal technical knowledge platform.

18. Final recommendation

The dashboard has high potential for your work because it matches your learning and engineering style:

My recommendation is to use this dashboard as your main format for:

  1. AI learning notes.
  2. 5G lab documentation.
  3. RAN troubleshooting RCA reports.
  4. KPI dashboard explanations.
  5. SDR experiment logs.
  6. Technical meeting preparation.

The most valuable feature is not only the visual rendering. It is the combination of captions + references + equations + charts in one Markdown file. That combination makes the document feel like a small technical paper, but keeps the editing workflow simple.

19. Math display comparison

This section compares the main ways to show math inside the dashboard. The goal is to decide which math style is best for explanation, reporting, tables, diagrams, and code documentation.

19.1 Inline math inside normal text

Inline math is best when the formula is part of a sentence. For example, in linear regression, the prediction is written as $\hat{y} = w x + b$, where $w$ is the weight and $b$ is the bias.

Inline math should be used for short variables, short formulas, and references inside paragraphs. It keeps the reading flow natural.

19.2 Display equation without caption

Display math is better when the formula needs visual focus but does not need a formal reference.

$$ \hat{y}^{(i)} = w x^{(i)} + b \tag{19.1} $$
Equation 19.1: 2 Display equation without caption

This is clean for learning notes, but it cannot be referenced later unless it is wrapped in a caption block.

19.3 Captioned equation with cross-reference

A captioned equation is the best option for professional reports because it can be referenced later, like Equation 19.2.

$$ \hat{y}^{(i)} = w x^{(i)} + b \tag{19.2} $$
Equation 19.2: Linear regression prediction model.

Use this style when the equation is important and you want to refer to it from another section.

19.4 Multi-line aligned equation

For derivations, aligned equations are more readable than writing everything in one line. Equation 19.3 shows a compact gradient-descent update structure.

$$ \begin{align} w &:= w - \alpha \frac{\partial J(w,b)}{\partial w} \tag{19.3.1} \\ b &:= b - \alpha \frac{\partial J(w,b)}{\partial b} \tag{19.3.2} \end{align} $$
Equation 19.3: Gradient descent update for linear regression.

Equation 19.3.1 updates the weight parameter and Equation 19.3.2 updates the bias. Both rows together define one gradient descent step.

19.5 Math inside tables

Math inside tables is useful for comparing formulas, symbols, and meanings. Table 19.1 shows a clean table format.

Symbol Meaning Typical use
$x^{(i)}$ Input feature of sample $i$ Training data
$\hat{y}^{(i)}$ Predicted output Model output
$J(w,b)$ Cost function Optimization target
$\alpha$ Learning rate Gradient descent step size
Table 19.1: Example of math inside a table.

Use table math when formulas need comparison, not derivation.

19.6 Mermaid process diagram with equation references

Mermaid should be used for process structure, arrows, and relationships. For standard math typography, keep formulas outside Mermaid and reference proper LaTeX/KaTeX equations.

flowchart LR X["Input sample"] Z["Linear model"] Y["Prediction"] J["Cost function"] X -->|is passed to| Z Z -->|computes| Y Y -->|is compared with target| J %% -- dashboard status styles -- classDef ok fill:#DCFCE7,stroke:#16A34A,stroke-width:1.5px,color:#052E16; classDef warn fill:#FEF9C3,stroke:#CA8A04,stroke-width:1.5px,color:#422006; classDef err fill:#FCE7EF,stroke:#DB2777,stroke-width:1.5px,color:#500724; classDef crit fill:#FEE2E2,stroke:#DC2626,stroke-width:1.5px,color:#450A0A; classDef off fill:#F1F5F9,stroke:#94A3B8,stroke-width:1.5px,color:#111827; classDef info fill:#EFF6FF,stroke:#3B82F6,stroke-width:1.5px,color:#0C1E3E;
Figure 19.1: Mermaid process diagram using text labels and labeled arrows only.

The exact formulas for Figure 19.1 are shown separately in Equation 19.4, Equation 19.5, and Equation 19.6. This is the most standard approach because Mermaid draws the workflow, while KaTeX renders the mathematics.

19.7 Standard mathematical display only — avoid SVG text for formulas

The previous SVG/HTML-style card is not recommended for real mathematical notation. Even if it looks similar, SVG text or manually styled HTML can produce non-standard symbols, wrong spacing, and inconsistent hats, fractions, superscripts, and subscripts.

The most standard approach is:

  1. Use Mermaid only for the process structure.
  2. Use LaTeX/KaTeX equations separately for the mathematical definitions.
  3. Cross-reference the diagram and the equations together.

This gives clean diagram logic and proper mathematical typography.

flowchart LR X["Input feature"] Z["Linear score"] Y["Predicted output"] X -->|used by linear model| Z Z -->|converted to prediction| Y %% -- dashboard status styles -- classDef ok fill:#DCFCE7,stroke:#16A34A,stroke-width:1.5px,color:#052E16; classDef warn fill:#FEF9C3,stroke:#CA8A04,stroke-width:1.5px,color:#422006; classDef err fill:#FCE7EF,stroke:#DB2777,stroke-width:1.5px,color:#500724; classDef crit fill:#FEE2E2,stroke:#DC2626,stroke-width:1.5px,color:#450A0A; classDef off fill:#F1F5F9,stroke:#94A3B8,stroke-width:1.5px,color:#111827; classDef info fill:#EFF6FF,stroke:#3B82F6,stroke-width:1.5px,color:#0C1E3E;
Figure 19.2: Process structure shown without forcing math into SVG text.

The mathematical content of Figure 19.2 is then written with real LaTeX/KaTeX equations, not as SVG text.

$$ z^{(i)} = w x^{(i)} + b \tag{19.4} $$
Equation 19.4: Standard LaTeX display for the linear score.
$$ \hat{y}^{(i)} = z^{(i)} \tag{19.5} $$
Equation 19.5: Standard LaTeX display for the predicted output.
$$ J(w,b)=\frac{1}{2m}\sum_{i=1}^{m}\left(\hat{y}^{(i)}-y^{(i)}\right)^2 \tag{19.6} $$
Equation 19.6: Standard LaTeX display for the mean squared error cost function.

In Equation 19.4, Equation 19.5, and Equation 19.6, the symbols are rendered by KaTeX using real LaTeX syntax. This is the cleanest and most mathematically standard option.

The key point is: do not type symbols such as ŷ manually for formal math. Use \hat{y} inside LaTeX instead.

Display method Mathematical standard? Recommended use
$\hat{y}$ inline math Yes Short formula inside a sentence
$$\hat{y}^{(i)} = wx^{(i)}+b$$ display math Yes Main formula or derivation
Captioned equation block Yes Reports with references like Equation 19.5
Mermaid label with Input feature / Prediction Yes, for process only Diagrams where formulas are referenced separately
SVG text with ŷ or manual math styling No Avoid for formal mathematical notation
Raw HTML card containing $...$ Depends on renderer Use only if your renderer confirms KaTeX inside HTML
Table 19.2: 7 Standard mathematical display only — avoid SVG text for formulas

19.8 Code-style math display

Sometimes the goal is not to render the formula beautifully, but to show exactly what should be typed in Python, NumPy, or pseudo-code.

# Linear model prediction
y_hat = w * x + b

# Mean squared error
J = (1 / (2 * m)) * sum((y_hat[i] - y[i])**2 for i in range(m))
Figure 19.3: Code-style formula representation for implementation notes.

Use code-style math for implementation notes. Do not use it as the main explanation style for theoretical formulas.

19.9 Comparison table for math display methods

Table 19.3 compares the main options.

Math display method Syntax pattern Best for Cross-reference? Visual quality
Inline math $\hat{y}=wx+b$ Short formulas inside text No High
Display math $$...$$ Focused standalone formulas No Very high
Captioned equation :::caption type="equation" + $$...$$ Professional reports Yes Very high
Aligned equation \begin{aligned}...\end{aligned} Derivations and update rules Yes, if captioned Very high
Table math $x$, $J(w,b)$ inside table cells Symbol comparison Yes, table reference Medium-high
Mermaid process labels Normal text labels plus references to equations Workflow / topology diagrams Yes, figure reference High
LaTeX/KaTeX equations $...$, $$...$$, or captioned equation blocks Real mathematical notation Yes, if captioned Very high
Code-style math fenced code block Implementation formulas Yes, figure reference Medium
Table 19.3: Comparison of math display methods in the Markdown dashboard.

The best default choice is: inline math for sentences, captioned equations for important formulas, table math for comparison, and Mermaid only for process diagrams. Do not place formal formulas inside Mermaid/SVG text.

19.10 Decision flow for choosing math display style

Figure 19.4 gives a practical selection rule.

flowchart TD START["Need to show math?"] SHORT["Is it short and part of a sentence?"] INLINE["Use inline math
$...$"] IMPORTANT["Is it important enough to reference?"] CAPTIONED["Use captioned equation
@eq-l2-id"] DISPLAY["Use display equation
$$...$$"] COMPARE["Are you comparing symbols/formulas?"] TABLE["Use table math
@tab-l2-id"] DIAGRAM["Is it inside a flow/topology diagram?"] MERMAID["Use Mermaid process labels
then reference @eq-l2-id"] CODE["Is it implementation-focused?"] CODESTYLE["Use code-style math block"] START -->|yes| SHORT SHORT -->|yes| INLINE SHORT -->|no| IMPORTANT IMPORTANT -->|yes| CAPTIONED IMPORTANT -->|no| DISPLAY START -->|comparison table needed| COMPARE COMPARE -->|symbols side by side| TABLE START -->|visual flow needed| DIAGRAM DIAGRAM -->|nodes and arrows| MERMAID START -->|developer note| CODE CODE -->|Python / pseudo-code| CODESTYLE %% -- dashboard status styles -- classDef ok fill:#DCFCE7,stroke:#16A34A,stroke-width:1.5px,color:#052E16; classDef warn fill:#FEF9C3,stroke:#CA8A04,stroke-width:1.5px,color:#422006; classDef err fill:#FCE7EF,stroke:#DB2777,stroke-width:1.5px,color:#500724; classDef crit fill:#FEE2E2,stroke:#DC2626,stroke-width:1.5px,color:#450A0A; classDef off fill:#F1F5F9,stroke:#94A3B8,stroke-width:1.5px,color:#111827; classDef info fill:#EFF6FF,stroke:#3B82F6,stroke-width:1.5px,color:#0C1E3E;
Figure 19.4: Decision flow for choosing the right math display style.

The decision flow in Figure 19.4 keeps future documents consistent.

20. LaTeX-style math format

This section shows the recommended standard LaTeX/KaTeX style for mathematical notation in the dashboard. The goal is to avoid manual Unicode symbols such as ŷ, β, ∑, or visually styled SVG text when the content is mathematically important. For formal math, write the formula in LaTeX and let KaTeX render it.

20.1 Recommended rule

Use LaTeX syntax for all real math and use Mermaid only for the process/flow around the math.

Situation Recommended format Avoid
Prediction symbol $\hat{y}$ ŷ
Vector $\mathbf{x}$ or $\boldsymbol{x}$ plain x when vector meaning is needed
Subscript $x_i$ xi or x_i as plain text
Superscript sample index $x^{(i)}$ x(i)
Summation $\sum_{i=1}^{m}$ Unicode Σ in normal text
Greek parameters $\theta$, $\alpha$, $\lambda$ copied Greek characters in SVG/text
Operators $\log(x)$, $\sin(x)$, $\operatorname{ReLU}(z)$ italic words like log, ReLU
Important equation Captioned display equation Screenshot or manual SVG text
Table 20.1: Recommended LaTeX-style rules for standard math display.

As a simple rule: if the symbol has mathematical meaning, use LaTeX.

20.2 LaTeX-style display block template

Use this exact structure when you want a formula to look like normal LaTeX in the dashboard. The important part is that the formula is inside $$...$$, not inside SVG text, Unicode text, or a Mermaid node.

$$ \hat{y}^{(i)} = \mathbf{w}^{\mathsf{T}}\mathbf{x}^{(i)} + b \tag{20.1} $$
Equation 20.1: Recommended LaTeX-style display block template.

For derivations, use an aligned LaTeX environment:

$$ \begin{align} z^{(i)} &= \mathbf{w}^{\mathsf{T}}\mathbf{x}^{(i)} + b \tag{20.2.1} \\ \hat{y}^{(i)} &= g\!\left(z^{(i)}\right) \tag{20.2.2} \\ J(\mathbf{w},b) &= \frac{1}{2m}\sum_{i=1}^{m}\left(\hat{y}^{(i)}-y^{(i)}\right)^2 \tag{20.2.3} \end{align} $$
Equation 20.2: Recommended LaTeX-style aligned equation template.

Use Equation 20.1 or Equation 20.2 as the pattern for any formal mathematical section.

20.3 Inline LaTeX style

Use inline math for short notation inside a sentence. For example, the model receives an input vector $\mathbf{x}$, applies parameters $w$ and $b$, and produces the prediction $\hat{y}$.

Good inline examples:

The prediction is $\hat{y}$.
The input vector is $\mathbf{x}$.
The learning rate is $\alpha$.
The cost is $J(w,b)$.

20.4 Captioned LaTeX equation style

Use captioned equations for formulas that you want to reference later. Equation 20.3 shows a clean LaTeX-style linear model.

$$ \hat{y}^{(i)} = w x^{(i)} + b \tag{20.3} $$
Equation 20.3: Standard LaTeX-style linear model equation.

The prediction equation in Equation 20.3 is better than writing ŷ = wx + b because the hat, superscript sample index, spacing, and variables are rendered by the math engine.

20.5 Aligned derivation style

For step-by-step math, use aligned. Equation 20.4 shows standard notation for gradient descent.

$$ \begin{align} w &\leftarrow w - \alpha \frac{\partial J(w,b)}{\partial w} \tag{20.4.1} \\ b &\leftarrow b - \alpha \frac{\partial J(w,b)}{\partial b} \tag{20.4.2} \end{align} $$
Equation 20.4: Standard LaTeX-style aligned gradient descent update.

This is the preferred format for ML notes because the arrows, derivatives, and alignment are mathematically consistent.

20.6 Cost-function style

Use fractions and summations in LaTeX instead of plain-text approximations. Equation 20.5 is the recommended style.

$$ J(w,b) = \frac{1}{2m}\sum_{i=1}^{m}\left(\hat{y}^{(i)} - y^{(i)}\right)^2 \tag{20.5} $$
Equation 20.5: Standard LaTeX-style mean squared error cost function.

This is clearer than J(w,b)=1/2m sum((yhat-y)^2) because the fraction, summation limits, and exponent are displayed in standard mathematical form.

20.7 Matrix and vector style

For neural networks and linear algebra, prefer bold vectors/matrices and proper matrix environments. Equation 20.6 shows the recommended notation.

$$ \mathbf{z}^{[l]} = \mathbf{W}^{[l]}\mathbf{a}^{[l-1]} + \mathbf{b}^{[l]} \tag{20.6} $$
Equation 20.6: Standard LaTeX-style matrix-vector notation.

For explicit matrix display, use bmatrix as shown in Equation 20.7.

$$ \mathbf{W} = \begin{bmatrix} w_{11} & w_{12} & w_{13} \\ w_{21} & w_{22} & w_{23} \end{bmatrix} \tag{20.7} $$
Equation 20.7: Standard LaTeX-style matrix using bmatrix.

20.8 Piecewise function style

Use cases for piecewise definitions. Equation 20.8 shows a clean ReLU definition.

$$ \operatorname{ReLU}(z)= \begin{cases} z, & z > 0 \\ 0, & z \le 0 \end{cases} \tag{20.8} $$
Equation 20.8: Standard LaTeX-style piecewise ReLU definition.

Notice that \operatorname{ReLU} keeps the operator upright instead of italicizing it like a variable.

20.9 Diagram plus standard equation style

For diagrams, keep Mermaid labels simple and reference the real equation separately. Figure 20.1 shows the process, while Equation 20.3 gives the exact math.

flowchart LR X["Input sample"] -->|apply linear model| Z["Model output"] Z -->|compare with target| E["Error"] E -->|update parameters| P["New parameters"] %% -- dashboard status styles -- classDef ok fill:#DCFCE7,stroke:#16A34A,stroke-width:1.5px,color:#052E16; classDef warn fill:#FEF9C3,stroke:#CA8A04,stroke-width:1.5px,color:#422006; classDef err fill:#FCE7EF,stroke:#DB2777,stroke-width:1.5px,color:#500724; classDef crit fill:#FEE2E2,stroke:#DC2626,stroke-width:1.5px,color:#450A0A; classDef off fill:#F1F5F9,stroke:#94A3B8,stroke-width:1.5px,color:#111827; classDef info fill:#EFF6FF,stroke:#3B82F6,stroke-width:1.5px,color:#0C1E3E;
Figure 20.1: Flow diagram with labeled arrows while the exact math stays in LaTeX equations.

This combination is usually the best dashboard style: Mermaid explains the workflow, LaTeX explains the math.

20.10 LaTeX syntax cheat sheet

Purpose LaTeX source Rendered meaning
Hat prediction \hat{y} prediction value
Sample index x^{(i)} sample i
Feature index x_j feature j
Vector \mathbf{x} input vector
Matrix \mathbf{W} weight matrix
Layer index \mathbf{W}^{[l]} layer l weights
Partial derivative \frac{\partial J}{\partial w} gradient term
Summation \sum_{i=1}^{m} sum over samples
Norm \lVert \mathbf{w} \rVert_2^2 L2 norm
Operator \operatorname{softmax}(\mathbf{z}) named function
Table 20.2: LaTeX syntax cheat sheet for dashboard math.

20.11 Final recommendation

For this dashboard, the cleanest professional format is:

  1. Use $...$ for inline math.
  2. Use $$...$$ for display math.
  3. Use :::caption type="equation" for referenceable formulas.
  4. Use Mermaid for flows and arrows, not for formal formulas.
  5. Avoid manual Unicode math symbols in SVG/HTML unless they are only decorative.

21. Advanced LaTeX patterns for technical reports

This section adds more LaTeX patterns that are useful for AI, RAN KPI analysis, RF engineering, optimization, and signal processing notes.

21.1 Vectorized linear regression

For machine-learning notes, vectorized notation is cleaner than writing one sample at a time.

$$ \hat{\mathbf{y}} = \mathbf{X}\mathbf{w} + b\mathbf{1} \tag{21.1} $$
Equation 21.1: Vectorized linear regression prediction.

In Equation 21.1, $\mathbf{X}$ is the feature matrix, $\mathbf{w}$ is the weight vector, and $\mathbf{1}$ is a vector of ones.

21.2 Logistic regression and sigmoid

For classification, show the score and activation separately.

$$ \begin{align} z^{(i)} &= \mathbf{w}^{\mathsf{T}}\mathbf{x}^{(i)} + b \tag{21.2.1} \\ \hat{y}^{(i)} &= \sigma\!\left(z^{(i)}\right) \tag{21.2.2} \\ \sigma(z) &= \frac{1}{1+e^{-z}} \tag{21.2.3} \end{align} $$
Equation 21.2: Logistic regression prediction using the sigmoid function.

Equation 21.2 is a good example of using upright function notation and aligned equations.

21.3 Cross-entropy loss

For binary classification, use cross-entropy instead of mean squared error.

$$ J(\mathbf{w},b) = -\frac{1}{m} \sum_{i=1}^{m} \left[ y^{(i)}\log\!\left(\hat{y}^{(i)}\right) + \left(1-y^{(i)}\right)\log\!\left(1-\hat{y}^{(i)}\right) \right] \tag{21.3} $$
Equation 21.3: Binary cross-entropy loss.

Use Equation 21.3 when documenting logistic regression or neural-network binary classifiers.

21.4 Softmax notation

For multi-class classification, use \operatorname{softmax} so the function name stays upright.

$$ \hat{y}_k = \operatorname{softmax}(\mathbf{z})_k = \frac{e^{z_k}}{\sum_{j=1}^{K} e^{z_j}} \tag{21.4} $$
Equation 21.4: Softmax probability for class k.

21.5 RF and signal-processing notation

For SDR and wireless notes, complex baseband notation is useful.

$$ x[n] = I[n] + jQ[n] \tag{21.5} $$
Equation 21.5: Complex baseband signal representation.
$$ x[n] = \frac{1}{\sqrt{N}} \sum_{k=0}^{N-1} X[k]e^{j2\pi kn/N}, \qquad 0 \le n < N \tag{21.6} $$
Equation 21.6: Discrete-time OFDM symbol model.

Equation 21.5 and Equation 21.6 are useful for SDR, DVB-S2, LTE, and 5G physical-layer notes.

21.6 KPI normalization equation

For KPI dashboards, normalize mixed metrics before combining them.

$$ \tilde{x} = \frac{x-x_{\min}}{x_{\max}-x_{\min}} \tag{21.7} $$
Equation 21.7: Min-max normalization for KPI scoring.

A KPI score can then combine normalized metrics as shown in Equation 21.8.

$$ K = \sum_{r=1}^{R} \omega_r \tilde{x}_r, \qquad \sum_{r=1}^{R}\omega_r = 1 \tag{21.8} $$
Equation 21.8: Weighted KPI score from normalized indicators.

21.7 LaTeX quality checklist

Check Good style Avoid
Prediction hats \hat{y} manually typed ŷ
Named functions \operatorname{softmax} italic softmax
Vectors \mathbf{x} plain x when vector is intended
Matrix transpose \mathbf{W}^{\mathsf{T}} W^T as plain text
Fractions \frac{a}{b} a/b in formal equations
Derivatives \frac{\partial J}{\partial w} dJ/dw in display math
Conditions \begin{cases}...\end{cases} text-only if/else formulas
Long derivations \begin{aligned}...\end{aligned} one very long line
Table 21.1: Checklist for standard LaTeX-style math.

22. More Mermaid diagram templates

This section adds reusable Mermaid diagram templates for engineering reports. The key idea is to use Mermaid for structure, dependency, state, sequence, and decision logic, while keeping formal formulas in LaTeX sections.

22.1 RCA fishbone-style diagram

flowchart LR ROOT["Service degradation"] T["Transport"] R["Radio"] C["Configuration"] H["Hardware"] S["Software"] O["Operations"] T -->|route, VLAN, SFP, LWL| ROOT R -->|RET, VSWR, cell state| ROOT C -->|wrong parameter or missing route| ROOT H -->|module, PSU, fan, EEPROM| ROOT S -->|pod, image, version, process| ROOT O -->|planned work or rollout step| ROOT %% -- dashboard status styles -- classDef ok fill:#DCFCE7,stroke:#16A34A,stroke-width:1.5px,color:#052E16; classDef warn fill:#FEF9C3,stroke:#CA8A04,stroke-width:1.5px,color:#422006; classDef err fill:#FCE7EF,stroke:#DB2777,stroke-width:1.5px,color:#500724; classDef crit fill:#FEE2E2,stroke:#DC2626,stroke-width:1.5px,color:#450A0A; classDef off fill:#F1F5F9,stroke:#94A3B8,stroke-width:1.5px,color:#111827; classDef info fill:#EFF6FF,stroke:#3B82F6,stroke-width:1.5px,color:#0C1E3E;
Figure 22.1: RCA-style cause grouping diagram.

Use Figure 22.1 when the report needs to compare possible root-cause families.

22.2 Evidence chain diagram

flowchart LR A["Observation"] B["Log evidence"] C["Counter-check"] D["Hypothesis"] E["Fix action"] F["Validation"] G["RCA statement"] A -->|alarm, KPI, user impact| B B -->|timestamp + command output| C C -->|confirm from second source| D D -->|select likely root cause| E E -->|change, reset, replace, escalate| F F -->|alarm cleared + KPI stable| G %% -- dashboard status styles -- classDef ok fill:#DCFCE7,stroke:#16A34A,stroke-width:1.5px,color:#052E16; classDef warn fill:#FEF9C3,stroke:#CA8A04,stroke-width:1.5px,color:#422006; classDef err fill:#FCE7EF,stroke:#DB2777,stroke-width:1.5px,color:#500724; classDef crit fill:#FEE2E2,stroke:#DC2626,stroke-width:1.5px,color:#450A0A; classDef off fill:#F1F5F9,stroke:#94A3B8,stroke-width:1.5px,color:#111827; classDef info fill:#EFF6FF,stroke:#3B82F6,stroke-width:1.5px,color:#0C1E3E;
Figure 22.2: Evidence chain from observation to conclusion.

Figure 22.2 is useful for making an RCA report defensible.

22.3 Kubernetes troubleshooting flow

flowchart TD A["Pod not ready"] B["Check node state"] C["Check image availability"] D["Check ConfigMap and values"] E["Check service/endpoints"] F["Check logs and events"] G{"Root cause found?"} H["Fix deployment input"] I["Escalate with evidence"] A -->|kubectl get pods -A -o wide| B B -->|node Ready + resources OK| C C -->|image exists on correct node| D D -->|IP, port, route, placeholder check| E E -->|service selects correct pods| F F -->|crash reason or SCTP issue| G G -->|yes| H G -->|no| I %% -- dashboard status styles -- classDef ok fill:#DCFCE7,stroke:#16A34A,stroke-width:1.5px,color:#052E16; classDef warn fill:#FEF9C3,stroke:#CA8A04,stroke-width:1.5px,color:#422006; classDef err fill:#FCE7EF,stroke:#DB2777,stroke-width:1.5px,color:#500724; classDef crit fill:#FEE2E2,stroke:#DC2626,stroke-width:1.5px,color:#450A0A; classDef off fill:#F1F5F9,stroke:#94A3B8,stroke-width:1.5px,color:#111827; classDef info fill:#EFF6FF,stroke:#3B82F6,stroke-width:1.5px,color:#0C1E3E;
Figure 22.3: Kubernetes troubleshooting flow for CU/DU style deployments.

22.4 C4-style local dashboard context

flowchart TB USER["User / author"] DASH["Local Markdown dashboard"] FS["Local file system"] PY["Python runtime"] BR["Browser runtime"] OUT["Exported report"] USER -->|writes .md reports| FS FS -->|read Markdown, CSS, assets| DASH DASH -->|served by| PY PY -->|HTML + assets| BR BR -->|renders diagrams, charts, math| USER DASH -->|optional HTML/PDF export| OUT %% -- dashboard status styles -- classDef ok fill:#DCFCE7,stroke:#16A34A,stroke-width:1.5px,color:#052E16; classDef warn fill:#FEF9C3,stroke:#CA8A04,stroke-width:1.5px,color:#422006; classDef err fill:#FCE7EF,stroke:#DB2777,stroke-width:1.5px,color:#500724; classDef crit fill:#FEE2E2,stroke:#DC2626,stroke-width:1.5px,color:#450A0A; classDef off fill:#F1F5F9,stroke:#94A3B8,stroke-width:1.5px,color:#111827; classDef info fill:#EFF6FF,stroke:#3B82F6,stroke-width:1.5px,color:#0C1E3E;
Figure 22.4: C4-style context view for the local dashboard.

Figure 22.4 is a high-level architecture diagram for documentation of the dashboard project itself.

22.5 Diagram selection table

Diagram type Best use Example
flowchart Process, topology, decision logic troubleshooting path
sequenceDiagram Time-ordered interaction browser-server request
stateDiagram-v2 Status transitions page lifecycle, alarm lifecycle
journey User experience authoring workflow
gantt Timeline planning dashboard roadmap
mindmap Topic breakdown documentation taxonomy
classDiagram Software structure server classes/modules
Table 22.1: Which Mermaid diagram type to use.

23. More Chart.js templates

This section adds more Chart.js patterns for KPI and report dashboards.

23.1 Pie chart for report content mix

Figure 23.1: Example pie chart for report content mix.

23.2 Radar chart for dashboard capability profile

Figure 23.2: Example radar chart for dashboard capability profile.

23.3 Scatter chart for complexity versus value

Figure 23.3: Example scatter chart comparing implementation complexity and documentation value.

23.4 Chart selection table

Chart type Best use Avoid when
Bar Comparing categories Time order is the main message
Line Trends over time Categories are unordered
Pie/Doughnut Small part-to-whole view More than 6 slices
Radar Capability profile Exact value comparison is critical
Scatter Relationship between two variables Data is only categorical
Stacked bar Composition by category Too many small segments
Table 23.1: Which Chart.js chart type to use.

24. Reusable technical report template

This section gives a reusable structure for future reports.

Section Purpose Typical objects
1. Executive summary State the main conclusion short paragraph, status table
2. Scope Define system/site/problem boundary topology diagram
3. Current state Show evidence alarm table, KPI chart
4. Analysis Explain reasoning flowchart, equations, comparison table
5. Root cause State likely cause RCA diagram, evidence chain
6. Action plan Define next steps checklist, owner table
7. Validation Show result after action before/after chart
8. Appendix Keep raw details logs, commands, references
Table 24.1: Reusable structure for a technical dashboard report.

24.1 RCA mini-template

Field Content
Problem statement What failed and what was the user/network impact?
First detection time When was the issue detected?
Affected scope Site, NE, cell, sector, pod, VLAN, service
Evidence Alarms, logs, KPIs, screenshots, commands
Suspected cause Most likely technical cause
Action taken Fix, workaround, escalation, replacement
Validation Alarm cleared, KPI stable, service restored
Open points Remaining risk or follow-up
Table 24.2: Mini-template for RCA documentation.

24.2 Command-output documentation pattern

For Linux, Kubernetes, or RAN CLI outputs, keep a short command block and a short interpretation below it.

# Example command
kubectl get pods -A -o wide
Expected interpretation:
- Pod state should be Running or Completed.
- Node assignment should match the planned CU/DU role.
- Restart count should not continuously increase.
Figure 24.1: Recommended command-output documentation pattern.

25. Quality-control checklist before publishing

Before you consider a Markdown dashboard report final, run the following checks.

Area Check
References No missing @fig, @tab, @eq, or @sec links
Captions Every important diagram, table, chart, and equation has a caption
Math Formal formulas are written in LaTeX/KaTeX, not Unicode/SVG text
Diagrams Mermaid arrows are labeled when the relationship matters
Charts Chart titles, axes, and units are clear
Tables Tables have concise headers and do not duplicate paragraphs
Evidence Claims are supported by logs, KPIs, screenshots, or equations
Export The page still looks correct after reload/export
Table 25.1: Quality-control checklist before publishing.
flowchart TD A["Draft report"] B["Check captions"] C["Check references"] D["Check math rendering"] E["Check charts and axes"] F["Check evidence completeness"] G{"Ready to share?"} H["Export or send report"] I["Fix open issues"] A -->|content complete| B B -->|figures, tables, equations numbered| C C -->|all @refs resolve| D D -->|LaTeX renders correctly| E E -->|units and labels clear| F F -->|RCA supported by evidence| G G -->|yes| H G -->|no| I I -->|revise document| B %% -- dashboard status styles -- classDef ok fill:#DCFCE7,stroke:#16A34A,stroke-width:1.5px,color:#052E16; classDef warn fill:#FEF9C3,stroke:#CA8A04,stroke-width:1.5px,color:#422006; classDef err fill:#FCE7EF,stroke:#DB2777,stroke-width:1.5px,color:#500724; classDef crit fill:#FEE2E2,stroke:#DC2626,stroke-width:1.5px,color:#450A0A; classDef off fill:#F1F5F9,stroke:#94A3B8,stroke-width:1.5px,color:#111827; classDef info fill:#EFF6FF,stroke:#3B82F6,stroke-width:1.5px,color:#0C1E3E;
Figure 25.1: Finalization flow for a technical dashboard report.

Figure 25.1 is a practical final check before using the file as a real report.

26. Reference index

This section intentionally references the most important items so you can test cross-link behavior:


Chart & Diagram Gallery

Reference implementations of the gallery's charts and flowcharts. Every figure below is captioned and auto-numbered by section.

flowchart LR X["Input x"] Z1["z1=W1x+b1"] A1["a1=ReLU(z1)"] Y["$$\hat{y}$$"] X --> Z1 --> A1 --> Y %% -- dashboard status styles -- classDef ok fill:#DCFCE7,stroke:#16A34A,stroke-width:1.5px,color:#052E16; classDef warn fill:#FEF9C3,stroke:#CA8A04,stroke-width:1.5px,color:#422006; classDef err fill:#FCE7EF,stroke:#DB2777,stroke-width:1.5px,color:#500724; classDef crit fill:#FEE2E2,stroke:#DC2626,stroke-width:1.5px,color:#450A0A; classDef off fill:#F1F5F9,stroke:#94A3B8,stroke-width:1.5px,color:#111827; classDef info fill:#EFF6FF,stroke:#3B82F6,stroke-width:1.5px,color:#0C1E3E;
Figure 1.1: Neural Network Flowchart

Figure 2.1: Spectrum allocation by slice across eMBB, URLLC, and mMTC.

As shown in Figure 2.1, eMBB receives the largest spectrum share.


Active Users and Average Throughput
Active users
Average throughput Mbps
Figure 3.1: Comparison of active users and average throughput across four sites.

Active Users and Average Throughput
0 200 400 600 700 0 200 400 600 800 900 Users Mbps Site A Site B Site C Site D Active users Average throughput Mbps
Figure 4.1: Hand-built SVG chart of active users and average throughput with selectable axis labels.


Latency vs Throughput
0 200 400 600 800 1000 0 10 20 30 40 50 Latency ms Throughput Mbps Measurement samples
Figure 5.1: Relationship between latency and throughput across multiple measurement samples.

UE Connection State Chart
Power on Attach / registration Data session Release / inactivity Radio failure Failure recovery Idle Monitoring / waiting Registering Access / attach Connected User-plane active Failed Retry / fallback Idle state Registration state Connected state Failure state
Figure 6.1: UE connection state chart showing the simplified transition flow from idle to registering, connected, and failed states.


  1. This is the footnote — note the ↩ back-link. ↩