-
Notifications
You must be signed in to change notification settings - Fork 44
feat: enhance remark configuration with directive support #347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthroughAdds third-party remark-directive to the MDX remark pipeline with a safety wrapper and padding collapse, updates dev tooling, enhances a formatting script to track admonition indentation and normalize spacing, and applies many documentation whitespace, admonition, and small-content edits including a new VM vDisk expansion subsection. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Dev as Developer
participant MDX as MDX Build
participant Remark as Remark Pipeline
participant Dir as remark-directive
participant Wrap as wrapContainerDirectiveHandler
participant Post as collapseDirectivePadding
Dev->>MDX: trigger site build
MDX->>Remark: parse/transform MDX
Remark->>Dir: invoke directive processing
Dir->>Wrap: containerDirective handled via wrapper
Wrap-->>Dir: return AST with preserved state
Dir->>Post: collapse directive padding
Post-->>Remark: adjusted AST/markdown
Remark-->>MDX: final transformed output
MDX-->>Dev: build artifacts
note right of Wrap #f0f8ff: preserves bullet state (bulletLastUsed)
note right of Post #f7fff0: removes extra newlines around container directives
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Comment |
- Added `remark-directive` plugin to support custom directives in markdown. - Introduced a new function `directiveColonSafe` to handle directive padding correctly. - Updated `.remarkrc.mjs` and package files to include the new dependency. - Improved documentation formatting by ensuring proper indentation for admonitions.
d370df2 to
791acc7
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (3)
docs/unraid-os/troubleshooting/faq.mdx (1)
165-168: Approve enhanced warning checklist with spacing note.The additional bullet points strengthen the safety warnings for this destructive operation. The content is clear and appropriately emphasizes verification steps.
However, the blank lines between list items (lines 165, 167) create separate list blocks rather than a single cohesive list. Standard Markdown practice typically groups consecutive bullets without intervening blank lines.
If consistent list formatting is preferred, consider removing the blank lines:
- **Verify you have backups** of any data you need before proceeding - - **Double-check the device identifier** in the WebGUI or with `lsblk` before running this command - - **Ensure you're targeting the correct drive** - data loss from the wrong drive cannot be recoveredThis would render as a single bulleted list rather than three separate single-item lists. Only apply if this aligns with the project's documentation style guidelines.
scripts/format-crowdin-spacing.js (2)
341-360: Consider validating closing directives match openings.The code pops from
admonitionIndentStackfor any line matching:::(line 341), but doesn't verify it actually closes an admonition directive. If a stray closing:::appears (perhaps from a different directive type or markdown artifact), it could consume a stack entry and cause incorrect indentation for subsequent closings.While the default to 0 when the stack is empty (line 343) prevents crashes, consider tracking opening/closing pairs more strictly or adding a validation check.
346-360: Redundant if/else branches can be simplified.Both branches of the
if (jsxStack.length > 0)condition perform identical operations (lines 346-360). The conditional check doesn't affect the logic, resulting in code duplication.Apply this diff to simplify:
- if (jsxStack.length > 0) { - if (line !== correctIndent + ':::') { - newLines.push(correctIndent + ':::'); - modified = true; - } else { - newLines.push(line); - } - } else { - if (line !== correctIndent + ':::') { - newLines.push(correctIndent + ':::'); - modified = true; - } else { - newLines.push(line); - } - } + if (line !== correctIndent + ':::') { + newLines.push(correctIndent + ':::'); + modified = true; + } else { + newLines.push(line); + }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (26)
.remarkrc.mjs(3 hunks)docs/unraid-os/advanced-configurations/optimize-storage/zfs-storage.mdx(0 hunks)docs/unraid-os/getting-started/set-up-unraid/configure-your-array.mdx(0 hunks)docs/unraid-os/getting-started/set-up-unraid/deploy-and-configure-unraid-os.mdx(0 hunks)docs/unraid-os/getting-started/what-is-unraid.mdx(0 hunks)docs/unraid-os/system-administration/advanced-tools/command-line-interface.mdx(0 hunks)docs/unraid-os/system-administration/advanced-tools/wake-on-lan.mdx(1 hunks)docs/unraid-os/system-administration/maintain-and-update/changing-the-flash-device.mdx(1 hunks)docs/unraid-os/system-administration/secure-your-server/securing-your-connection.mdx(1 hunks)docs/unraid-os/troubleshooting/common-issues/system-crashes-and-stability.mdx(0 hunks)docs/unraid-os/troubleshooting/diagnostics/udma-crc-errors.mdx(0 hunks)docs/unraid-os/troubleshooting/faq.mdx(3 hunks)docs/unraid-os/troubleshooting/licensing-faq.mdx(0 hunks)docs/unraid-os/using-unraid-to/create-virtual-machines/overview-and-system-prep.mdx(0 hunks)docs/unraid-os/using-unraid-to/create-virtual-machines/partials/windows-virtio-manual.mdx(1 hunks)docs/unraid-os/using-unraid-to/create-virtual-machines/unraid-as-a-vm.mdx(0 hunks)docs/unraid-os/using-unraid-to/create-virtual-machines/vm-conversion-and-migration.mdx(0 hunks)docs/unraid-os/using-unraid-to/create-virtual-machines/vm-setup.mdx(1 hunks)docs/unraid-os/using-unraid-to/create-virtual-machines/windows-on-a-vm.mdx(0 hunks)docs/unraid-os/using-unraid-to/manage-storage/apple-time-machine.mdx(1 hunks)docs/unraid-os/using-unraid-to/manage-storage/array-configuration.mdx(2 hunks)docs/unraid-os/using-unraid-to/manage-storage/partials/remove-data-disk-parity-preserve.mdx(0 hunks)docs/unraid-os/using-unraid-to/manage-storage/shares.mdx(0 hunks)docs/unraid-os/using-unraid-to/run-docker-containers/overview.mdx(0 hunks)package.json(2 hunks)scripts/format-crowdin-spacing.js(5 hunks)
💤 Files with no reviewable changes (15)
- docs/unraid-os/using-unraid-to/manage-storage/shares.mdx
- docs/unraid-os/getting-started/what-is-unraid.mdx
- docs/unraid-os/using-unraid-to/create-virtual-machines/windows-on-a-vm.mdx
- docs/unraid-os/using-unraid-to/run-docker-containers/overview.mdx
- docs/unraid-os/getting-started/set-up-unraid/configure-your-array.mdx
- docs/unraid-os/using-unraid-to/manage-storage/partials/remove-data-disk-parity-preserve.mdx
- docs/unraid-os/advanced-configurations/optimize-storage/zfs-storage.mdx
- docs/unraid-os/using-unraid-to/create-virtual-machines/overview-and-system-prep.mdx
- docs/unraid-os/troubleshooting/diagnostics/udma-crc-errors.mdx
- docs/unraid-os/system-administration/advanced-tools/command-line-interface.mdx
- docs/unraid-os/getting-started/set-up-unraid/deploy-and-configure-unraid-os.mdx
- docs/unraid-os/troubleshooting/common-issues/system-crashes-and-stability.mdx
- docs/unraid-os/using-unraid-to/create-virtual-machines/vm-conversion-and-migration.mdx
- docs/unraid-os/troubleshooting/licensing-faq.mdx
- docs/unraid-os/using-unraid-to/create-virtual-machines/unraid-as-a-vm.mdx
🔇 Additional comments (6)
docs/unraid-os/using-unraid-to/manage-storage/apple-time-machine.mdx (1)
22-22: Directive closing looks good.The standalone
:::correctly closes the nested caution block before the enclosing note, matching remark-directive’s expectations. 👍docs/unraid-os/system-administration/secure-your-server/securing-your-connection.mdx (1)
169-171: Inconsistency between AI summary and actual code.The AI summary claims that "caution/note content about local access issues when DNS is unavailable" was removed from the Redirects section. However, the code shows that this
:::noteblock (lines 169-171) is still present with the exact content about DNS unavailability issues.The formatting change on line 171 appears correct for closing the admonition directive.
docs/unraid-os/using-unraid-to/create-virtual-machines/vm-setup.mdx (1)
355-376: Guest OS expansion steps look greatCalling out the in-guest partition expansion with platform-specific pointers (and an LVM example) rounds out the vDisk workflow nicely.
docs/unraid-os/troubleshooting/faq.mdx (1)
178-178: LGTM: Admonition closing markers properly formatted.The closing
:::markers for the danger and important admonitions are correctly positioned and follow proper remark-directive syntax. These formatting adjustments improve consistency across the documentation.Also applies to: 297-297
docs/unraid-os/using-unraid-to/manage-storage/array-configuration.mdx (1)
1-1044: LGTM! Formatting improvements align with directive support enhancements.The changes in this file are consistent with the PR's objective to normalize admonition formatting. All modifications appear to be whitespace and reflow adjustments around directive blocks (:::note, :::tip, etc.), which will work correctly with the new remark-directive plugin support.
scripts/format-crowdin-spacing.js (1)
448-451: Early return guards correctly prevent spacing changes for indented directives.The guards that skip spacing modifications for directives with
indentLength > 0correctly handle indented admonitions (e.g., inside JSX blocks). TheadmonitionIndentStacktracks all admonitions regardless of indentation, ensuring closing:::delimiters receive the correct indent, while spacing adjustments are only applied at the root level.Also applies to: 464-467, 479-482
- Removed unnecessary trailing whitespace from various markdown files to improve readability and maintain consistency. - Ensured that all documentation files adhere to formatting standards, enhancing overall document quality.
remark-directiveplugin to support custom directives in markdown.directiveColonSafeto handle directive padding correctly..remarkrc.mjsand package files to include the new dependency.Before Submitting This PR, Please Ensure You Have Completed The Following:
Summary by CodeRabbit