Repository navigation
refactor: tidy up source accumulated through v0.9.0. - #13
Merged
Merged
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
変更理由
v0.9.0 までの機能追加で積み重なった重複を整理する。CLI の整理(互換性を壊す変更)は別の PR で出し、この PR は挙動をほぼ変えない。挙動が変わるのは下の 2 点だけ。
変更内容
Block::children()/children_mut()に統一した。 前はcollect_headings・gfm::promote_diagrams・diagram::resolve_blocks・azure_devops::post_process_blocksがそれぞれ container を列挙していて、どこまで降りるかが走査ごとに違っていた。```mermaidが diagram にならなかった。headings()(tの見出し一覧と[[_TOC_]])が、footnote 内の見出しも拾うようになった。Flavorはflavor/、MermaidModeはdiagram/、ThemeChoice(旧cli::Theme)はlayout/theme.rs、ColorChoiceはoutput/、InputSourceはinput.rsに置いた。cli::IconsSetは廃止してlayout::icons::IconSetにValueEnumを付けた。これでパイプラインがcrate::cliに依存しなくなった(残っているのはconfig.rsだけ)。--watchの reload でdocument::build(parse → diagram 描画)を共有した。restore()1 つにまとめた。image::has_scheme)1 つにした。tel:やvscode:のような://を持たないスキームのリンク先は、文書のディレクトリと連結せず、書かれたとおりに表示する。"│ "をBORDER定数にまとめた。ValueEnumから作るようにした。--lineをusizeで受けるようにした。layout/diagram.rsに切り出した。影響範囲
src/markdown/model.rs、src/flavor/、src/diagram/、src/layout/、src/pager/app.rs、src/cli.rs、src/config.rs、src/main.rs、src/input.rs、src/output/mod.rs、src/document.rs(新規).claude/rules/rendering.md/runtime.md: 走査の規約と reload の経路の記述を更新した。確認手順
cargo test --all-features: 349 + 24 + 53 件が通った。pager::watchの 2 件は、sandbox の中では FSEvents が届かないため除外した(CI で確認する)。cargo clippy --all-targets --all-features -- -D warnings/cargo fmt --check: 通った。fenced_mermaid_in_a_gfm_footnote_becomes_a_diagram、a_target_with_any_scheme_is_shown_as_writtenrestore()の中身は以前の 2 経路と同じ手順であることを差分で確認した。実機では確認していない。