|
| 1 | +--- |
| 2 | +name: psmodule-zensical-migration |
| 3 | +description: Migrate a PSModule repository from MkDocs to Zensical using the Process-PSModule documentation design as the default while preserving content, navigation, assets, and repository-specific behavior. |
| 4 | +--- |
| 5 | + |
| 6 | +# Migrate PSModule documentation from MkDocs to Zensical |
| 7 | + |
| 8 | +Use this skill when a PSModule repository has a legacy MkDocs configuration, |
| 9 | +usually `.github/mkdocs.yml`, or needs its documentation site aligned with the |
| 10 | +Process-PSModule Zensical design. Keep the migration limited to documentation |
| 11 | +integration. Do not rewrite module code or tests unless a documentation build |
| 12 | +requires a directly related fix. |
| 13 | + |
| 14 | +## Source-of-truth design |
| 15 | + |
| 16 | +Use the current |
| 17 | +[`Process-PSModule` `docs/zensical.toml`](https://github.com/PSModule/Process-PSModule/blob/main/docs/zensical.toml) |
| 18 | +as the default style and configuration baseline. Reuse its behavior rather than |
| 19 | +inventing a second theme: |
| 20 | + |
| 21 | +- `docs_dir = "content"` with content under `docs/content/`. |
| 22 | +- `docs/overrides/` as the custom theme directory. |
| 23 | +- `docs/overrides/assets/stylesheets/navigation.css` for navigation styling. |
| 24 | +- `docs/overrides/assets/` and any repository-owned `docs/assets/` directory |
| 25 | + when present as the asset source of truth. |
| 26 | +- Mona Sans text and Source Code Pro code fonts. |
| 27 | +- Material-style GitHub/link icons, light/dark/system palette toggles, |
| 28 | + black/slate/light-blue colors, and the established navigation features. |
| 29 | +- Instant navigation, prefetch/preview/progress, tabs, tracking, top navigation, |
| 30 | + search, code copy, tooltips, table of contents, and footer behavior. |
| 31 | +- TOC, attribute lists, abbreviations, admonitions, definition lists, |
| 32 | + footnotes, tables, HTML-in-Markdown, details, superfences, task lists, and |
| 33 | + snippets extensions. |
| 34 | +- Mermaid fenced blocks and the shared abbreviations snippet. |
| 35 | +- Existing social links, consent configuration, site metadata, edit URI, and |
| 36 | + custom tablesort JavaScript where those features apply. |
| 37 | + |
| 38 | +Customize only repository identity and content-specific values such as |
| 39 | +`site_name`, `site_url`, `repo_name`, `repo_url`, `edit_uri`, copyright, social |
| 40 | +links, and `nav`. Do not remove a default feature merely because the old |
| 41 | +MkDocs site did not use it. |
| 42 | + |
| 43 | +## Inspect before changing |
| 44 | + |
| 45 | +Inventory the existing repository and record: |
| 46 | + |
| 47 | +1. Local guidance, branch state, and documentation build commands. |
| 48 | +2. `.github/mkdocs.yml`, any `mkdocs.yml`, and any existing Zensical config. |
| 49 | +3. The Markdown content root, includes/snippets, templates, media, and assets. |
| 50 | +4. `theme`, `theme.custom_dir`, `extra_css`, `extra_javascript`, `plugins`, |
| 51 | + `markdown_extensions`, `nav`, `extra`, and `watch` settings. |
| 52 | +5. Links, anchors, generated API/help pages, redirects, and CI publishing steps. |
| 53 | +6. Existing custom CSS, JavaScript, templates, logos, favicons, and fonts. |
| 54 | + |
| 55 | +Do not assume every consumer has a `docs/` tree. If documentation is absent, |
| 56 | +create it only when the requested scope includes documentation migration. If |
| 57 | +the repository already uses Zensical, compare it with the Process-PSModule |
| 58 | +baseline and make only the required alignment changes. |
| 59 | + |
| 60 | +## Target layout |
| 61 | + |
| 62 | +For the Process-PSModule documentation contract, use: |
| 63 | + |
| 64 | +```text |
| 65 | +docs/ |
| 66 | +├── content/ |
| 67 | +├── overrides/ |
| 68 | +│ └── assets/ |
| 69 | +│ ├── javascripts/ |
| 70 | +│ └── stylesheets/ |
| 71 | +└── zensical.toml |
| 72 | +``` |
| 73 | + |
| 74 | +Keep existing content under `docs/content/`, custom templates under |
| 75 | +`docs/overrides/`, and theme assets under `docs/overrides/assets/`. A separate |
| 76 | +`docs/assets/` directory is optional for static content assets. Do not create a |
| 77 | +parallel MkDocs theme or leave two active site configurations. |
| 78 | + |
| 79 | +The current `PSModule/Template-PSModule` repository historically stores a |
| 80 | +starter `.github/zensical.toml` and may not contain a `docs/` tree. When the |
| 81 | +consumer upgrade explicitly requires the Process-PSModule `docs/` contract, |
| 82 | +move the template settings and custom assets into `docs/` and remove the |
| 83 | +obsolete active configuration only after the site builds. When that contract |
| 84 | +is not in scope, preserve a working template layout and report the difference |
| 85 | +instead of moving files speculatively. |
| 86 | + |
| 87 | +## MkDocs-to-Zensical mapping |
| 88 | + |
| 89 | +Translate behavior, not just filenames: |
| 90 | + |
| 91 | +| MkDocs | Zensical | |
| 92 | +| --- | --- | |
| 93 | +| `site_name`, `site_url` | `[project]` metadata | |
| 94 | +| `docs_dir` | `[project].docs_dir` | |
| 95 | +| `repo_name`, `repo_url`, `edit_uri` | `[project]` metadata | |
| 96 | +| `nav` | `nav = [...]` TOML entries | |
| 97 | +| `theme.name` | `[project.theme]` settings | |
| 98 | +| `theme.custom_dir` | `[project.theme].custom_dir` | |
| 99 | +| `theme.logo`, `theme.favicon` | `[project.theme]` paths | |
| 100 | +| `theme.features` | `[project.theme].features` | |
| 101 | +| `theme.palette` | `[[project.theme.palette]]` tables | |
| 102 | +| `extra_css`, `extra_javascript` | `[project]` arrays | |
| 103 | +| `markdown_extensions` | `[project.markdown_extensions.*]` tables | |
| 104 | +| `plugins: search` | `[project.plugins.search]` | |
| 105 | +| `extra.social` | `[[project.extra.social]]` | |
| 106 | +| `watch` | `[project].watch` | |
| 107 | + |
| 108 | +Preserve Markdown semantics while checking extensions that affect formatting: |
| 109 | +admonitions, fenced code, tables, task lists, definition lists, attributes, |
| 110 | +snippets, Mermaid, and anchor/permalink behavior. Fix only documented |
| 111 | +Zensical incompatibilities; do not silently change headings or links to hide |
| 112 | +build failures. |
| 113 | + |
| 114 | +## Content and link migration |
| 115 | + |
| 116 | +- Preserve page paths and navigation labels where possible. |
| 117 | +- Keep explicit `nav` entries for important landing pages and references. |
| 118 | +- Resolve relative links from the new `docs/content/` root. |
| 119 | +- Recheck fragment anchors because heading and permalink behavior can differ. |
| 120 | +- Move includes/snippets to the configured Zensical location and update every |
| 121 | + reference. |
| 122 | +- Keep generated API/help inputs in their framework-owned locations. |
| 123 | +- Preserve images and downloads; update paths rather than deleting assets. |
| 124 | +- Keep custom templates only when they are still required by the migrated site. |
| 125 | + |
| 126 | +## Validation |
| 127 | + |
| 128 | +Run repository-native checks and the smallest targeted site checks first: |
| 129 | + |
| 130 | +1. Parse the new `docs/zensical.toml` and verify all configured paths exist. |
| 131 | +2. Confirm no active `mkdocs.yml` or MkDocs workflow remains. |
| 132 | +3. Check every navigation target, image, download, include, and fragment link. |
| 133 | +4. Run the existing documentation lint and link checks. |
| 134 | +5. Build the site: |
| 135 | + |
| 136 | + ```powershell |
| 137 | + Push-Location docs |
| 138 | + zensical build --clean |
| 139 | + Pop-Location |
| 140 | + ``` |
| 141 | + |
| 142 | +6. Review the generated site for navigation, search, palette toggles, fonts, |
| 143 | + logo/favicon, custom navigation behavior, code blocks, Mermaid, and social |
| 144 | + links. |
| 145 | +7. Run the repository's existing Process-PSModule workflow validation when the |
| 146 | + documentation is part of that pipeline. |
| 147 | + |
| 148 | +Do not claim success if the site builds while links, assets, navigation, or |
| 149 | +publishing behavior are broken. Report intentionally deferred pages, |
| 150 | +unsupported extensions, and unrelated pre-existing failures. |
| 151 | + |
| 152 | +## References |
| 153 | + |
| 154 | +- [Process-PSModule Zensical configuration](https://github.com/PSModule/Process-PSModule/blob/main/docs/zensical.toml) |
| 155 | +- [Process-PSModule documentation overrides](https://github.com/PSModule/Process-PSModule/tree/main/docs/overrides) |
| 156 | +- [Process-PSModule override assets](https://github.com/PSModule/Process-PSModule/tree/main/docs/overrides/assets) |
| 157 | +- [PSModule repository standard](https://github.com/PSModule/Process-PSModule/blob/main/docs/content/reference/repository-standard.md) |
| 158 | +- [PSModule documentation model](https://github.com/PSModule/Process-PSModule/blob/main/docs/content/guides/structuring-your-module.md) |
| 159 | +- [Zensical setup basics](https://zensical.org/docs/setup/basics/) |
0 commit comments