Restrict frontmatter visibility; wire CLI to crate-local module#269
Restrict frontmatter visibility; wire CLI to crate-local module#269
Conversation
Make the library frontmatter module crate-private and remove the\npublic re-export so external crates can no longer reach the\nhelper through mdtablefix internals.\n\nKeep the package binary behaviour unchanged by compiling the same\nfrontmatter helper source as a private module in src/main.rs.\nUpdate the helper docs to reflect its internal-only status.\n\ncloses #264
WalkthroughThe changes restrict visibility of the Changes
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 7 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (7 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideRestricts the YAML frontmatter helper to crate-local visibility, adjusts internal references in the CLI binary to use the crate-local module path, and updates documentation/examples to reflect that the helper is no longer part of the public API surface. File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
…vation Introduce a new internal module `frontmatter` to detect and split leading YAML frontmatter blocks in Markdown documents. This helper is used throughout the library's formatting pipeline and the CLI to ensure the frontmatter block is preserved byte-for-byte while formatting the rest of the Markdown body. The module is marked `pub(crate)` for internal use in the library and privately included in the CLI binary to avoid reopening the public API surface. This change ensures that all transforms correctly skip the frontmatter prefix, maintaining the exact original block and improving architectural clarity. It includes documentation updates and test coverage for detection, wrapping, and CLI flags related to frontmatter handling. Also fixes code fences in documentation and enhances docs readability with minor formatting fixes. Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
|
@coderabbitai Have the following failed checks now been resolved? If further work is required, please provide an AI agent prompt for the remaining work to be done to address these failures. ❌ Failed checks (2 warnings)
|
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 1075
No further work is required. |
Summary
Changes
API visibility
pub mod frontmatter;->pub(crate) mod frontmatter;#[doc(hidden)] pub use frontmatter::split_leading_yaml_frontmatter;is removed.pub fn split_leading_yaml_frontmatter(...)->pub(crate) fn split_leading_yaml_frontmatter(...).crate::frontmatter::split_leading_yaml_frontmatterand marking the example as ignore where appropriate.#[path = "frontmatter.rs"] mod frontmatter;use crate::frontmatter::split_leading_yaml_frontmatter;to access the function via the crate-local module.Documentation
src/frontmatter.rsto reflect the private API and useignorefor the code block.Build & Design
Testing
cargo build.cargo test(if any tests rely on the old public path forsplit_leading_yaml_frontmatter, they should be updated to access it via the crate-local module).mdtablefix::frontmatter::split_leading_yaml_frontmatter.◳ Generated by DevBoxer ◰
ℹ️ Tag @devboxerhub to ask questions and address PR feedback
📎 Task: https://www.devboxer.com/task/3595f452-d38d-4f20-a497-f96fde9fb589
📝 Closes #264
Summary by Sourcery
Restrict the YAML frontmatter helper to crate-internal use and update CLI and docs accordingly.
Enhancements:
Documentation:
📎 Task: https://www.devboxer.com/task/0a20179b-5148-4652-84dd-6326ef65c2b2