-
Notifications
You must be signed in to change notification settings - Fork 0
Add Mermaid diagrams, linting, and slide layout improvements #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
5d8d762
feat: add mermaid diagrams and node http-server for local preview
stiffneckjim 1665abb
fix: enable mermaid diagram rendering
stiffneckjim af19b24
fix: transform mermaid code blocks from language-mermaid to mermaid c…
stiffneckjim 5076178
refine: fit mermaid diagrams for 16:9 slides
stiffneckjim 04d587f
feat: add biome and markdownlint, fix linting issues
stiffneckjim 44e1b4e
fix: reduce slide typography and allow overflow scroll
stiffneckjim 96b93b4
Fix Marp dev server path
stiffneckjim e160be2
Merge branch 'main' into develop
stiffneckjim 43da5fe
fix: update slide content and markdownlint config
stiffneckjim 25cfcb3
Merge branch 'develop' into feature/add-network-diagrams
stiffneckjim 170bb23
Address code review comments
stiffneckjim 8f7c448
Fix pnpm-workspace.yaml: use valid v11 onlyBuiltDependencies syntax
stiffneckjim ffec647
Fix pnpm-workspace.yaml by removing stale invalid keys
stiffneckjim 1725413
Fix local dev Mermaid rendering
stiffneckjim 6c39692
Docs: update README for Mermaid dev pipeline
stiffneckjim File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| allowBuilds: | ||
| '@biomejs/biome': set this to true or false | ||
| onlyBuiltDependencies: | ||
| - '@biomejs/biome' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| import { execFileSync, spawn } from 'node:child_process'; | ||
| import net from 'node:net'; | ||
| import { watchFile } from 'node:fs'; | ||
| import path from 'node:path'; | ||
| import { fileURLToPath } from 'node:url'; | ||
|
|
||
| const __dirname = path.dirname(fileURLToPath(import.meta.url)); | ||
| const rootDir = process.cwd(); | ||
| const slidesFile = path.join(rootDir, 'slides.md'); | ||
| const buildScript = path.join(__dirname, 'build.mjs'); | ||
|
|
||
| let isBuilding = false; | ||
| let rebuildPending = false; | ||
|
|
||
| function isPortAvailable(port) { | ||
| return new Promise((resolve) => { | ||
| const tester = net.createServer(); | ||
|
|
||
| tester.once('error', () => resolve(false)); | ||
| tester.once('listening', () => { | ||
| tester.close(() => resolve(true)); | ||
| }); | ||
|
|
||
| tester.listen(port, '0.0.0.0'); | ||
| }); | ||
| } | ||
|
|
||
| async function findAvailablePort(startPort, maxAttempts = 20) { | ||
| for (let index = 0; index < maxAttempts; index += 1) { | ||
| const candidate = startPort + index; | ||
| if (await isPortAvailable(candidate)) { | ||
| return candidate; | ||
| } | ||
| } | ||
|
|
||
| throw new Error(`No available port found from ${startPort} to ${startPort + maxAttempts - 1}.`); | ||
| } | ||
|
|
||
| function buildDeck() { | ||
| if (isBuilding) { | ||
| rebuildPending = true; | ||
| return; | ||
| } | ||
|
|
||
| isBuilding = true; | ||
|
|
||
| try { | ||
| execFileSync('node', [buildScript], { | ||
| cwd: rootDir, | ||
| stdio: 'inherit', | ||
| }); | ||
| } finally { | ||
| isBuilding = false; | ||
|
|
||
| if (rebuildPending) { | ||
| rebuildPending = false; | ||
| buildDeck(); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| async function main() { | ||
| buildDeck(); | ||
|
|
||
| const requestedPort = Number(process.env.PORT ?? '8080'); | ||
| const port = await findAvailablePort(requestedPort); | ||
|
|
||
| if (port !== requestedPort) { | ||
| console.log(`[dev] Port ${requestedPort} is in use, using ${port} instead.`); | ||
| } | ||
|
|
||
| const server = spawn('pnpm', ['exec', 'http-server', 'dist', '-p', String(port), '-c-1', '-o'], { | ||
| cwd: rootDir, | ||
| stdio: 'inherit', | ||
| }); | ||
|
|
||
| watchFile(slidesFile, { interval: 500 }, (current, previous) => { | ||
| if (current.mtimeMs !== previous.mtimeMs) { | ||
| console.log('[dev] slides.md changed; rebuilding...'); | ||
| buildDeck(); | ||
| } | ||
| }); | ||
|
|
||
| function shutdown(code = 0) { | ||
| server.kill('SIGTERM'); | ||
| process.exit(code); | ||
| } | ||
|
|
||
| process.on('SIGINT', () => shutdown(0)); | ||
| process.on('SIGTERM', () => shutdown(0)); | ||
|
|
||
| server.on('exit', (code) => { | ||
| process.exit(code ?? 0); | ||
| }); | ||
| } | ||
|
|
||
| main().catch((error) => { | ||
| console.error(error); | ||
| process.exitCode = 1; | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.