Add org-roam workflow: ox-hugo export pipeline and example notes
- Add flake.nix dev shell with Node.js 22, Elixir, and Emacs+ox-hugo - Add scripts/export.exs: exports org-roam notes to content/ via ox-hugo, mirroring subdirectory structure and generating a fallback index.md - Add npm scripts: export, build:notes, serve:notes - Configure FrontMatter plugin for TOML (ox-hugo default output) - Replace ObsidianFlavoredMarkdown with OxHugoFlavouredMarkdown - Add example notes: Madrid public transport (metro, bus, roads) - Update README and AGENTS.md with org-roam workflow instructions
This commit is contained in:
40
AGENTS.md
40
AGENTS.md
@@ -17,6 +17,16 @@ Built with TypeScript, Preact, and unified/remark/rehype for markdown processing
|
||||
| Build Tool | esbuild |
|
||||
| Styling | SCSS via esbuild-sass-plugin |
|
||||
|
||||
## Environment
|
||||
|
||||
This is a Nix project. Use the provided `flake.nix` to enter a dev shell with Node.js 22 and npm:
|
||||
|
||||
```bash
|
||||
nix develop
|
||||
```
|
||||
|
||||
All `npm` commands below must be run inside the dev shell.
|
||||
|
||||
## Build, Lint, and Test Commands
|
||||
|
||||
```bash
|
||||
@@ -234,6 +244,36 @@ git branch -d feature/my-feature
|
||||
|
||||
**Merge direction:** `upstream → main → org-roam → feature/*`
|
||||
|
||||
## Org-Roam Workflow
|
||||
|
||||
Notes live in a **separate directory** outside this repo. The export script
|
||||
converts them to Markdown via ox-hugo, then Quartz builds the site.
|
||||
|
||||
### Tooling
|
||||
|
||||
The dev shell (`nix develop`) provides:
|
||||
|
||||
- `nodejs_22` — Quartz build
|
||||
- `elixir` — runs the export script
|
||||
- `emacs` + `ox-hugo` — performs the org → markdown conversion
|
||||
|
||||
### Export and build
|
||||
|
||||
```bash
|
||||
# Export only (wipes content/, exports all .org files)
|
||||
NOTES_DIR=/path/to/notes npm run export
|
||||
|
||||
# Export then build the site
|
||||
NOTES_DIR=/path/to/notes npm run build:notes
|
||||
|
||||
# Positional arg also works
|
||||
elixir scripts/export.exs /path/to/notes
|
||||
```
|
||||
|
||||
The export script (`scripts/export.exs`) runs Emacs in batch mode, calling
|
||||
`org-hugo-export-to-md` per file (per-file mode, not per-subtree). It uses
|
||||
YAML frontmatter (ox-hugo default). `content/` is wiped before each export.
|
||||
|
||||
## Important Notes
|
||||
|
||||
- **Client-side scripts**: Use `.inline.ts` suffix, bundled via esbuild
|
||||
|
||||
Reference in New Issue
Block a user