create-mordoc-app 0.0.1
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/README.md +66 -0
- package/index.js +34 -0
- package/package.json +21 -0
package/README.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# create-mordoc-app
|
|
2
|
+
|
|
3
|
+
Create Mordoc documentation sites with a single command.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npx create-mordoc-app my-docs
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
This will create a new Mordoc documentation site in a directory called `my-docs`.
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## Examples
|
|
15
|
+
|
|
16
|
+
### Create a new project
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npx create-mordoc-app my-docs
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### Create a new project without installing dependencies
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npx create-mordoc-app my-docs --skip-install
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Create a new project with git initialization
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npx create-mordoc-app my-docs --git
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## What's included
|
|
35
|
+
|
|
36
|
+
The generated project will have:
|
|
37
|
+
|
|
38
|
+
- A `content` directory with sample markdown files
|
|
39
|
+
- A `config` directory with site configuration
|
|
40
|
+
- A minimal `package.json` with Mordoc as a dependency
|
|
41
|
+
- Scripts for development and building
|
|
42
|
+
|
|
43
|
+
## Getting started after creation
|
|
44
|
+
|
|
45
|
+
After creating your project:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
cd my-docs
|
|
49
|
+
npm run dev
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
This will start a development server at http://localhost:3000.
|
|
53
|
+
|
|
54
|
+
To build your site for production:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
npm run build
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Requirements
|
|
61
|
+
|
|
62
|
+
- Node.js 14 or later
|
|
63
|
+
|
|
64
|
+
## License
|
|
65
|
+
|
|
66
|
+
MIT
|
package/index.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "create-mordoc-app",
|
|
3
|
+
"repoitory" :{
|
|
4
|
+
"type": "git",
|
|
5
|
+
"url": "https://github.com/shiva-varanasi/create-mordoc-app.git"
|
|
6
|
+
},
|
|
7
|
+
"version": "0.0.1",
|
|
8
|
+
"description": "Create Mordoc documentation sites with one command",
|
|
9
|
+
"main": "index.js",
|
|
10
|
+
"bin": {
|
|
11
|
+
"create-mordoc-app": "./index.js"
|
|
12
|
+
},
|
|
13
|
+
"author": "Shiva Varanasi",
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"mordoc": "^0.1.4"
|
|
17
|
+
},
|
|
18
|
+
"engines": {
|
|
19
|
+
"node": ">=18.0.0"
|
|
20
|
+
}
|
|
21
|
+
}
|