docula 0.9.1 → 0.9.3

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 CHANGED
@@ -1,16 +1,14 @@
1
1
  ![Docula](site/logo.svg)
2
2
 
3
- ---
3
+ # Beautiful Website for Your Projects
4
4
 
5
- ## Beautiful Website for Your Projects
6
5
  [![tests](https://github.com/jaredwray/docula/actions/workflows/tests.yaml/badge.svg)](https://github.com/jaredwray/docula/actions/workflows/tests.yaml)
7
6
  [![GitHub license](https://img.shields.io/github/license/jaredwray/docula)](https://github.com/jaredwray/docula/blob/master/LICENSE)
8
7
  [![codecov](https://codecov.io/gh/jaredwray/docula/graph/badge.svg?token=RS0GPY4V4M)](https://codecov.io/gh/jaredwray/docula)
9
8
  [![npm](https://img.shields.io/npm/dm/docula)](https://npmjs.com/package/docula)
10
9
  [![npm](https://img.shields.io/npm/v/docula)](https://npmjs.com/package/docula)
11
10
 
12
- ---
13
- ## Table of Contents
11
+ # Table of Contents
14
12
  - [Features](#features)
15
13
  - [Getting Started](#getting-started)
16
14
  - [Using Your own Template](#using-your-own-template)
@@ -19,20 +17,19 @@
19
17
  - [Code of Conduct and Contributing](#code-of-conduct-and-contributing)
20
18
  - [License - MIT](#license)
21
19
 
22
- ## Features
20
+ # Features
23
21
  * No configuration requrired. Just setup the folder structure with a logo, favicon, and css file.
24
22
  * Builds a static website that can be hosted anywhere.
25
- * For more complex projects easily add a `docula.config.js` or `docula.config.ts` file to customize the build process. With PRE and POST methods.
23
+ * For more complex projects easily add a `docula.config.mjs` file to customize the build process. With PRE and POST methods.
26
24
  * Support for single page with readme or multiple markdown pages in a docs folder.
27
25
  * Will generate a sitemap.xml and robots.txt for your site.
28
26
  * Uses Github release notes to generate a changelog / releases page.
29
27
  * Uses Github to show contributors and link to their profiles.
30
28
  * Simple search is provided by default out of the box.
31
29
 
32
- ## Getting Started
33
-
34
- ## 1. Install docula
30
+ # Getting Started
35
31
 
32
+ ## Install docula via init
36
33
  > npx docula init
37
34
 
38
35
  This will create a folder called site with the following structure:
@@ -43,21 +40,21 @@ site
43
40
  ├───logo.png
44
41
  ├───favicon.ico
45
42
  ├───README.md
46
- ├───docula.config.js
43
+ ├───docula.config.mjs
47
44
  ```
48
45
  Note: for typescript do 'docula init --typescript'
49
46
 
50
- ## 2. Add your content
47
+ ## Add your content
51
48
 
52
49
  Simply replace the logo, favicon, and css file with your own. The readme is your root project readme and you just need to at build time move it over to the site folder. If you have it at the root of the project and this is a folder inside just delete the README.md file in the site folder and docula will copy it over for you automatically.
53
50
 
54
- ## 3. Build your site
51
+ ## Build your site
55
52
 
56
53
  > npx docula
57
54
 
58
55
  This will build your site and place it in the `dist` folder. You can then host it anywhere you like.
59
56
 
60
- ## Using Your own Template
57
+ # Using Your own Template
61
58
 
62
59
  If you want to use your own template you can do so by adding a `docula.config.ts` file to the root of your project. This file will be used to configure the build process.
63
60
 
@@ -65,7 +62,7 @@ or at the command line:
65
62
 
66
63
  > npx docula --template path/to/template
67
64
 
68
- ## Building Multiple Pages
65
+ # Building Multiple Pages
69
66
 
70
67
  If you want to build multiple pages you can easily do that by adding in a `docs` folder to the root of the site folder. Inside of that folder you can add as many pages as you like. Each page will be a markdown file and it will generate a table of contents for you. Here is an example of what it looks like:
71
68
 
@@ -74,7 +71,7 @@ site
74
71
  ├───site.css
75
72
  ├───logo.png
76
73
  ├───favicon.ico
77
- ├───docula.config.ts
74
+ ├───docula.config.mjs
78
75
  ├───docs
79
76
  │ ├───getting-started.md
80
77
  │ ├───contributing.md
@@ -85,24 +82,22 @@ site
85
82
  The `readme.md` file will be the root page and the rest will be added to the table of contents. If you want to control the title or order of the pages you can do so by setting the `title` and `order` properties in the front matter of the markdown file. Here is an example:
86
83
 
87
84
  ```md
88
- ---
89
85
  title: Getting Started
90
86
  order: 2
91
- ---
92
87
  ```
93
88
 
94
- ## Helper Functions for Markdown
89
+ # Helper Functions for Markdown
95
90
 
96
91
  docula comes with some helper functions that you can use in your markdown files.
97
92
  * `doculaHelpers.getFrontMatter(fileName)` - Gets the front matter of a markdown file.
98
93
  * `doculaHelpers.setFrontMatter(fileName, frontMatter)` - Sets the front matter of a markdown file.
99
94
  * `doculaHelpers.createDoc(source, destination, frontMatter?, contentFn[]?)` - Creates a markdown file with the specified front matter and content. The contentFn is a function that is executed on the original content of the file. This is useful if you want to remove content from the original file.
100
95
 
101
- ### Remove html content
96
+ # Remove html content
102
97
 
103
98
  In some cases your markdown file will have html content in it such as the logo of your project or a badge. You can use the `doculaHelpers.removeHtmlContent()` helper function to remove that content from the page. Here is an example:
104
99
 
105
- ### Get and Set the Front Matter of a Markdown File
100
+ # Get and Set the Front Matter of a Markdown File
106
101
 
107
102
  You can use the `doculaHelpers.getFrontMatter()` and `doculaHelpers.setFrontMatter()` helper functions to get and set the front matter of a markdown file. Here is an example:
108
103
 
@@ -112,9 +107,9 @@ frontMatter.title = 'My Title';
112
107
  doculaHelpers.setFrontMatter('../readme.md', frontMatter);
113
108
  ```
114
109
 
115
- ## Code of Conduct and Contributing
110
+ # Code of Conduct and Contributing
116
111
  [Code of Conduct](CODE_OF_CONDUCT.md) and [Contributing](CONTRIBUTING.md) guidelines.
117
112
 
118
- ## License
113
+ # License
119
114
 
120
115
  MIT © [Jared Wray](https://jaredwray.com)
package/dist/docula.js CHANGED
@@ -802,8 +802,8 @@ var Docula = class {
802
802
  if (!fs3.existsSync(sitePath)) {
803
803
  fs3.mkdirSync(sitePath);
804
804
  }
805
- const doculaConfigFile = "./init/docula.config.cjs";
806
- fs3.copyFileSync(doculaConfigFile, `${sitePath}/docula.config.cjs`);
805
+ const doculaConfigFile = "./init/docula.config.mjs";
806
+ fs3.copyFileSync(doculaConfigFile, `${sitePath}/docula.config.mjs`);
807
807
  fs3.copyFileSync("./init/logo.png", `${sitePath}/logo.png`);
808
808
  fs3.copyFileSync("./init/favicon.ico", `${sitePath}/favicon.ico`);
809
809
  fs3.copyFileSync("./init/variables.css", `${sitePath}/variables.css`);
@@ -816,7 +816,7 @@ var Docula = class {
816
816
  }
817
817
  async loadConfigFile(sitePath) {
818
818
  if (fs3.existsSync(sitePath)) {
819
- const configFile = `${sitePath}/docula.config.cjs`;
819
+ const configFile = `${sitePath}/docula.config.mjs`;
820
820
  if (fs3.existsSync(configFile)) {
821
821
  this._configFileModule = await import(configFile);
822
822
  }
@@ -1,4 +1,4 @@
1
- module.exports.options = {
1
+ export const options = {
2
2
  templatePath: './template',
3
3
  outputPath: './dist',
4
4
  sitePath: './site',
package/package.json CHANGED
@@ -1,14 +1,13 @@
1
1
  {
2
2
  "name": "docula",
3
- "version": "0.9.1",
3
+ "version": "0.9.3",
4
4
  "description": "Beautiful Website for Your Projects",
5
5
  "type": "module",
6
- "main": "./dist/docula.cjs",
6
+ "main": "./dist/docula.js",
7
7
  "module": "./dist/docula.js",
8
8
  "types": "./dist/docula.d.ts",
9
9
  "exports": {
10
10
  ".": {
11
- "require": "./dist/docula.cjs",
12
11
  "import": "./dist/docula.js"
13
12
  }
14
13
  },
@@ -49,27 +48,26 @@
49
48
  "dependencies": {
50
49
  "axios": "^1.7.7",
51
50
  "cheerio": "^1.0.0",
52
- "ecto": "^4.0.0",
53
- "express": "^4.21.0",
51
+ "ecto": "^4.1.2",
52
+ "express": "^4.21.1",
54
53
  "feed": "^4.2.2",
55
54
  "gray-matter": "^4.0.3",
56
55
  "he": "^1.2.0",
57
56
  "js-yaml": "^4.1.0",
58
- "keyv": "^5.0.1",
59
57
  "update-notifier": "^7.3.1"
60
58
  },
61
59
  "devDependencies": {
62
- "@types/express": "^4.17.21",
60
+ "@types/express": "^5.0.0",
63
61
  "@types/he": "^1.2.3",
64
62
  "@types/js-yaml": "^4.0.9",
65
- "@types/node": "^22.5.5",
63
+ "@types/node": "^22.7.5",
66
64
  "@types/update-notifier": "^6.0.8",
67
- "@vitest/coverage-v8": "^2.1.1",
65
+ "@vitest/coverage-v8": "^2.1.2",
68
66
  "rimraf": "^6.0.1",
69
67
  "tsup": "^8.3.0",
70
- "typescript": "^5.6.2",
71
- "vitest": "^2.1.1",
72
- "webpack": "^5.94.0",
68
+ "typescript": "^5.6.3",
69
+ "vitest": "^2.1.2",
70
+ "webpack": "^5.95.0",
73
71
  "xo": "^0.59.3"
74
72
  },
75
73
  "xo": {