{"id":50913221,"url":"https://github.com/p4suta/aozora","last_synced_at":"2026-06-16T12:02:37.347Z","repository":{"id":354375330,"uuid":"1223338303","full_name":"P4suta/aozora","owner":"P4suta","description":"Pure-functional Rust parser for 青空文庫記法 (Aozora Bunko notation): ルビ, 傍点, 縦中横, 外字, 返り点, indent containers, page breaks.","archived":false,"fork":false,"pushed_at":"2026-06-13T16:17:25.000Z","size":4842,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-13T16:22:16.293Z","etag":null,"topics":["aozora-bunko","cli","japanese","parser","ruby","rust","shift-jis","tategaki","typography"],"latest_commit_sha":null,"homepage":"https://p4suta.github.io/aozora/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/P4suta.png","metadata":{"files":{"readme":"README.ja.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-APACHE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-28T08:21:19.000Z","updated_at":"2026-06-13T16:17:29.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/P4suta/aozora","commit_stats":null,"previous_names":["p4suta/aozora"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/P4suta/aozora","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/P4suta%2Faozora","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/P4suta%2Faozora/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/P4suta%2Faozora/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/P4suta%2Faozora/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/P4suta","download_url":"https://codeload.github.com/P4suta/aozora/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/P4suta%2Faozora/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34404748,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-16T02:00:06.860Z","response_time":126,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aozora-bunko","cli","japanese","parser","ruby","rust","shift-jis","tategaki","typography"],"created_at":"2026-06-16T12:02:36.367Z","updated_at":"2026-06-16T12:02:37.342Z","avatar_url":"https://github.com/P4suta.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aozora\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/P4suta/aozora/actions/workflows/ci.yml\"\u003e\u003cimg alt=\"ci\" src=\"https://github.com/P4suta/aozora/actions/workflows/ci.yml/badge.svg\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/P4suta/aozora/actions/workflows/docs.yml\"\u003e\u003cimg alt=\"docs deploy\" src=\"https://github.com/P4suta/aozora/actions/workflows/docs.yml/badge.svg\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/P4suta/aozora/releases/latest\"\u003e\u003cimg alt=\"latest release\" src=\"https://img.shields.io/github/v/release/P4suta/aozora?display_name=tag\u0026sort=semver\"\u003e\u003c/a\u003e\n  \u003ca href=\"./LICENSE-APACHE\"\u003e\u003cimg alt=\"license\" src=\"https://img.shields.io/badge/license-Apache--2.0%20OR%20MIT-blue\"\u003e\u003c/a\u003e\n  \u003ca href=\"./rust-toolchain.toml\"\u003e\u003cimg alt=\"msrv\" src=\"https://img.shields.io/badge/rust-1.95-orange\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  🎮 \u003ca href=\"https://p4suta.github.io/aozora/playground/\"\u003e\u003cstrong\u003eプレイグラウンド\u003c/strong\u003e\u003c/a\u003e\n  · 📚 \u003ca href=\"https://p4suta.github.io/aozora/\"\u003e\u003cstrong\u003eハンドブック (mdbook)\u003c/strong\u003e\u003c/a\u003e\n  · 📖 \u003ca href=\"https://p4suta.github.io/aozora/api/aozora/\"\u003e\u003cstrong\u003eAPI リファレンス (rustdoc)\u003c/strong\u003e\u003c/a\u003e\n  · 📦 \u003ca href=\"https://github.com/P4suta/aozora/releases\"\u003e\u003cstrong\u003eリリース・バイナリ\u003c/strong\u003e\u003c/a\u003e\n  · 🇬🇧 \u003ca href=\"./README.md\"\u003e\u003cstrong\u003eEnglish\u003c/strong\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n**青空文庫記法** を解析する純粋関数型 Rust パーサ。\nルビ (`｜青梅《おうめ》`)、傍点 (`［＃「X」に傍点］`)、縦中横、\n外字参照 (`※［＃…、第3水準1-85-54］`)、訓点・返り点、\n字下げ・地寄せコンテナ\n(`［＃ここから2字下げ］… ［＃ここで字下げ終わり］`)、\n改ページ・改段に対応します。\n\nこのパーサは **CommonMark / Markdown を一切扱いません** ―― 純粋に\n青空文庫記法のみを対象としています。レンダラはセマンティックな\nHTML5 を出力し、レクサは構造化された診断情報を返します。AST は\n借用アリーナ上のツリーで、ソースバイトをコピーせず O(n) で走査\nできます。\n\n## インストール\n\n### ビルド済み CLI バイナリ\n\n`aozora` CLI のビルド済みバイナリは **Linux x86_64** / **macOS arm64** /\n**Windows x86_64** の3プラットフォーム向けに、毎リリースで\n[GitHub Releases](https://github.com/P4suta/aozora/releases) に\n添付されます。`aozora-vX.Y.Z-\u003ctarget\u003e.{tar.gz,zip}` 形式のアーカイブと\n`SHA256SUMS` がセットで配布されます。\n\n### ソースからビルド\n\n```sh\ncargo install --git https://github.com/P4suta/aozora --locked aozora-cli\n```\n\n(`main` の最新から build します。再現性が必要なら release tag に pin する形が\n[install 章](https://p4suta.github.io/aozora/getting-started/install.html) にあります。)\n\n### Rust ライブラリとして利用\n\n`Cargo.toml` のスニペット (現行リリース tag 入り) は\n[install 章](https://p4suta.github.io/aozora/getting-started/install.html#as-a-rust-library)\nに集約しています — 複数の README に tag を分散させるとリリース毎に書き換え\n漏れが出るため、handbook の 1 箇所だけで管理する形にしています。crates.io\n公開は v1.0 API 確定後の予定です。\n\nWASM / C ABI / Python バインディングについては\n[ハンドブックの Bindings 章](https://p4suta.github.io/aozora/bindings/rust.html)\nを参照してください。\n\n## クイックスタート\n\n```rust\nuse aozora::Document;\n\nlet source = \"｜青梅《おうめ》\".to_owned();\nlet doc = Document::new(source);\nlet tree = doc.parse();\n\nlet html: String = tree.to_html();\nlet canonical: String = tree.serialize();\nlet diagnostics = tree.diagnostics();\n\nassert_eq!(canonical, \"｜青梅《おうめ》\");\n```\n\n`Document` は [`bumpalo`](https://docs.rs/bumpalo) アリーナを所有し、\n`tree` はそのアリーナから借用します。`Document` を drop すると\n`Bump::reset` ひとつでツリー全体が解放されます。\n\n## CLI\n\n```sh\naozora check FILE.txt           # 字句解析・診断を出力\naozora fmt --check FILE.txt     # parse ∘ serialize の往復チェック\naozora render FILE.txt          # HTML を標準出力へ\naozora check -E sjis FILE.txt   # Shift_JIS ソース (青空文庫の標準)\n```\n\nすべてのサブコマンドは `-` (またはパス省略) で標準入力から読み込めます。\n詳細は [CLI リファレンス章](https://p4suta.github.io/aozora/ref/cli.html)\nを参照してください。\n\n## クレート構成\n\naozora は21クレートの workspace です。\n[`crates/aozora`](./crates/aozora) が公開ファサードで、ライブラリ\n利用者は通常このひとつだけインポートします。\n\n| クレート | 役割 |\n|---|---|\n| [`crates/aozora`](./crates/aozora) | 公開ファサード。`Document::parse() → AozoraTree\u003c'_\u003e` と `Diagnostic` 型、`SLUGS` カタログを提供。 |\n| [`crates/aozora-spec`](./crates/aozora-spec) | 共有型の単一の出所: `Span`, `TriggerKind`, `PairKind`, `Diagnostic`, PUA センチネル、`SLUGS` ディスパッチテーブル。内部依存なし。 |\n| [`crates/aozora-syntax`](./crates/aozora-syntax) | AST ノード型 (`AozoraNode` 借用アリーナ variants, `ContainerKind`, `BoutenKind`, `Indent`)。 |\n| [`crates/aozora-encoding`](./crates/aozora-encoding) | Shift_JIS デコード + 外字解決 (PHF テーブル、JIS X 0213 + UCS フォールバック)。 |\n| [`crates/aozora-scan`](./crates/aozora-scan) | SIMD 対応マルチパターンスキャナ (Teddy / structural-bitmap / Hoehrmann-DFA / naive フォールバック)。 |\n| [`crates/aozora-veb`](./crates/aozora-veb) | Eytzinger 配置の sorted-set 検索 (キャッシュ親和的二分探索)。 |\n| [`crates/aozora-pipeline`](./crates/aozora-pipeline) | 4-phase 字句解析 (sanitize → events → pair → classify) + `lex_into_arena` オーケストレータ。 |\n| [`crates/aozora-render`](./crates/aozora-render) | HTML / canonical シリアライザ ―― `html::render_to_string`, `serialize::serialize`。 |\n| [`crates/aozora-cst`](./crates/aozora-cst) | rowan ベースのロスレス具象構文木 (CST)。エディタ/フォーマッタ向け。 |\n| [`crates/aozora-query`](./crates/aozora-query) | tree-sitter 風パターン DSL (`SyntaxKind` + capture)。CST に対するクエリ。 |\n| [`crates/aozora-pandoc`](./crates/aozora-pandoc) | Pandoc AST への射影 (`AozoraTree` → `pandoc_ast::Pandoc`)。50+ 出力フォーマットに繋がる。 |\n| [`crates/aozora-cli`](./crates/aozora-cli) | `aozora` バイナリ本体: `check` / `fmt` / `schema` / `kinds` / `explain` / `pandoc`。 |\n| [`crates/aozora-wasm`](./crates/aozora-wasm) | `wasm32-unknown-unknown` ターゲット (`wasm-pack build --target web`)。 |\n| [`crates/aozora-ffi`](./crates/aozora-ffi) | C ABI ドライバ (オペーク・ハンドル + JSON 構造化データ)。 |\n| [`crates/aozora-py`](./crates/aozora-py) | PyO3 バインディング、`maturin` で配布。 |\n| [`crates/aozora-bench`](./crates/aozora-bench) | Criterion + コーパス駆動プローブ (PGO トレーニング元)。 |\n| [`crates/aozora-conformance`](./crates/aozora-conformance) | WPT 形式の準拠スイートランナー (HTML / serialize / diagnostics / wire を 4 軸でゴールデン比較)。 |\n| [`crates/aozora-corpus`](./crates/aozora-corpus) | コーパス抽象化 (sweep テスト用、dev 限定。`AOZORA_CORPUS_ROOT` で参照)。 |\n| [`crates/aozora-proptest`](./crates/aozora-proptest) | proptest 用ストラテジ共有 (`aozora_fragment` / `pathological_aozora` / `unicode_adversarial` ほか、 dev 限定)。 |\n| [`crates/aozora-trace`](./crates/aozora-trace) | samply トレース用 DWARF シンボリケータ。 |\n| [`crates/aozora-xtask`](./crates/aozora-xtask) | リポジトリ自動化 (samply ラッパ、トレース解析、コーパス pack/unpack、 schema dumps)。 |\n\nクレート間の階層構造の詳細は\n[Architecture → Crate map](https://p4suta.github.io/aozora/arch/crates.html)\nを参照してください。\n\n## 開発\n\nすべての操作は Docker 内で実行します ―― ホスト側の toolchain は\n触りません。dev イメージを一度ビルドし、あとは `just` 経由で実行\nします。\n\n```sh\njust                # ターゲット一覧\njust build          # cargo build --workspace --all-targets\njust test           # cargo nextest run --workspace\njust prop           # property ベースのスイープ (block あたり 128 ケース)\njust lint           # fmt + clippy pedantic+nursery + typos + strict-code\njust deny           # cargo-deny licenses + advisories + bans\njust coverage       # cargo llvm-cov による branch coverage\njust ci             # CI パイプラインの完全レプリカ\njust book-build     # mdbook ハンドブックをビルド\njust book-serve     # localhost:3000 でハンドブックをライブプレビュー\n```\n\nCLI をコンテナ内で起動するには `just run` を使います:\n\n```sh\njust run check FILE.txt\njust run render -E sjis FILE.txt \u003e out.html\n```\n\nコントリビュートの詳細は\n[CONTRIBUTING.md](./CONTRIBUTING.md) または\n[ハンドブックの Contributing 章](https://p4suta.github.io/aozora/contrib/dev.html)\nを参照してください。\n\n## ドキュメント\n\n- 📚 [**ハンドブック**](https://p4suta.github.io/aozora/) ―― mdbook による\n  包括的なドキュメント (記法リファレンス、アーキテクチャ、性能、\n  バインディング、コントリビュート)。\n- 📖 [**API リファレンス**](https://p4suta.github.io/aozora/api/aozora/)\n  ―― 自動デプロイされる rustdoc。\n- [`CONTRIBUTING.md`](./CONTRIBUTING.md) ―― 開発フロー、TDD ポリシー、\n  PR ルール。\n- [`SECURITY.md`](./SECURITY.md) ―― 脆弱性報告窓口。\n- [`CHANGELOG.md`](./CHANGELOG.md) ―― リリース履歴。\n\n## 関連プロジェクト\n\n| Repo | 概要 |\n|---|---|\n| [`P4suta/afm`](https://github.com/P4suta/afm) | CommonMark + GFM + 青空文庫記法 を統合した Markdown 方言。aozora を基盤として構築。 |\n| [`P4suta/aozora-tools`](https://github.com/P4suta/aozora-tools) | オーサリングツール: フォーマッタ、LSP サーバ、tree-sitter 文法、VS Code 拡張。 |\n\n## ライセンス\n\n[Apache-2.0](./LICENSE-APACHE) または [MIT](./LICENSE-MIT) のデュアル\nライセンスです。利用者の選択に委ねられます (Rust コミュニティ慣例)。\nサードパーティの著作権表示は [`NOTICE`](./NOTICE) を参照してください\n(青空文庫の仕様スナップショット、テスト用パブリックドメイン作品)。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp4suta%2Faozora","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fp4suta%2Faozora","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp4suta%2Faozora/lists"}