nattoppet 2.1.1 → 4.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/package.json CHANGED
@@ -1,20 +1,44 @@
1
1
  {
2
2
  "name": "nattoppet",
3
+ "version": "4.1.0",
3
4
  "description": "A tiny macro-based markup language for blogging",
4
- "author": "Shiwei Zhang <ylxdzsw@gmail.com>",
5
- "version": "2.1.1",
5
+ "author": "ylxdzsw <ylxdzsw@gmail.com>",
6
+ "license": "MIT",
7
+ "type": "module",
8
+ "files": [
9
+ "dist",
10
+ "GUIDE.md",
11
+ "readme.md"
12
+ ],
13
+ "bin": {
14
+ "nattoppet": "./dist/nattoppet.js",
15
+ "nattoppet-dev": "./dist/nattoppet-dev.js",
16
+ "nattoppet-init": "./dist/nattoppet-init.js",
17
+ "nattoppet-native": "./dist/nattoppet-native.js"
18
+ },
19
+ "scripts": {
20
+ "build": "node scripts/build-package.mjs",
21
+ "build:binary": "bun build ./nattoppet.ts --compile --outfile=./binary-dist/nattoppet",
22
+ "prepack": "npm run build",
23
+ "dev": "node nattoppet-dev.ts",
24
+ "test": "node --test",
25
+ "test:bun": "bun test",
26
+ "test:watch": "node --test --watch",
27
+ "compile": "node nattoppet.ts",
28
+ "init": "node nattoppet-init.ts",
29
+ "native": "node nattoppet-native.ts"
30
+ },
6
31
  "dependencies": {
7
- "coffeescript": "^2.6.1",
8
- "html-minifier": "^4.0.0",
9
- "katex": "^0.15.0",
10
- "less": "^4.1.2",
11
- "marked": "^4.0.10"
32
+ "coffeescript": "^2.7.0",
33
+ "html-minifier-terser": "^7.2.0",
34
+ "katex": "0.16.45",
35
+ "less": "^4.2.0",
36
+ "marked": "^9.1.6"
12
37
  },
13
- "bin": {
14
- "nattoppet": "./nattoppet.js",
15
- "nattoppet-dev": "./nattoppet-dev.js",
16
- "nattoppet-native": "./nattoppet-native.js"
38
+ "devDependencies": {
39
+ "esbuild": "^0.25.0"
17
40
  },
18
- "license": "MIT",
19
- "repository": "https://github.com/ylxdzsw/nattoppet.git"
41
+ "engines": {
42
+ "node": ">=22.18.0"
43
+ }
20
44
  }
package/readme.md CHANGED
@@ -1,33 +1,52 @@
1
1
  nattoppet
2
2
  =========
3
3
 
4
- A tiny markup language and several themes for making documents, slides, or web apps as single-file bundled html or
5
- executable.
4
+ A tiny markup language and themes for making documents, slides, or web apps as single-file bundled html or executables.
6
5
 
7
6
  ### Usage
8
7
 
9
- compile a nattoppet file:
8
+ Install Nattoppet with Node.js 22.18 or newer:
10
9
 
11
- ```
12
- $ npm exec nattoppet in.ymd > out.html
10
+ ```bash
11
+ npm install -g nattoppet
13
12
  ```
14
13
 
15
- compile a nattoppet file but don't minimize (for debugging):
14
+ Compile a nattoppet file:
16
15
 
17
- ```
18
- $ npm exec nattoppet in.ymd --dev > out.html
16
+ ```bash
17
+ nattoppet in.ymd > out.html
19
18
  ```
20
19
 
21
- watch a nattoppet file and rebuild it whenever it changes; open a browser to view the compiled page
20
+ Compile a nattoppet file but don't minimize (for debugging):
22
21
 
22
+ ```bash
23
+ nattoppet in.ymd --dev > out.html
23
24
  ```
24
- $ npm exec nattoppet-dev in.ymd
25
+
26
+ Open a browser to preview a nattoppet file; rebuild every time the page is refreshed:
27
+
28
+ ```bash
29
+ nattoppet-dev in.ymd
25
30
  ```
26
31
 
27
- build a double-clickable executable for the page
32
+ Initialize a new project:
28
33
 
34
+ ```bash
35
+ nattoppet-init form
29
36
  ```
30
- $ npm exec nattoppet-native init
31
- $ (edit the metadata as needed)
32
- $ npm exec nattoppet-native build in.ymd
37
+
38
+ Build a double-clickable executable for the page:
39
+
40
+ ```bash
41
+ nattoppet-native init
42
+ # (edit the metadata as needed)
43
+ nattoppet-native build in.ymd
33
44
  ```
45
+
46
+
47
+ ### History
48
+
49
+ - 1.0: This project started as an experiment of co.js to replicate gulp.js, when async/await was not a thing and wind.js was the cool guy that everyone was talking about.
50
+ - 2.0: Later I decided to build ymd.js, a custom LaTeX-style macro-based markup language for blogging, and turned nattoppet a bundler. Promise landed on JavaScript, and async/await became available with babel.
51
+ - 3.0: I became a minimalist and stripped down all dependencies, merged ymd.js and nattoppet, and flattened the directory. I have also migrated to Deno to further remove the nodejs clutters.
52
+ - 4.0: AI came. As an experimental project, nattoppet was put to test AI. Kimi 2.5 successfully ported it from Deno to Bun in half an hour, with all posts on my blog builds without error. It made me feel empty, but I have to embrace it. This project will be fully vibed from now on.
package/.editorconfig DELETED
@@ -1,15 +0,0 @@
1
- root = true
2
-
3
- [*]
4
- indent_style = space
5
- indent_size = 4
6
- end_of_line = lf
7
- charset = utf-8
8
- trim_trailing_whitespace = true
9
- insert_final_newline = true
10
-
11
- [*.md]
12
- trim_trailing_whitespace = false
13
-
14
- [package.json]
15
- indent_size = 2