Aozora Bunko Notation
unlistedby aozora-obsidian contributors
Render pure Aozora Bunko (青空文庫) notation — ruby, bouten, 縦中横, 字下げ, 外字, 返り点, accent decomposition — in Obsidian's preview pane. Powered by a bundled aozora-wasm parser; works on desktop and mobile alike.
aozora-obsidian
An Obsidian plugin that renders pure Aozora
Bunko (青空文庫) notation —
ruby (|漢字《かんじ》), bouten, 縦中横, [#…] annotations,
gaiji, 返り点 — inside the Obsidian preview pane and live-preview
editor.
This plugin treats .txt files (or .md files marked
aozora: true in front matter) as aozora-format input. For Markdown
with afm extensions see afm-obsidian.
Status
Alpha. Reading view + Live Preview rendering, .txt
auto-detection (底本: sniff + glob), UTF-8 / Shift_JIS / UTF-16
decoding, gaiji 3-mode (image / description / codepoint), and
settings-tab reactivity all implemented and unit-tested at C1 100%.
End-to-end mobile parity (iOS / Android Obsidian) is untested in
production.
What this gives you
- A markdown post-processor that walks paragraphs, headings, list
items, blockquotes, and table cells for aozora sentinels
(
|…《…》,[#…],〔…〕,※[#…]) and rewrites them into proper HTML at preview time. - A live-preview decorator (CodeMirror 6 ViewPlugin) for the edit pane. Selection-aware: when the cursor overlaps a decorated range the raw markup becomes editable again.
.txtrecognition: when a file's first 4 KiB contain底本:(the canonical Aozora-Bunko bibliographic header), or when the file matches a user-configured glob, the plugin treats the entire file as aozora.- A settings tab for: writing mode (horizontal / vertical), live
preview toggle, default encoding (UTF-8 / Shift_JIS), gaiji
fallback policy, automatic
.txtdetection, and glob list. Every toggle takes effect immediately — no plugin reload. - A bundled
aozora.wasmso that no external binary is needed — identical behaviour on macOS, Windows, Linux, iOS, and Android.
Existing prior art
k-quels/japanese-novel-ruby
is an Obsidian plugin that helps insert Japanese ruby and emphasis
markers. aozora-obsidian's scope is wider — full aozora-notation
rendering for both panes — but the projects are complementary;
authors who want both an inserter and a renderer can run them side by
side.
Install
From a release zip (end users)
- Download
aozora-obsidian-vX.Y.Z.zipfrom Releases. - Extract into
<vault>/.obsidian/plugins/aozora/. - Enable the plugin in Obsidian's community-plugin settings.
The release zip contains main.js, manifest.json, styles.css,
and aozora.wasm — no installation step besides the unzip.
From source (contributors)
The project is Docker-first; cargo / wasm-pack / bun / node never
land on the host. See CONTRIBUTING.md for the
full setup. Quickstart:
git clone git@github.com:P4suta/aozora-obsidian.git
git clone git@github.com:P4suta/aozora.git ../aozora # sibling repo
cd aozora-obsidian
just hooks # one-time lefthook install
just build # rebuilds aozora.wasm + main.js + check-wasm
ln -s "$PWD" "$OBSIDIAN_VAULT/.obsidian/plugins/aozora"
Bundling the WASM artefact
ADR-0001 says the plugin ships main.js + manifest.json +
styles.css + aozora.wasm. The first three come out of just build; the fourth is produced by just wasm, which runs inside the
Dockerfile's wasm-builder stage:
- wasm-pack compiles
crates/aozora-wasmfrom sibling../aozoratowasm32-unknown-unknown. - A fresh binaryen
wasm-opt -O3 --all-featuresover the artefact. The bundled wasm-opt that wasm-pack ships is too old for Rust 1.95's bulk-memory + sign-ext opcodes; aozora-wasm/Cargo.toml setswasm-opt = falseso we run binaryen ourselves. - The optimised
.wasmlands ataozora.wasm, plus the wasm-bindgen JS glue atpkg/.package.jsonresolves"aozora-wasm": "file:./pkg".
scripts/check-wasm.mjs runs as the last step of just build. It
asserts the artefact exists and stays under the 2 MiB bundle-size
budget. Set AOZORA_WASM_REQUIRED=0 to downgrade missing-artefact
to a warning (CI keeps the default hard-fail).
The plugin loads aozora.wasm from its install directory at runtime
via Obsidian's vault adapter — desktop and mobile alike, no fetch()
involved (ADR-0001).
Compatibility
- Obsidian ≥ 1.5.
- aozora parser bundled as WASM (target: aozora v0.2.5 onwards).
- Desktop (macOS / Windows / Linux) AND mobile (iOS / Android). ADR-0001.
Sibling projects
| Repo | Role |
|---|---|
P4suta/aozora | Aozora Bunko notation parser + WASM driver |
P4suta/aozora-tools | Editor tooling (formatter, LSP, tree-sitter) |
P4suta/aozora-hugo | Hugo module |
P4suta/aozora-zola | Zola theme |
P4suta/aozora-obsidian (this repo) | Obsidian plugin |
P4suta/aozora-logseq | Logseq plugin |
P4suta/aozora-pandoc | Pandoc Lua filter |
P4suta/aozora-typst | Typst package |
P4suta/aozora-epub | EPUB3 generator (parked) |
P4suta/afm | Markdown dialect on top of aozora |
Licence
Dual-licensed under Apache-2.0 OR MIT.
See NOTICE for third-party material.
For plugin developers
Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.