Skip to content

Commit 0c0454a

Browse files
authored
Merge pull request #327 from raifdmueller/fix/mikado-numbered-list
fix: render numbered list in Mikado Method recipe
2 parents 376c387 + b4810a1 commit 0c0454a

3 files changed

Lines changed: 98 additions & 40 deletions

File tree

docs/anchors/mikado-method.adoc

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -43,26 +43,35 @@ Key Proponents:: Ola Ellnestam, Daniel Brolund ("The Mikado Method", 2012)
4343
[discrete]
4444
== *Mikado Method Recipe (Canonical Form)*
4545

46-
1. Start here: Draw the Mikado Goal.
47-
2. Implement the goal or prerequisite naively.
48-
3. Are there any errors?
49-
* Examples: compiler errors, failing tests, runtime errors, broken builds.
50-
* If *Yes*, go to step 4.
51-
* If *No*, go to step 9.
52-
4. Come up with immediate solutions to the errors.
53-
5. Draw the solutions as new prerequisites in the Mikado Graph.
54-
6. Revert all changes and return to the last known good state.
55-
7. Select the next prerequisite to work with.
56-
8. Go to step 2.
57-
9. Does the change make sense?
58-
* Examples: understandable, internally consistent, safe to keep, useful on its own.
59-
* If *Yes*, go to step 10.
60-
* If *No*, go to step 7.
61-
10. Commit the change.
62-
11. Is the Mikado Goal met?
63-
* If *Yes*, go to step 12.
64-
* If *No*, go to step 7.
65-
12. DONE!
46+
. Start here: Draw the Mikado Goal.
47+
. Implement the goal or prerequisite naively.
48+
. Are there any errors?
49+
+
50+
--
51+
** Examples: compiler errors, failing tests, runtime errors, broken builds.
52+
** If *Yes*, go to step 4.
53+
** If *No*, go to step 9.
54+
--
55+
. Come up with immediate solutions to the errors.
56+
. Draw the solutions as new prerequisites in the Mikado Graph.
57+
. Revert all changes and return to the last known good state.
58+
. Select the next prerequisite to work with.
59+
. Go to step 2.
60+
. Does the change make sense?
61+
+
62+
--
63+
** Examples: understandable, internally consistent, safe to keep, useful on its own.
64+
** If *Yes*, go to step 10.
65+
** If *No*, go to step 7.
66+
--
67+
. Commit the change.
68+
. Is the Mikado Goal met?
69+
+
70+
--
71+
** If *Yes*, go to step 12.
72+
** If *No*, go to step 7.
73+
--
74+
. DONE!
6675

6776

6877
[discrete]

docs/anchors/mikado-method.de.adoc

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -43,26 +43,35 @@ Schlüsselvertreter:: Ola Ellnestam, Daniel Brolund ("The Mikado Method", 2012)
4343
[discrete]
4444
== *Mikado-Methode-Rezept (kanonische Form)*
4545

46-
1. Hier beginnen: Das Mikado-Ziel aufschreiben.
47-
2. Das Ziel oder die Voraussetzung naiv implementieren.
48-
3. Treten Fehler auf?
49-
* Beispiele: Compilerfehler, fehlschlagende Tests, Laufzeitfehler, kaputte Builds.
50-
* Wenn *Ja*, gehe zu Schritt 4.
51-
* Wenn *Nein*, gehe zu Schritt 9.
52-
4. Unmittelbare Lösungen für die Fehler finden.
53-
5. Die Lösungen als neue Voraussetzungen in den Mikado-Graphen einzeichnen.
54-
6. Alle Änderungen rückgängig machen und zum letzten bekannten guten Zustand zurückkehren.
55-
7. Die nächste zu bearbeitende Voraussetzung auswählen.
56-
8. Gehe zu Schritt 2.
57-
9. Ist die Änderung sinnvoll?
58-
* Beispiele: verständlich, intern konsistent, sicher beizubehalten, für sich allein nützlich.
59-
* Wenn *Ja*, gehe zu Schritt 10.
60-
* Wenn *Nein*, gehe zu Schritt 7.
61-
10. Die Änderung committen.
62-
11. Ist das Mikado-Ziel erreicht?
63-
* Wenn *Ja*, gehe zu Schritt 12.
64-
* Wenn *Nein*, gehe zu Schritt 7.
65-
12. FERTIG!
46+
. Hier beginnen: Das Mikado-Ziel aufschreiben.
47+
. Das Ziel oder die Voraussetzung naiv implementieren.
48+
. Treten Fehler auf?
49+
+
50+
--
51+
** Beispiele: Compilerfehler, fehlschlagende Tests, Laufzeitfehler, kaputte Builds.
52+
** Wenn *Ja*, gehe zu Schritt 4.
53+
** Wenn *Nein*, gehe zu Schritt 9.
54+
--
55+
. Unmittelbare Lösungen für die Fehler finden.
56+
. Die Lösungen als neue Voraussetzungen in den Mikado-Graphen einzeichnen.
57+
. Alle Änderungen rückgängig machen und zum letzten bekannten guten Zustand zurückkehren.
58+
. Die nächste zu bearbeitende Voraussetzung auswählen.
59+
. Gehe zu Schritt 2.
60+
. Ist die Änderung sinnvoll?
61+
+
62+
--
63+
** Beispiele: verständlich, intern konsistent, sicher beizubehalten, für sich allein nützlich.
64+
** Wenn *Ja*, gehe zu Schritt 10.
65+
** Wenn *Nein*, gehe zu Schritt 7.
66+
--
67+
. Die Änderung committen.
68+
. Ist das Mikado-Ziel erreicht?
69+
+
70+
--
71+
** Wenn *Ja*, gehe zu Schritt 12.
72+
** Wenn *Nein*, gehe zu Schritt 7.
73+
--
74+
. FERTIG!
6675

6776

6877
[discrete]
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { describe, it, expect } from 'vitest'
2+
import fs from 'fs'
3+
import path from 'path'
4+
import { fileURLToPath } from 'url'
5+
6+
const __dirname = path.dirname(fileURLToPath(import.meta.url))
7+
const anchorsDir = path.join(__dirname, '..', '..', '..', 'docs', 'anchors')
8+
9+
describe('AsciiDoc anchor content validation', () => {
10+
it('should not use Markdown-style numbered lists (1. 2. 3.) in .adoc files', () => {
11+
const files = fs.readdirSync(anchorsDir).filter((f) => f.endsWith('.adoc'))
12+
const violations = []
13+
14+
for (const file of files) {
15+
const content = fs.readFileSync(path.join(anchorsDir, file), 'utf-8')
16+
const lines = content.split('\n')
17+
18+
let inCodeBlock = false
19+
for (let i = 0; i < lines.length; i++) {
20+
const line = lines[i]
21+
// Track AsciiDoc code blocks (---- or ....)
22+
if (/^(-{4,}|\.{4,})$/.test(line.trim())) {
23+
inCodeBlock = !inCodeBlock
24+
continue
25+
}
26+
if (inCodeBlock) continue
27+
// Match lines starting with "1." "2." etc. (Markdown ordered list)
28+
if (/^\d+\.\s/.test(line)) {
29+
violations.push(`${file}:${i + 1}: "${line.trim()}"`)
30+
}
31+
}
32+
}
33+
34+
expect(
35+
violations,
36+
`Found Markdown-style numbered lists in AsciiDoc files. ` +
37+
`Use AsciiDoc ordered list syntax (. item) instead:\n${violations.join('\n')}`
38+
).toEqual([])
39+
})
40+
})

0 commit comments

Comments
 (0)