|
| 1 | +// File: app/docs/getting-started/quick-reference/page.tsx |
| 2 | +// What: Quick reference for OSF syntax and blocks |
| 3 | +// Why: Give users a fast, scannable cheat sheet |
| 4 | +// Related: app/docs/getting-started/installation/page.tsx, app/docs/getting-started/first-document/page.tsx |
| 5 | + |
| 6 | +'use client'; |
| 7 | + |
| 8 | +import Link from 'next/link'; |
| 9 | +import Navigation from '@/components/Navigation'; |
| 10 | + |
| 11 | +export default function QuickReferencePage() { |
| 12 | + return ( |
| 13 | + <div className="min-h-screen bg-black text-white"> |
| 14 | + <Navigation dark /> |
| 15 | + <div className="container mx-auto px-4 py-12 max-w-5xl pt-24"> |
| 16 | + <div className="mb-10"> |
| 17 | + <h1 className="text-5xl font-bold mb-4 border-b-4 border-white pb-4">Quick Reference</h1> |
| 18 | + <p className="text-xl text-gray-300"> |
| 19 | + A fast, scannable cheat sheet for OmniScript Format blocks, directives, and syntax. |
| 20 | + </p> |
| 21 | + </div> |
| 22 | + |
| 23 | + {/* OSF in 60 seconds */} |
| 24 | + <section className="mb-12 border-2 border-white p-6"> |
| 25 | + <h2 className="text-2xl font-bold mb-4">OSF in 60 Seconds</h2> |
| 26 | + <div className="bg-black border-2 border-white p-4 font-mono text-sm text-green-400 overflow-x-auto"> |
| 27 | + <pre>{`@meta { |
| 28 | + title: "My First Document"; |
| 29 | + author: "Your Name"; |
| 30 | + date: "2025-10-16"; |
| 31 | + theme: corporate; |
| 32 | +} |
| 33 | +
|
| 34 | +@doc { |
| 35 | + # Welcome |
| 36 | + This is **bold**, this is *italic*, and this is \`code\`. |
| 37 | +
|
| 38 | + - Bullet one |
| 39 | + - Bullet two |
| 40 | +} |
| 41 | +
|
| 42 | +@slide { |
| 43 | + title: "Quick Start"; |
| 44 | + layout: TitleAndBullets; |
| 45 | + bullets { |
| 46 | + "Edit this text"; |
| 47 | + "Add blocks"; |
| 48 | + "Export to PDF"; |
| 49 | + } |
| 50 | +}`}</pre> |
| 51 | + </div> |
| 52 | + </section> |
| 53 | + |
| 54 | + {/* Blocks at a glance */} |
| 55 | + <section className="mb-12 border-l-4 border-green-500 pl-6"> |
| 56 | + <h2 className="text-4xl font-bold mb-6">Blocks at a Glance</h2> |
| 57 | + <div className="grid grid-cols-1 md:grid-cols-2 gap-4"> |
| 58 | + <div className="border-2 border-white p-4 bg-gray-900"> |
| 59 | + <h3 className="text-xl font-bold mb-2">@meta</h3> |
| 60 | + <p className="text-gray-300">Document metadata: title, author, date, theme.</p> |
| 61 | + </div> |
| 62 | + <div className="border-2 border-white p-4 bg-gray-900"> |
| 63 | + <h3 className="text-xl font-bold mb-2">@doc</h3> |
| 64 | + <p className="text-gray-300">Markdown-like document content and narrative text.</p> |
| 65 | + </div> |
| 66 | + <div className="border-2 border-white p-4 bg-gray-900"> |
| 67 | + <h3 className="text-xl font-bold mb-2">@slide</h3> |
| 68 | + <p className="text-gray-300">Presentation slides with layouts and bullets.</p> |
| 69 | + </div> |
| 70 | + <div className="border-2 border-white p-4 bg-gray-900"> |
| 71 | + <h3 className="text-xl font-bold mb-2">@sheet</h3> |
| 72 | + <p className="text-gray-300">Spreadsheet-style data tables and formulas.</p> |
| 73 | + </div> |
| 74 | + <div className="border-2 border-white p-4 bg-gray-900"> |
| 75 | + <h3 className="text-xl font-bold mb-2">@table</h3> |
| 76 | + <p className="text-gray-300">Markdown pipe tables with caption and styling.</p> |
| 77 | + </div> |
| 78 | + <div className="border-2 border-white p-4 bg-gray-900"> |
| 79 | + <h3 className="text-xl font-bold mb-2">@chart</h3> |
| 80 | + <p className="text-gray-300">Bar/line/pie charts from structured series data.</p> |
| 81 | + </div> |
| 82 | + <div className="border-2 border-white p-4 bg-gray-900"> |
| 83 | + <h3 className="text-xl font-bold mb-2">@diagram</h3> |
| 84 | + <p className="text-gray-300">Mermaid or Graphviz diagrams.</p> |
| 85 | + </div> |
| 86 | + <div className="border-2 border-white p-4 bg-gray-900"> |
| 87 | + <h3 className="text-xl font-bold mb-2">@code</h3> |
| 88 | + <p className="text-gray-300">Code blocks with language, caption, and highlights.</p> |
| 89 | + </div> |
| 90 | + </div> |
| 91 | + </section> |
| 92 | + |
| 93 | + {/* Tables */} |
| 94 | + <section className="mb-12 border-l-4 border-blue-500 pl-6"> |
| 95 | + <h2 className="text-4xl font-bold mb-6">@table</h2> |
| 96 | + <div className="bg-gray-900 border-2 border-blue-500 p-4 font-mono text-sm text-blue-200 overflow-x-auto"> |
| 97 | + <pre>{`@table { |
| 98 | + caption: "Regional Performance"; |
| 99 | + style: "bordered"; |
| 100 | + alignment: ["left", "right", "right", "center"]; |
| 101 | +
|
| 102 | + | Region | Q3 Revenue | Q4 Revenue | Growth | |
| 103 | + | --- | --- | --- | --- | |
| 104 | + | North America | $975K | $1,150K | +18% | |
| 105 | + | Europe | $748K | $880K | +17% | |
| 106 | + | APAC | $477K | $592K | +24% | |
| 107 | +}`}</pre> |
| 108 | + </div> |
| 109 | + </section> |
| 110 | + |
| 111 | + {/* Slides */} |
| 112 | + <section className="mb-12 border-l-4 border-purple-500 pl-6"> |
| 113 | + <h2 className="text-4xl font-bold mb-6">@slide</h2> |
| 114 | + <p className="text-gray-300 mb-4">Common layouts: <code>TitleOnly</code>, <code>TitleAndContent</code>, <code>TitleAndBullets</code>, <code>TwoColumn</code>.</p> |
| 115 | + <div className="bg-gray-900 border-2 border-purple-500 p-4 font-mono text-sm text-purple-200 overflow-x-auto"> |
| 116 | + <pre>{`@slide { |
| 117 | + title: "Key Metrics"; |
| 118 | + layout: TitleAndBullets; |
| 119 | + bullets { |
| 120 | + "Revenue up 20%"; |
| 121 | + "Churn down to 2%"; |
| 122 | + "New @table support"; |
| 123 | + } |
| 124 | +}`}</pre> |
| 125 | + </div> |
| 126 | + </section> |
| 127 | + |
| 128 | + {/* Sheets */} |
| 129 | + <section className="mb-12 border-l-4 border-green-500 pl-6"> |
| 130 | + <h2 className="text-4xl font-bold mb-6">@sheet</h2> |
| 131 | + <div className="bg-gray-900 border-2 border-green-500 p-4 font-mono text-sm text-green-200 overflow-x-auto"> |
| 132 | + <pre>{`@sheet { |
| 133 | + name: "Budget"; |
| 134 | + cols: [Item, Cost, Qty, Total]; |
| 135 | +
|
| 136 | + A2 = "Hosting"; |
| 137 | + B2 = 120; |
| 138 | + C2 = 12; |
| 139 | + D2 = =B2*C2; |
| 140 | +}`}</pre> |
| 141 | + </div> |
| 142 | + </section> |
| 143 | + |
| 144 | + {/* Includes */} |
| 145 | + <section className="mb-12 border-l-4 border-white pl-6"> |
| 146 | + <h2 className="text-4xl font-bold mb-6">@include</h2> |
| 147 | + <p className="text-gray-300 mb-4">Compose larger documents from modular files.</p> |
| 148 | + <div className="bg-gray-900 border-2 border-white p-4 font-mono text-sm text-gray-200 overflow-x-auto"> |
| 149 | + <pre>{`@include { path: "./sections/intro.osf"; } |
| 150 | +@include { path: "./sections/body.osf"; } |
| 151 | +@include { path: "./sections/conclusion.osf"; }`}</pre> |
| 152 | + </div> |
| 153 | + </section> |
| 154 | + |
| 155 | + {/* CLI Commands */} |
| 156 | + <section className="mb-12 border-l-4 border-orange-500 pl-6"> |
| 157 | + <h2 className="text-4xl font-bold mb-6">CLI Commands</h2> |
| 158 | + <div className="grid grid-cols-1 md:grid-cols-2 gap-4"> |
| 159 | + <div className="bg-gray-900 border-2 border-orange-500 p-4 font-mono text-sm text-orange-200"> |
| 160 | + <pre>{`osf parse file.osf`}</pre> |
| 161 | + <p className="mt-2 text-gray-300">Parse OSF into AST JSON.</p> |
| 162 | + </div> |
| 163 | + <div className="bg-gray-900 border-2 border-orange-500 p-4 font-mono text-sm text-orange-200"> |
| 164 | + <pre>{`osf render file.osf --format pdf`}</pre> |
| 165 | + <p className="mt-2 text-gray-300">Export to PDF/DOCX/PPTX/XLSX/HTML.</p> |
| 166 | + </div> |
| 167 | + <div className="bg-gray-900 border-2 border-orange-500 p-4 font-mono text-sm text-orange-200"> |
| 168 | + <pre>{`osf lint file.osf`}</pre> |
| 169 | + <p className="mt-2 text-gray-300">Validate syntax and schema.</p> |
| 170 | + </div> |
| 171 | + <div className="bg-gray-900 border-2 border-orange-500 p-4 font-mono text-sm text-orange-200"> |
| 172 | + <pre>{`osf format file.osf`}</pre> |
| 173 | + <p className="mt-2 text-gray-300">Normalize formatting.</p> |
| 174 | + </div> |
| 175 | + </div> |
| 176 | + </section> |
| 177 | + |
| 178 | + {/* Next Steps */} |
| 179 | + <section className="mb-12"> |
| 180 | + <h2 className="text-4xl font-bold mb-6">Next Steps</h2> |
| 181 | + <div className="grid grid-cols-1 md:grid-cols-3 gap-4"> |
| 182 | + <Link |
| 183 | + href="/docs/getting-started/installation" |
| 184 | + className="block p-6 border-2 border-white hover:bg-white hover:text-black transition-colors" |
| 185 | + > |
| 186 | + <h3 className="text-xl font-bold mb-2">Install CLI →</h3> |
| 187 | + <p className="text-sm opacity-80">Get OmniScript installed locally</p> |
| 188 | + </Link> |
| 189 | + <Link |
| 190 | + href="/docs/getting-started/first-document" |
| 191 | + className="block p-6 border-2 border-white hover:bg-white hover:text-black transition-colors" |
| 192 | + > |
| 193 | + <h3 className="text-xl font-bold mb-2">First Document →</h3> |
| 194 | + <p className="text-sm opacity-80">Create and export your first OSF file</p> |
| 195 | + </Link> |
| 196 | + <Link |
| 197 | + href="/playground" |
| 198 | + className="block p-6 border-2 border-white hover:bg-white hover:text-black transition-colors" |
| 199 | + > |
| 200 | + <h3 className="text-xl font-bold mb-2">Try Playground →</h3> |
| 201 | + <p className="text-sm opacity-80">Experiment in the browser</p> |
| 202 | + </Link> |
| 203 | + </div> |
| 204 | + </section> |
| 205 | + </div> |
| 206 | + </div> |
| 207 | + ); |
| 208 | +} |
0 commit comments