|
| 1 | +--- |
| 2 | +id: MDS072 |
| 3 | +name: slide-structure |
| 4 | +status: ready |
| 5 | +description: >- |
| 6 | + Flags Slidev slide-structure errors: unknown |
| 7 | + layouts, missing or orphaned slot separators, |
| 8 | + missing layout-required fields, and misspelled |
| 9 | + per-slide frontmatter keys. |
| 10 | +nature: structure |
| 11 | +maintainability: null |
| 12 | +markdownlint: [] |
| 13 | +rumdl: [] |
| 14 | +mado: [] |
| 15 | +panache: [] |
| 16 | +obsidian-linter: [] |
| 17 | +gomarklint: [] |
| 18 | +category: structural |
| 19 | +--- |
| 20 | +# MDS072: slide-structure |
| 21 | + |
| 22 | +Flags Slidev slide-structure errors: unknown |
| 23 | +layouts, missing or orphaned slot separators, |
| 24 | +missing layout-required fields, and misspelled |
| 25 | +per-slide frontmatter keys. |
| 26 | + |
| 27 | +[Slidev](https://sli.dev) renders a single Markdown |
| 28 | +file as a slide deck: `---` separates slides and |
| 29 | +each slide may carry its own frontmatter block. Its |
| 30 | +parser is permissive — an unmatched `::slot::` |
| 31 | +drops its content, a misspelled `layout:` renders |
| 32 | +blank, and an unknown frontmatter key passes |
| 33 | +through as data. None of these error. MDS072 splits |
| 34 | +the deck into slides and reports the failures |
| 35 | +Slidev never does. |
| 36 | + |
| 37 | +The rule is opt-in. Select the |
| 38 | +[`slidev` convention](../../../docs/reference/conventions.md) |
| 39 | +to enable it, or turn it on directly. It owns the |
| 40 | +Markdown/structural layer only: it does not resolve |
| 41 | +theme packages, render Vue, or validate UnoCSS |
| 42 | +classes. |
| 43 | + |
| 44 | +## Settings |
| 45 | + |
| 46 | +| Key | Type | Description | |
| 47 | +| -------------- | ---- | ----------------------------------------------------- | |
| 48 | +| custom-layouts | list | Theme or addon layout names to treat as known layouts | |
| 49 | + |
| 50 | +Declare a theme's layouts so they are not flagged |
| 51 | +as unknown: |
| 52 | + |
| 53 | +```yaml |
| 54 | +rules: |
| 55 | + slide-structure: |
| 56 | + custom-layouts: [my-cover, quote-dark] |
| 57 | +``` |
| 58 | +
|
| 59 | +## Config |
| 60 | +
|
| 61 | +Enable: |
| 62 | +
|
| 63 | +```yaml |
| 64 | +rules: |
| 65 | + slide-structure: true |
| 66 | +``` |
| 67 | +
|
| 68 | +Disable: |
| 69 | +
|
| 70 | +```yaml |
| 71 | +rules: |
| 72 | + slide-structure: false |
| 73 | +``` |
| 74 | +
|
| 75 | +## Examples |
| 76 | +
|
| 77 | +### Bad |
| 78 | +
|
| 79 | +A `two-cols` layout with no `::right::` separator — |
| 80 | +the right column renders empty. |
| 81 | + |
| 82 | +<?include |
| 83 | +file: bad/missing-right-slot.md |
| 84 | +wrap: markdown |
| 85 | +?> |
| 86 | + |
| 87 | +```markdown |
| 88 | +# Intro |
| 89 | +
|
| 90 | +Body text. |
| 91 | +
|
| 92 | +--- |
| 93 | +layout: two-cols |
| 94 | +--- |
| 95 | +
|
| 96 | +# Left column |
| 97 | +
|
| 98 | +Left body. |
| 99 | +``` |
| 100 | + |
| 101 | +<?/include?> |
| 102 | + |
| 103 | +### Good |
| 104 | + |
| 105 | +A clean deck: blank-padded separators and unique, |
| 106 | +well-formed headings. |
| 107 | + |
| 108 | +<?include |
| 109 | +file: good/clean-deck.md |
| 110 | +wrap: markdown |
| 111 | +?> |
| 112 | + |
| 113 | +```markdown |
| 114 | +# Opening |
| 115 | +
|
| 116 | +Welcome to the deck. |
| 117 | +
|
| 118 | +--- |
| 119 | +
|
| 120 | +## Agenda |
| 121 | +
|
| 122 | +Three topics today. |
| 123 | +
|
| 124 | +--- |
| 125 | +
|
| 126 | +## Summary |
| 127 | +
|
| 128 | +Thanks for watching. |
| 129 | +``` |
| 130 | + |
| 131 | +<?/include?> |
| 132 | + |
| 133 | +## Meta-Information |
| 134 | + |
| 135 | +- **ID**: MDS072 |
| 136 | +- **Name**: `slide-structure` |
| 137 | +- **Status**: ready |
| 138 | +- **Default**: disabled |
| 139 | +- **Fixable**: no |
| 140 | +- **Implementation**: |
| 141 | + [source](./) |
| 142 | +- **Category**: structural |
0 commit comments