Skip to content

Commit 8e7e5de

Browse files
authored
feat: enhance remark configuration with directive support (#347)
- 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](https://docusaurus.io/docs/markdown-features/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](../../../pulls) for the same update/change? 5. [ ] Is the build succeeding? <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## 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. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent c8a7419 commit 8e7e5de

File tree

28 files changed

+113
-135
lines changed

28 files changed

+113
-135
lines changed

.remarkrc.mjs

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import remarkFrontmatter from 'remark-frontmatter'
33
import remarkGfm from 'remark-gfm'
44
import remarkMdx from 'remark-mdx'
5+
import remarkDirective from 'remark-directive'
56
import remarkPresetLintRecommended from 'remark-preset-lint-recommended'
67
import remarkLintListItemIndent from 'remark-lint-list-item-indent'
78
import remarkLintOrderedListMarkerStyle from 'remark-lint-ordered-list-marker-style'
@@ -23,6 +24,8 @@ import jsxContentSpacing from './remark-jsx-spacing.js'
2324
const plugins = [
2425
// MDX support
2526
remarkMdx,
27+
remarkDirective,
28+
directiveColonSafe,
2629
remarkFrontmatter,
2730
remarkGfm,
2831

@@ -79,3 +82,58 @@ const remarkConfig = {
7982
};
8083

8184
export default remarkConfig
85+
86+
function directiveColonSafe() {
87+
const data = this.data()
88+
const extensions = data.toMarkdownExtensions || (data.toMarkdownExtensions = [])
89+
90+
for (const extension of extensions) {
91+
if (
92+
extension &&
93+
typeof extension === 'object' &&
94+
'handlers' in extension &&
95+
extension.handlers &&
96+
'containerDirective' in extension.handlers &&
97+
Array.isArray(extension.unsafe)
98+
) {
99+
extension.unsafe = extension.unsafe.filter(
100+
(rule) => rule.character !== ':'
101+
)
102+
103+
wrapContainerDirectiveHandler(extension)
104+
}
105+
}
106+
107+
data.toMarkdownExtensions = extensions
108+
}
109+
110+
function wrapContainerDirectiveHandler(extension) {
111+
const {containerDirective} = extension.handlers
112+
113+
if (typeof containerDirective !== 'function') {
114+
return
115+
}
116+
117+
extension.handlers.containerDirective = function wrappedContainerDirective(
118+
node,
119+
parent,
120+
state,
121+
info
122+
) {
123+
const previous = state.bulletLastUsed
124+
state.bulletLastUsed = undefined
125+
126+
try {
127+
const output = containerDirective(node, parent, state, info)
128+
return collapseDirectivePadding(output)
129+
} finally {
130+
state.bulletLastUsed = previous
131+
}
132+
}
133+
}
134+
135+
function collapseDirectivePadding(value) {
136+
return value
137+
.replace(/(^|\n)([ \t]*:::[^\n]*?)\n\n/g, '$1$2\n')
138+
.replace(/\n\n([ \t]*:::)/g, '\n$1')
139+
}

docs/unraid-os/advanced-configurations/optimize-storage/zfs-storage.mdx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,7 @@ Unraid can import %%ZFS|zfs%% pools created on other platforms with minimal hass
263263
5. **Finish and start array:** Click **Done**, then start the %%array|array%%.
264264

265265
:::info[Automatic detection]
266-
267266
Unraid will automatically detect and import the %%ZFS|zfs%% pool. Support vdevs (like log, cache/L2ARC, special/dedup) are listed under **Subpools** in the %%WebGUI|web-gui%%. There is no need to add subpools separately after initiating the import. Unraid will automatically import them alongside the main data disks when all required drives are assigned.
268-
269267
:::
270268

271269
After importing, running a %%scrub|scrub%% is highly recommended to verify data integrity.

docs/unraid-os/getting-started/set-up-unraid/configure-your-array.mdx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,11 @@ Unraid OS uses drives for various purposes:
4646
To safeguard cached data, assign more than one device to the %%cache pool|cache-pool%%. A single device does not offer protection from data loss. %%Cache pools|cache-pool%% can be expanded on demand.
4747

4848
:::warning
49-
5049
SSD support is experimental in the %%array|array%%. Some SSDs may not perform well due to variations in %%TRIM/Discard|trim-discard%% implementation, which could lead to undesirable results. This does not apply to %%cache pools|cache-pool%%. [Learn more about filesystem options here](../../using-unraid-to/manage-storage/file-systems.mdx).
51-
5250
:::
5351

5452
:::note
55-
5653
SSD-based pools are optimal for applications and virtual machines, leveraging SSD performance for faster interactions. [Learn more about running applications here](../../using-unraid-to/run-docker-containers/overview.mdx).
57-
5854
:::
5955

6056
</details>

docs/unraid-os/getting-started/set-up-unraid/deploy-and-configure-unraid-os.mdx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,9 @@ Before deploying Unraid OS, it's important to verify your system's BIOS and stor
105105
For further assistance, visit the [Unraid general support forum](https://forums.unraid.net/).
106106

107107
:::important
108-
109108
Many motherboards limit boot device selection to 12 hard drives. If your USB flash drive is recognized as a hard drive, you may not be able to boot from it after installing 12 physical hard drives. Configure the BIOS to treat the flash drive as a removable device whenever possible.
110109

111110
If using an add-on HBA, you may be able to disable INT 13h support to prevent its connected drives from appearing in the bootable devices list, helping to stay within the 12-drive limit.
112-
113111
:::
114112

115113
</details>

docs/unraid-os/getting-started/what-is-unraid.mdx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,7 @@ Unraid features a [user-friendly web interface](./explore-the-user-interface/tou
112112
Docker containers allow you to run applications in isolated, lightweight environments without the overhead associated with %%virtual machines|vm%%. Unraid simplifies the use of Docker by providing access to thousands of pre-configured apps through [Docker Hub](https://hub.docker.com/) and [Community Applications](../using-unraid-to/run-docker-containers/community-applications.mdx). This containerized approach enables Unraid users to run multiple applications simultaneously without compatibility issues. It also helps keep the system organized by using self-contained application packages and makes it easy to enhance server capabilities through Docker's ecosystem.
113113

114114
:::note
115-
116115
For advanced Docker settings, check out [Run Docker Containers](../using-unraid-to/run-docker-containers/managing-and-customizing-containers.mdx).
117-
118116
:::
119117

120118
</details>
@@ -125,9 +123,7 @@ Unraid features a [user-friendly web interface](./explore-the-user-interface/tou
125123
Unraid functions as a virtualization host, using a %%hypervisor|hypervisor%% to securely allocate resources to virtualized guests. This allows you to run various applications in isolated environments, going beyond just network-attached storage.
126124

127125
:::tip
128-
129126
To use hardware virtualization in Unraid, ensure your CPU, chipset, BIOS, and device drivers are compatible. A full list of requirements is available in the [VM setup guide](../using-unraid-to/create-virtual-machines/overview-and-system-prep.mdx). If your server doesn't meet these requirements, the %%VMs|vm%% menu will be disabled in the Unraid %%WebGUI|web-gui%%.
130-
131127
:::
132128

133129
<details>
@@ -188,9 +184,7 @@ Unraid features a [user-friendly web interface](./explore-the-user-interface/tou
188184
For %%VM|vm%% setup steps, check out [Create virtual machines](../using-unraid-to/create-virtual-machines/overview-and-system-prep.mdx).
189185

190186
:::caution
191-
192187
%%GPU passthrough|gpu-passthrough%% requires compatible hardware (see [VM setup](../using-unraid-to/create-virtual-machines/vm-setup.mdx)).
193-
194188
:::
195189

196190
</details>

docs/unraid-os/system-administration/advanced-tools/command-line-interface.mdx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,7 @@ This command provides a real-time process and resource monitor.
169169
- Use arrow keys to scroll, and `k` to terminate processes.
170170

171171
:::tip
172-
173172
Consider using `htop` for a more user-friendly interface with enhanced controls.
174-
175173
:::
176174

177175
</details>
@@ -190,9 +188,7 @@ This command shows memory usage statistics.
190188
This displays RAM usage in a human-readable format. The `-h` flag means sizes will show in KB, MB, or GB instead of bytes.
191189

192190
:::tip[Understand the output]
193-
194191
A low "available" memory reading doesn’t necessarily indicate a problem—Linux aggressively caches data for performance.
195-
196192
:::
197193

198194
</details>

docs/unraid-os/system-administration/advanced-tools/wake-on-lan.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,15 @@ The plugin manages most sleep configuration options.
8080
```
8181

8282
:::caution[Persistence]
83-
8483
WoL settings configured manually are **not persistent** across reboots by default. To make them permanent:
8584

8685
1. Create a `go` file on your flash drive at `/boot/config/go`.
86+
8787
2. Add this line:
8888

8989
```
9090
/sbin/ethtool -s eth0 wol g
9191
```
92-
9392
:::
9493

9594
</details>

docs/unraid-os/system-administration/maintain-and-update/changing-the-flash-device.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,13 @@ For more guidance on selecting the best flash device for Unraid, check out [Spac
5353
- Avoid second-hand or previously used drives.
5454
- Test the new drive on your server before transferring your license.
5555
- Be cautious of counterfeit products, even from well-known brands.
56-
5756
:::note
5857

5958
The [forum announcement on counterfeit SanDisk drives](https://forums.unraid.net/topic/119052-psa-on-sandisk-usbs/) from January 2022 confirms SanDisk is not recommended due to counterfeit devices and manufacturing changes resulting in non-unique GUIDs. This affects both counterfeit and legitimate SanDisk drives.
6059

60+
:::
61+
:::
62+
6163
:::
6264

6365
---

docs/unraid-os/system-administration/secure-your-server/securing-your-connection.mdx

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,7 @@ Below are the main ways to access your Unraid %%WebGUI|web-gui%%, depending on y
6161
5. Click **Apply**.
6262

6363
:::warning
64-
6564
Anyone on your network can intercept data sent over HTTP. Use HTTPS whenever possible.
66-
6765
:::
6866

6967
</details>
@@ -86,9 +84,7 @@ Below are the main ways to access your Unraid %%WebGUI|web-gui%%, depending on y
8684
5. Click **Apply**.
8785

8886
:::important
89-
9087
Browsers will show a certificate error. All traffic is still encrypted after you accept the warning.
91-
9288
:::
9389

9490
</details>
@@ -124,15 +120,11 @@ Below are the main ways to access your Unraid %%WebGUI|web-gui%%, depending on y
124120
- If you install the [Unraid Connect plugin](../../../unraid-connect/overview-and-setup.mdx), it will also be shown on the Connect dashboard.
125121

126122
:::info
127-
128123
The myunraid.net certificate is trusted by browsers and does not display warnings. The URL uses your LAN IP address with dots changed to dashes, plus a unique 40-character %%hash|hash%% assigned to your server.
129-
130124
:::
131125

132126
:::tip[Fallback access]
133-
134127
If %%DNS|dns-name-resolution%% resolution becomes unavailable (e.g., your Internet goes down), you can use the local URLs with your server name or IP address as backup access methods.
135-
136128
:::
137129

138130
</details>
@@ -155,7 +147,6 @@ Below are the main ways to access your Unraid %%WebGUI|web-gui%%, depending on y
155147
If you install the [Unraid Connect plugin](../../../unraid-connect/overview-and-setup.mdx), it will also be shown on the Connect dashboard.
156148

157149
:::caution
158-
159150
If %%DNS|dns-name-resolution%% resolution becomes unavailable (e.g., your Internet connection goes down), you will not be able to access the %%WebGUI|web-gui%% using the Myunraid.net URL.
160151

161152
To regain access:
@@ -164,7 +155,6 @@ Below are the main ways to access your Unraid %%WebGUI|web-gui%%, depending on y
164155
- Run `use_ssl no` to switch to HTTP (`http://[servername].[localTLD]` or `http://[ipaddress]`).
165156
- Run `use_ssl yes` to switch to HTTPS using a self-signed certificate (`https://[servername].[localTLD]` or `https://[ipaddress]`). See [HTTPS with a self-signed certificate](#https-with-self-signed-certificate) above for more details.
166157
- Once %%DNS|dns-name-resolution%% is restored, set **Use SSL/TLS** back to *Strict* for full security.
167-
168158
:::
169159

170160
</details>
@@ -177,10 +167,8 @@ When you access `http://[servername].[localTLD]`, the redirect behavior depends
177167

178168
- **Strict**: You will be redirected to `https://[lan-ip].[hash].myunraid.net`.
179169
:::note
180-
181170
This can make local access difficult if %%DNS|dns-name-resolution%% is unavailable. See the caution under [HTTPS with Myunraid.net certificate and with no fallback URL](#https-with-myunraidnet-certificate-and-with-no-fallback-url).
182-
183-
:::
171+
:::
184172

185173
- **Yes**: You will be redirected to `https://[servername].[localTLD]`. This will still work even if your internet connection is down.
186174

@@ -227,9 +215,7 @@ If your certificate is invalid or does not match the server's URL, Unraid will d
227215
7. Optionally, enable [Unraid Connect remote access](../../../unraid-connect/remote-access.mdx) for secure, browser-trusted remote management.
228216

229217
:::tip
230-
231218
For wildcard certificates, ensure the certificate's Subject Alternative Name or Subject field contains `*.[localTLD]` where `[localTLD]` is the exact value you entered in the **Local TLD** field in **Management Access**.
232-
233219
:::
234220

235221
</details>

docs/unraid-os/troubleshooting/common-issues/data-recovery.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ If you used %%Maintenance Mode|maintenance-mode%%, stop the array and restart it
175175
If a previously functional disk becomes unmountable, this usually indicates file system corruption, often caused by an unclean shutdown or write failure.
176176

177177
:::danger[Critical action]
178+
178179
Never format an unmountable disk through the %%WebGUI|web-gui%%! Formatting erases all data and updates %%parity|parity%%, making recovery impossible.
179180

180181
:::
@@ -210,6 +211,7 @@ Here’s how to proceed:
210211
```
211212

212213
:::danger
214+
213215
The `--repair` option is extremely dangerous and can cause further data loss. Always backup or image the disk first. Review [the documentation](https://btrfs.readthedocs.io/en/latest/btrfs-check.html) and consider seeking additional advice if you’re unsure.
214216

215217
:::

0 commit comments

Comments
 (0)