create-mordoc-app 0.0.11 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/create.js ADDED
@@ -0,0 +1,106 @@
1
+ #!/usr/bin/env node
2
+
3
+ 'use strict';
4
+
5
+ const fs = require('fs');
6
+ const path = require('path');
7
+ const { execSync, spawnSync } = require('child_process');
8
+
9
+ const start = Date.now();
10
+ const projectName = process.argv[2];
11
+
12
+ if (!projectName) {
13
+ console.error('Please specify a project name:');
14
+ console.error(' npx create-mordoc-app my-docs');
15
+ process.exit(1);
16
+ }
17
+
18
+ const projectDir = path.resolve(process.cwd(), projectName);
19
+
20
+ if (fs.existsSync(projectDir)) {
21
+ console.error(`Error: directory "${projectName}" already exists.`);
22
+ process.exit(1);
23
+ }
24
+
25
+ // Fetch latest mordoc version from npm
26
+ let mordocVersion;
27
+ try {
28
+ mordocVersion = execSync('npm view mordoc version', { encoding: 'utf8' }).trim();
29
+ } catch (e) {
30
+ console.error('Error: could not fetch mordoc version from npm. Are you online?');
31
+ process.exit(1);
32
+ }
33
+
34
+ // Copy template into project directory
35
+ const templateDir = path.join(__dirname, '..', 'template');
36
+
37
+ function copyDir(src, dest) {
38
+ fs.mkdirSync(dest, { recursive: true });
39
+ for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
40
+ const srcPath = path.join(src, entry.name);
41
+ const destPath = path.join(dest, entry.name);
42
+ if (entry.isDirectory()) {
43
+ copyDir(srcPath, destPath);
44
+ } else {
45
+ fs.copyFileSync(srcPath, destPath);
46
+ }
47
+ }
48
+ }
49
+
50
+ copyDir(templateDir, projectDir);
51
+
52
+ // Substitute {{projectName}} in config/site.json
53
+ const siteJsonPath = path.join(projectDir, 'config', 'site.json');
54
+ const siteJson = fs.readFileSync(siteJsonPath, 'utf8');
55
+ fs.writeFileSync(siteJsonPath, siteJson.replace(/\{\{projectName\}\}/g, projectName));
56
+
57
+ // Generate .gitignore
58
+ fs.writeFileSync(
59
+ path.join(projectDir, '.gitignore'),
60
+ 'node_modules/\ndist/\n'
61
+ );
62
+
63
+ // Generate package.json
64
+ const pkg = {
65
+ name: projectName,
66
+ version: '0.0.1',
67
+ private: true,
68
+ scripts: {
69
+ dev: 'mordoc dev',
70
+ build: 'mordoc build',
71
+ },
72
+ devDependencies: {
73
+ mordoc: `^${mordocVersion}`,
74
+ },
75
+ };
76
+ fs.writeFileSync(
77
+ path.join(projectDir, 'package.json'),
78
+ JSON.stringify(pkg, null, 2) + '\n'
79
+ );
80
+
81
+ // Run npm install
82
+ console.log(`\nScaffolding "${projectName}"...`);
83
+ const result = spawnSync('npm', ['install'], {
84
+ cwd: projectDir,
85
+ stdio: 'inherit',
86
+ shell: true,
87
+ });
88
+
89
+ if (result.status !== 0) {
90
+ console.error('\nError: npm install failed.');
91
+ process.exit(1);
92
+ }
93
+
94
+ const duration = ((Date.now() - start) / 1000).toFixed(1);
95
+
96
+ console.log(`\n✨ Success! Created ${projectName} in ${duration}s\n`);
97
+ console.log('Your documentation project is ready!\n');
98
+ console.log('Get started with:\n');
99
+ console.log(` cd ${projectName}\n`);
100
+ console.log('Next steps:\n');
101
+ console.log(' 1. Edit your content in content directory');
102
+ console.log(' 2. Customize the configuration for your documentation website in config directory');
103
+ console.log(' 4. Run npm run dev to preview locally');
104
+ console.log(' 5. Run npm run build to generate your site\n');
105
+ console.log('Full documentation at https://mordoc.dev\n');
106
+ console.log('Happy documenting! šŸ“š\n');
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "create-mordoc-app",
3
- "repoitory": {
3
+ "repository": {
4
4
  "type": "git",
5
5
  "url": "https://github.com/shiva-varanasi/create-mordoc-app.git"
6
6
  },
7
- "version": "0.0.11",
7
+ "version": "1.1.0",
8
8
  "description": "Create Mordoc documentation sites with one command",
9
- "main": "index.js",
10
9
  "bin": {
11
- "create-mordoc-app": "./index.js"
10
+ "create-mordoc-app": "./bin/create.js"
12
11
  },
12
+ "files": [
13
+ "bin",
14
+ "template"
15
+ ],
13
16
  "author": "Shiva Varanasi",
14
17
  "license": "MIT",
15
- "dependencies": {
16
- "mordoc": "^0.1.14"
17
- },
18
18
  "engines": {
19
19
  "node": ">=18.0.0"
20
20
  }
@@ -0,0 +1,6 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 180 40" role="img" aria-label="The Ring of Power">
2
+ <rect width="180" height="40" rx="10" fill="#1a120d"/>
3
+ <circle cx="24" cy="20" r="11" fill="none" stroke="#D64518" stroke-width="4"/>
4
+ <path d="M16 20h16" stroke="#D64518" stroke-width="2" stroke-linecap="round"/>
5
+ <text x="45" y="25" font-family="Georgia, serif" font-size="17" font-weight="700" fill="#fff7e6">Ring of Power</text>
6
+ </svg>
@@ -0,0 +1,6 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 180 40" role="img" aria-label="The Ring of Power">
2
+ <rect width="180" height="40" rx="10" fill="#ffffff"/>
3
+ <circle cx="24" cy="20" r="11" fill="none" stroke="#D64518" stroke-width="4"/>
4
+ <path d="M16 20h16" stroke="#D64518" stroke-width="2" stroke-linecap="round"/>
5
+ <text x="45" y="25" font-family="Georgia, serif" font-size="17" font-weight="700" fill="#2d1b12">Ring of Power</text>
6
+ </svg>
@@ -0,0 +1,9 @@
1
+ - label: The Ring
2
+ expanded: true
3
+ children:
4
+ - label: Lore of the Ring
5
+ path: /lore
6
+ - label: Wielding the Ring
7
+ path: /wielding-the-ring
8
+ - label: Safeguards
9
+ path: /safeguards
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "The Ring of Power",
3
+ "description": "A field guide for keepers, scholars, and reluctant bearers of the One Ring.",
4
+ "baseUrl": "https://ring-of-power.example.com",
5
+ "defaultLanguage": "en",
6
+ "metadata": {
7
+ "ogImage": "/images/ring-og.svg",
8
+ "ogType": "website",
9
+ "twitterCard": "summary_large_image"
10
+ }
11
+ }
@@ -0,0 +1,4 @@
1
+ /* Ring of Power theme accents */
2
+ :root {
3
+ --accent: #D64518; /* ring gold */
4
+ }
@@ -0,0 +1,38 @@
1
+ ---
2
+ title: One Ring to Rule Them All
3
+ description: Start here to learn the purpose, promise, and peril of the One Ring.
4
+ layout: landing
5
+ ---
6
+
7
+ {% hero title="One ring" titleAccent="to rule them all" description="A practical field guide for keepers, scholars, and very cautious bearers of the One Ring." background="#120b08" titleColor="#fff7e6" titleAccentColor="#D64518" descriptionColor="#f7d6c6" %}
8
+ {% button path="/lore" %}
9
+ Get started
10
+ {% /button %}
11
+ {% /hero %}
12
+
13
+ {% section title="Before the Council" background="subtle" %}
14
+ The Ring is small enough to vanish in a closed hand and heavy enough to bend the fate of kingdoms.
15
+
16
+ This guide gathers the first principles every keeper must know before the Ring is moved, studied, hidden, or entrusted to a bearer.
17
+
18
+ {% callout type="warning" title="A note from the Council" %}
19
+ Do not put on the Ring to test its nature. The first use is often the first surrender.
20
+ {% /callout %}
21
+ {% /section %}
22
+
23
+ {% section title="Choose Your Path" %}
24
+ {% cardGrid cols="3" %}
25
+ {% card title="Learn the lore" path="/lore" icon="/images/icons/book.svg" tag="Start here" %}
26
+ Understand where the Ring came from, what it promises, and why wise folk speak of it carefully.
27
+ {% /card %}
28
+
29
+ {% card title="Wield with care" path="/wielding-the-ring" icon="/images/icons/spark.svg" tag="Guide" %}
30
+ Follow a practical checklist for handling powerful artifacts without losing sight of the road.
31
+ {% /card %}
32
+
33
+ {% card title="Guard against corruption" path="/safeguards" icon="/images/icons/shield.svg" tag="Safety" %}
34
+ Review warnings, callouts, and rules for anyone trusted with dangerous knowledge.
35
+ {% /card %}
36
+ {% /cardGrid %}
37
+ {% /section %}
38
+
@@ -0,0 +1,48 @@
1
+ ---
2
+ title: Lore of the Ring
3
+ description: A short history of the One Ring and the forces bound to it.
4
+ ---
5
+
6
+ # Lore of the Ring
7
+
8
+ The One Ring is not a common trinket, heirloom, or travel charm. It is a ruling artifact, forged to gather power into one small circle of gold.
9
+
10
+ The Wise agree on one point: anyone who studies the Ring must first understand that it is not passive. It waits, listens, and works upon desire.
11
+
12
+ ![The One Ring resting in shadow](/images/ring-hero.svg)
13
+
14
+ ## What the Ring Is
15
+
16
+ The Ring carries three qualities every keeper should understand:
17
+
18
+ - **Power**: it amplifies the will of its bearer.
19
+ - **Secrecy**: it tempts the bearer to hide both action and intent.
20
+ - **Return**: it seeks the hand of its maker.
21
+
22
+ {% callout type="note" title="Archivist's note" %}
23
+ Descriptions of the Ring are never neutral. Compare accounts from Elves, Men, Hobbits, and former bearers before trusting a single witness.
24
+ {% /callout %}
25
+
26
+ ## Known Names
27
+
28
+ | Name | Used by | Meaning |
29
+ | --- | --- | --- |
30
+ | The One Ring | Scholars | The master ring among all rings |
31
+ | Isildur's Bane | Gondor | A warning drawn from history |
32
+ | Precious | Former bearers | A sign that attachment has taken root |
33
+
34
+ ## A Brief Timeline
35
+
36
+ 1. The Ring is forged in fire.
37
+ 2. It passes from hand to hand through war, loss, and chance.
38
+ 3. It is carried into the open again.
39
+ 4. The free peoples must decide whether to use it, hide it, or destroy it.
40
+
41
+ ## Related Pages
42
+
43
+ - Continue with [Wielding the Ring](/wielding-the-ring) for practical handling guidance.
44
+ - Review [Safeguards](/safeguards) before assigning any bearer.
45
+
46
+ {% callout type="tip" title="Council practice" %}
47
+ When assigning a bearer, send them to the safeguards before the journey begins. Fear is easier to face before the road grows dark.
48
+ {% /callout %}
@@ -0,0 +1,64 @@
1
+ ---
2
+ title: Safeguards
3
+ description: Rules and warning signs for keeping the Ring from ruling its keeper.
4
+ ---
5
+
6
+ # Safeguards
7
+
8
+ The Ring is most dangerous when it feels reasonable. Safeguards turn private judgment into shared practice.
9
+
10
+ ## Core Rules
11
+
12
+ - Never carry the Ring alone.
13
+ - Never use the Ring to avoid ordinary effort.
14
+ - Never keep the Ring secret from the appointed fellowship.
15
+ - Never confuse possession with ownership.
16
+
17
+ {% callout type="danger" title="The final rule" %}
18
+ The Ring must not be claimed. If a bearer claims it, all other plans become secondary.
19
+ {% /callout %}
20
+
21
+ ## Warning Signs
22
+
23
+ Watch for these changes in speech and behavior:
24
+
25
+ 1. The bearer stops naming the mission.
26
+ 2. The bearer speaks of the Ring as a gift.
27
+ 3. The bearer avoids companions.
28
+ 4. The bearer says the Ring can be used "just once".
29
+
30
+ {% callout type="tip" title="Keep notes" %}
31
+ Short written logs help companions notice slow changes that feel invisible day by day.
32
+ {% /callout %}
33
+
34
+ ## Response Levels
35
+
36
+ | Level | Sign | Response |
37
+ | --- | --- | --- |
38
+ | Watch | Restlessness near the Ring | Add a companion |
39
+ | Warn | Secret planning | Pause the mission |
40
+ | Intervene | Claiming language | Separate bearer and Ring |
41
+
42
+ ## Example Safeguard Log
43
+
44
+ ```json
45
+ {
46
+ "day": 17,
47
+ "bearer": "Frodo",
48
+ "companion": "Sam",
49
+ "ringVisible": false,
50
+ "concern": "bearer requested solitude",
51
+ "action": "companions stayed close"
52
+ }
53
+ ```
54
+
55
+ ## Companion Duties
56
+
57
+ Companions are not guards alone. They are witnesses, memory-keepers, and the first line of mercy when the Ring begins to speak in the bearer's own voice.
58
+
59
+ - Keep the bearer in conversation.
60
+ - Record changes in sleep, speech, appetite, and secrecy.
61
+ - Share burdens before resentment turns into isolation.
62
+ - Call for Council review at the first sign of claiming language.
63
+
64
+ Return to [Wielding the Ring](/wielding-the-ring) when you are ready to continue the procedure.
@@ -0,0 +1,65 @@
1
+ ---
2
+ title: Wielding the Ring
3
+ description: A practical guide for handling the Ring without letting it handle you.
4
+ ---
5
+
6
+ # Wielding the Ring
7
+
8
+ This guide is issued for emergency stewardship only. To wield the Ring is to invite it into the will, and the will rarely notices the door closing behind it.
9
+
10
+ ## Before You Touch It
11
+
12
+ Confirm the following before any bearer is appointed:
13
+
14
+ - The Council has named a clear purpose.
15
+ - The bearer understands the risks.
16
+ - A trusted companion is present.
17
+ - The route away from temptation is shorter than the route toward it.
18
+
19
+ {% callout type="warning" title="Do not improvise" %}
20
+ The Ring rewards vague intent. Write down the mission before the Ring is moved.
21
+ {% /callout %}
22
+
23
+ ## Handling Procedure
24
+
25
+ 1. Place the Ring on a plain cloth.
26
+ 2. Record who is present.
27
+ 3. Speak the purpose aloud.
28
+ 4. Move the Ring only as far as the plan requires.
29
+ 5. Return it to a guarded container.
30
+
31
+ ```txt
32
+ Bearer: Frodo
33
+ Witness: Sam
34
+ Purpose: Carry the Ring toward its unmaking
35
+ Status: Burden accepted, not claimed
36
+ ```
37
+
38
+ ## Decision Checklist
39
+
40
+ Use this checklist before taking action.
41
+
42
+ | Question | Safe answer |
43
+ | --- | --- |
44
+ | Is the goal specific? | Yes |
45
+ | Is there a witness? | Yes |
46
+ | Is the Ring being used for convenience? | No |
47
+ | Has the bearer asked for help? | Yes |
48
+
49
+ {% callout type="danger" title="Immediate stop condition" %}
50
+ If the bearer calls the Ring "mine", stop the procedure and move to the safeguards plan.
51
+ {% /callout %}
52
+
53
+ ## Helpful Paths
54
+
55
+ {% cardGrid cols="2" %}
56
+ {% card title="Review the history" path="/lore" icon="/images/icons/book.svg" %}
57
+ Understanding old failures is the fastest way to avoid repeating them.
58
+ {% /card %}
59
+
60
+ {% card title="Open the safeguards" path="/safeguards" icon="/images/icons/shield.svg" %}
61
+ Use the safeguards page whenever the Ring begins to feel useful.
62
+ {% /card %}
63
+ {% /cardGrid %}
64
+
65
+ {% button path="/safeguards" %}Go to safeguards{% /button %}
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-label="Book icon">
2
+ <rect x="14" y="10" width="30" height="44" rx="4" fill="#fff7e6" stroke="#8a4b1f" stroke-width="4"/>
3
+ <path d="M22 10v44" stroke="#d69e2e" stroke-width="4"/>
4
+ <path d="M28 22h10M28 31h10" stroke="#8a4b1f" stroke-width="3" stroke-linecap="round"/>
5
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-label="Shield icon">
2
+ <path d="M32 6 52 14v15c0 15-8 24-20 29-12-5-20-14-20-29V14l20-8Z" fill="#fff7e6" stroke="#8a4b1f" stroke-width="4" stroke-linejoin="round"/>
3
+ <path d="M32 12v38M18 27h28" stroke="#d69e2e" stroke-width="4" stroke-linecap="round"/>
4
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-label="Spark icon">
2
+ <path d="M32 6 38 25l20 7-20 7-6 19-6-19-20-7 20-7 6-19Z" fill="#f7c948" stroke="#8a4b1f" stroke-width="4" stroke-linejoin="round"/>
3
+ <circle cx="32" cy="32" r="5" fill="#fff7e6"/>
4
+ </svg>
@@ -0,0 +1,7 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 630" role="img" aria-label="The Ring of Power social preview">
2
+ <rect width="1200" height="630" fill="#120b08"/>
3
+ <circle cx="600" cy="315" r="210" fill="none" stroke="#f7c948" stroke-width="42"/>
4
+ <circle cx="600" cy="315" r="145" fill="none" stroke="#7b341e" stroke-width="14"/>
5
+ <text x="600" y="120" text-anchor="middle" font-family="Georgia, serif" font-size="56" font-weight="700" fill="#fff7e6">The Ring of Power</text>
6
+ <text x="600" y="540" text-anchor="middle" font-family="Georgia, serif" font-size="38" fill="#f7c948">One guide to bind them</text>
7
+ </svg>
package/index.js DELETED
@@ -1,34 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- // Import the createApp function from mordoc
4
- const { createApp } = require('mordoc/dist/cli/create-app');
5
-
6
- // Parse command line arguments
7
- const args = process.argv.slice(2);
8
- const projectName = args[0];
9
-
10
- // Parse options
11
- const options = {};
12
- for (let i = 1; i < args.length; i++) {
13
- const arg = args[i];
14
- if (arg === '--template' && args[i + 1]) {
15
- options.template = args[++i];
16
- } else if (arg === '--skip-install') {
17
- options.skipInstall = true;
18
- } else if (arg === '--git') {
19
- options.skipGit = false;
20
- }
21
- }
22
-
23
- // Check for required project name
24
- if (!projectName) {
25
- console.error('Please specify a project name:');
26
- console.error(' npx create-mordoc-app my-docs');
27
- process.exit(1);
28
- }
29
-
30
- // Call the createApp function
31
- createApp(projectName, options).catch(err => {
32
- console.error('Error creating project:', err);
33
- process.exit(1);
34
- });