Skip to content

Conversation

@elibosley
Copy link
Member

@elibosley elibosley commented Sep 30, 2025

  • 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.

Before Submitting This PR, Please Ensure You Have Completed The Following:

  1. Are internal links to wiki documents using relative file links?
  2. Are all new documentation files lowercase, with dash separated names (ex. unraid-os.mdx)?
  3. Are all assets (images, etc), located in an assets/ subfolder next to the .md/mdx files?
  4. Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  5. Is the build succeeding?

Summary by CodeRabbit

  • Documentation
    • Standardized admonition formatting and spacing across many pages for cleaner rendering.
    • Removed or tightened outdated/redundant tips, warnings, and inline guidance across security, licensing, FAQs, WOL, ZFS, VM guides, shares, and Docker overview.
    • Added clearer vDisk expansion guidance with guest-OS partition steps and example commands.
    • Added urgent data-recovery cautions warning against dangerous operations (format/repair).
  • Chores
    • Improved markdown directive handling and updated formatting tooling for more reliable docs processing.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 30, 2025

📝 Walkthrough

Walkthrough

Adds 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

Cohort / File(s) Summary of Changes
Remark directive integration
./.remarkrc.mjs
Import and enable remark-directive; add directiveColonSafe, wrapContainerDirectiveHandler, and collapseDirectivePadding to safely handle container directives and collapse excess padding.
Tooling: package metadata
./package.json
Add remark-directive to devDependencies.
Formatting script: admonition handling
./scripts/format-crowdin-spacing.js
Add dynamic admonitionTypesGroup, admonitionIndentStack; precompile regexes; add indentation guards and JSX/code-block checks; normalize ::: open/close indentation and spacing transitions.
Docs: structural/whitespace fixes (many files)
docs/.../*.mdx (multiple files listed in diff)
Tighten/remove/add blank lines around admonitions/details, fix stray closing/opening markers, rewrap some tip/note/important blocks; mostly formatting-only edits.
Docs: content removals / edits
docs/unraid-os/getting-started/set-up-unraid/configure-your-array.mdx, docs/unraid-os/system-administration/secure-your-server/securing-your-connection.mdx, docs/unraid-os/troubleshooting/common-issues/system-crashes-and-stability.mdx, docs/unraid-os/troubleshooting/faq.mdx, docs/unraid-os/troubleshooting/licensing-faq.mdx, docs/unraid-os/using-unraid-to/create-virtual-machines/unraid-as-a-vm.mdx, docs/unraid-os/using-unraid-to/create-virtual-machines/vm-conversion-and-migration.mdx, docs/unraid-os/using-unraid-to/create-virtual-machines/windows-on-a-vm.mdx, docs/unraid-os/using-unraid-to/manage-storage/partials/remove-data-disk-parity-preserve.mdx, docs/unraid-os/using-unraid-to/manage-storage/array-configuration.mdx
Remove selected warnings, tips, and small instructional lines; rewrap some sections with different admonition types; reflow text. Procedures unchanged.
Docs: new guidance subsection
docs/unraid-os/using-unraid-to/create-virtual-machines/vm-setup.mdx
Add "Expanding the partition in your guest OS" header and guest-OS partition expansion guidance (Linux example); remove prior vDisk expansion note and related tips.
Docs: added danger warnings
docs/unraid-os/troubleshooting/common-issues/data-recovery.mdx
Add explicit danger warnings about formatting unmountable disks and risks of --repair, plus minor formatting (blank line after :::danger).

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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

I nibble colons and tidy every line,
Hop indent stacks until admonitions align.
I wrap directives with a careful paw,
Collapse extra padding — neatness, hurrah!
With pnpm in paw, the docs hop along; a merry build and a cheerful song. 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title succinctly highlights the primary feature change of adding directive support to the remark configuration and is directly aligned with the main modifications in the changeset. It’s a clear, concise single sentence that a teammate scanning PR history can immediately understand without extra noise.
Description Check ✅ Passed The description begins with a clear summary of the key code changes and then includes the exact five-item pre-submission checklist from the repository’s template, covering relative links, file naming, asset placement, duplicate PR checks, and build status. This matches the required structure and content.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/linting-issues-on-admonitions

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 288d2ce and 833aa15.

📒 Files selected for processing (1)
  • package.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • package.json

Comment @coderabbitai help to get the list of available commands and usage tips.

- 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.
@elibosley elibosley force-pushed the feat/linting-issues-on-admonitions branch from d370df2 to 791acc7 Compare September 30, 2025 17:42
@github-actions
Copy link
Contributor

github-actions bot commented Sep 30, 2025

PR Preview Action v1.6.2
Preview removed because the pull request was closed.
2025-09-30 19:31 UTC

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 recovered

This 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 admonitionIndentStack for 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

📥 Commits

Reviewing files that changed from the base of the PR and between c8a7419 and 791acc7.

⛔ Files ignored due to path filters (1)
  • package-lock.json is 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 :::note block (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 great

Calling 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 > 0 correctly handle indented admonitions (e.g., inside JSX blocks). The admonitionIndentStack tracks 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.
@elibosley elibosley merged commit 8e7e5de into main Sep 30, 2025
3 checks passed
@elibosley elibosley deleted the feat/linting-issues-on-admonitions branch September 30, 2025 19:29
@coderabbitai coderabbitai bot mentioned this pull request Oct 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants