Reference
Markdown Components Reference
Markdown Components Reference
Live showcase of every supported markdown component — rendered exactly as it appears in articles. Use this page to verify rendering after index.php changes. Full syntax spec: note/markdown/MARKDOWN-COMPONENTS.md.
1. Callout Blocks
Four types: tip, warning, danger, info. PHP fenced block → styled div with colored left border.
2. Syntax Highlighting
Prism.js 1.29.0 with autoloader. Use standard fenced blocks with a language tag. Supported: python, javascript, bash, sql, json, css, php, and any Prism-supported language.
Rendered — Python:
def position_size(capital: float, risk_pct: float, stop_distance: float) -> float:
"""Kelly-safe position sizing: risk fixed % of capital per stop distance."""
return (capital * risk_pct) / stop_distance
# Example: $50k account, 1% risk, $0.50 stop
shares = position_size(50_000, 0.01, 0.50)
print(f"Position size: {shares:.0f} shares") # 1000 shares
Rendered — JavaScript:
const calcRiskReward = (entry, stop, target) => {
const risk = Math.abs(entry - stop);
const reward = Math.abs(target - entry);
return (reward / risk).toFixed(2);
};
console.log(calcRiskReward(185.20, 184.80, 186.20)); // "2.50"
Rendered — Bash:
# Deploy article to oyamori server
scp -i ~/.ssh/id_rsa article.md root@162.0.222.119:/home/logiceverything/oyamori/learning/_content/
ssh -i ~/.ssh/id_rsa root@162.0.222.119 \
"chown logiceverything:logiceverything /home/logiceverything/oyamori/learning/_content/article.md"
Rendered — JSON:
{
"symbol": "AAPL",
"side": "buy",
"qty": 100,
"type": "limit",
"limit_price": "185.20",
"time_in_force": "day"
}
3. TradingView Charts — Candlestick
Standard chart with lines:, markers:, and vlines:.
Candlestick — Lines, Markers, Vlines
4. TradingView Charts — Zones
zones: draws a price band using two createPriceLine() calls — upper line labeled, lower unlabeled.
Syntax:
zones:
- { price_hi: 184.50, price_lo: 183.00, color: "#ef4444", label: "Resistance Zone" }
Rendered:
Candlestick — Zones (Price Bands)
5. TradingView Charts — Line and Area
Line Chart
Area Chart
6. TradingView Charts — Histogram and Bar
Histogram (Volume-style)
Bar Chart (OHLC, no color)
trendlines: draws diagonal lines using LWC series primitives. Lines extend across the full chart width. Fields: time1, price1, time2, price2 (required) · color · label · width · style: solid|dashed.
Trendlines demo
7. Tables
Standard GFM tables with alignment.
| Component | Block type | Status | Complexity |
|---|---|---|---|
| Callout blocks | tip / warning / danger / info |
DONE | Easy |
| Syntax highlighting | python / javascript / bash |
DONE | Easy |
| Stat cards | stats |
DONE | Easy |
| Mermaid diagrams | mermaid |
DONE | Medium |
| Math / KaTeX | KaTeX display and inline math | DONE | Medium |
| Tabs | tabs |
DONE | Medium |
| Collapsible | details |
DONE | Easy |
| Raw HTML | html |
DONE | Easy |
| Comparison table | compare |
DONE | Medium |
| Calculators | calc type:position-size etc. |
DONE | Hard |
8. Standard Markdown
Headings
# H1 through ###### H6 — H1 reserved for article title, use H2–H4 in body.
Text Formatting
Bold — **text**
Italic — *text*
Strikethrough — ~~text~~
Inline code — `code`
Blockquote
"Price action is structure plus context, not structure alone. Structure is the entry trigger. Conviction validates the move."
Syntax: > text
Unordered List
- First item
- Second item
- Nested item
- Another nested item
- Third item
Ordered List
- Pre-market scan — macro backdrop check
- Sentiment gate — news score above threshold
- Technical confirmation — two aligned signals
- Entry — limit order, sized to 1% risk
Horizontal Rule
--- produces:
Inline Code
Use backticks for function_names(), variable_names, file/paths, and short commands.
Links
Oyamori Learning Hub — standard markdown link syntax.
Chart Color Reference
| Purpose | Color | Preview |
|---|---|---|
| Entry arrow | #D5477F |
Brand pink |
| Exit arrow | #888888 |
Muted gray |
| Resistance line | #ef4444 |
Red |
| Support line | #10b981 |
Green |
| Target / pivot | #f59e0b |
Amber |
| Event vline | #f59e0b |
Amber |
| Neutral zone | #888888 |
Gray |
9. Math — KaTeX
Block math uses double-dollar display mode — centered on its own line. Inline math uses backslash-paren notation inside running text. KaTeX 0.16.9 injected only on articles that contain math. Delimiters chosen to avoid conflict with plain currency values like $100.
Rendered — Kelly Criterion (block):
Where = win probability, = loss as fraction of capital, = gain as fraction of capital.
Rendered — Sharpe Ratio:
Where is expected excess return over the risk-free rate, and is the portfolio standard deviation.
Rendered — Position Sizing:
Rendered — Maximum Drawdown:
Rendered — inline example:
The profit factor is . A value above is considered a viable edge; above is strong.
10. Tabs
[Tab Name] headers inside a fenced tabs block → tabbed panels. Inner content parsed as full markdown. Inline JS injected once per page only when tabs are present.
Rendered — Position sizing across languages:
position_size = capital * risk_pct / stop_distance
$50k · 1% risk · $0.50 stop → 1,000 shares
positionSize = (capital, riskPct, stopDistance) => capital * riskPct / stopDistance
50000 × 0.01 ÷ 0.50 → 1000
shares = (capital × risk%) ÷ stop_distance
| Variable | Meaning | Example |
|---|---|---|
| capital | Account value | $50,000 |
| risk% | Max loss/trade | 1% = 0.01 |
| stop_distance | Entry − stop | $0.50 |
| shares | Result | 1,000 |
Rendered — Strategy comparison:
Holding: Seconds to 30 min
Best for traders who can monitor tick-by-tick and exit without hesitation on momentum loss.
Holding: 30 min to 4 hours
Best for traders who want macro-confirmed entries with structured profit targets and time stops.
Holding: Days to weeks
Best for traders who want defined risk, leverage, and lower time commitment than intraday styles.
11. Stat Cards
Key: Value pairs → flex grid of metric cards. Optional color hint via Key[color]: Value. Colors: green, red, amber, blue, muted. Default color is brand pink.
Rendered — Strategy summary (with color hints):
Rendered — Data feed comparison (default colors):
Rendered — Mixed muted/blue:
12. Collapsible Sections
Native HTML <details> — no JS. Title on same line as the fence tag. Inner body is full markdown.
Why does IEX miss 85% of trades?
IEX is a single exchange in a fragmented 16-exchange market. It captures roughly 5–15% of total equity volume on any given stock. The remaining 85–95% executes on NYSE, NASDAQ, BATS, Cboe, and the other venues. Each exchange operates independently with its own order book — trades on NASDAQ do not automatically appear in the IEX feed.
What is the difference between last trade price and NBBO ask?
Last trade price is historical — it tells you where the most recent fill happened, on any exchange. It may be seconds old.
NBBO ask is the current best available price across all 16 exchanges right now. When you place a market order, this is the price you will actually pay.
The two diverge under fragmented or fast-moving conditions. A bot using last trade price as its entry reference is comparing against a stale number.
When should I upgrade from a free data feed?
- Paper trading / swing holds (multi-day): Free IEX-based feed is fine. The lag is irrelevant at daily timeframes.
- Intraday strategies (30 min – 4 hr holds): Polygon Starter ($29/mo) minimum. SIP-consolidated coverage.
- Sub-minute scalping: Polygon Advanced or IBKR feed. Validate NBBO on every signal before entry.
- Sub-second execution: Direct SIP feed or co-located infrastructure. Free feeds are not viable.
13. Mermaid Diagrams
Mermaid 11 via ESM CDN. Injected only on articles that contain mermaid blocks. Supports flowchart, sequence, ER, pie, timeline, gitgraph, and more.
Rendered — Trade Decision Flowchart:
Rendered — Data Pipeline Sequence:
Rendered — Pie Chart:
14. Comparison Table
[Column Name] headers + Key: Value pairs → aligned comparison grid. Rows auto-aligned across all columns. Missing values show —. Supports same [color] hint as stat cards.
Rendered — Data feed comparison:
| IEX Free | Polygon Starter | IBKR Feed | Direct SIP | |
|---|---|---|---|---|
| Coverage | IEX only (~10% vol) | SIP-consolidated | Aggregated (near-SIP) | All 16 exchanges |
| Latency | Low | ~1–5ms | Low | Lowest |
| Cost | Free | $29/mo | Included with account | $1,000+/mo |
| Best For | Paper trading, learning | Swing / position bots | Any IBKR bot | Institutional / HFT |
| NBBO Access | No | Yes | Yes | Yes |
Rendered — Trading style comparison:
| Scalper | Day Trader | Swing Trader | |
|---|---|---|---|
| Holding Time | Seconds–30 min | 30 min–4 hrs | Days–weeks |
| Win Rate | 55–65% | 50–60% | 45–55% |
| Per-Trade Target | 0.5–2% | 1–3% | 3–10% |
| Risk Per Trade | 0.25–0.75% | 1–2% | 1–2% |
| Screen Time | 4–8 hrs/day | 2–4 hrs/day | 30 min/day |
| Data Feed Needed | SIP required | Aggregated | Free IEX fine |
15. Raw HTML Passthrough
```html fence → content passed directly to page output, no escaping. Use for iframes, custom embeds, or any layout not covered by other components. Server-authored content only — never pipe user input through this.
Rendered — Custom callout with inline style:
Rendered — Two-column layout:
Rendered — YouTube embed:
16. Interactive Calculators
calc type:{name} → self-contained interactive widget. Pure HTML + inline JS, no external dependencies. Four built-in types. Multiple calculators on same page use isolated IDs — no conflicts.
Available types: position-size · kelly · risk-reward · drawdown
Syntax: Fenced block with type: on the opening line — no body needed.
Position Size Calculator
Kelly Criterion Calculator
Risk / Reward Calculator
Drawdown Calculator
MC-11 — Widget Embeds
Use for: Interactive HTML tools, visualizers, and reference guides that go beyond what native markdown components can do. Widgets are self-contained single-file HTML apps hosted on the server.
Syntax — inline shortcode, place on its own line:
Example — Options Trading Jargon Guide:
File → URL mapping:
| Widget File | Shortcode | Full Screen URL | |
|---|---|---|---|
| Location | /widgets/files/ | — | — |
| Format | underscores | underscores or hyphens | hyphens |
| Example | options_trading_guide.html | options_trading_guide | /widgets/options-trading-guide/ |
| Syntax | — | [widget file='...'] | — |
| Route | — | — | /widgets/{slug}/ |
Requirements for new widget HTML files:
Notes: Processed after Parsedown on final HTML. Error shown if file not found. Gallery of all widgets at oyamori.com/widgets/.