@jxsuite/parser 1.8.2 → 2.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/LICENSE +1 -1
- package/README.md +33 -0
- package/dist/content-loader.js +34611 -62
- package/dist/content.js +119 -3
- package/dist/markdown.js +1990 -481
- package/dist/serialize.js +1889 -1225
- package/package.json +8 -8
- package/schemas/project.fragment.schema.json +138 -6
- package/src/Content.class.json +6 -3
- package/src/Markdown.class.json +14 -3
- package/src/alerts.ts +257 -0
- package/src/content-links.ts +343 -0
- package/src/content-loader.ts +863 -75
- package/src/content-routes.ts +369 -0
- package/src/content-rules.ts +474 -0
- package/src/content.ts +49 -13
- package/src/grammars/caddyfile.ts +86 -0
- package/src/highlight.ts +49 -9
- package/src/inert.ts +101 -0
- package/src/markdown.ts +43 -17
- package/src/md.ts +29 -6
- package/src/transpile.ts +60 -4
- package/src/types.ts +17 -0
- package/src/walk.ts +97 -0
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -75,6 +75,39 @@ Query them from any page or component:
|
|
|
75
75
|
|
|
76
76
|
`ContentEntry` matches on the entry id (slug) by default; set `field` to match a frontmatter field (e.g. `"sku"`) instead.
|
|
77
77
|
|
|
78
|
+
### Publishing a folder of notes
|
|
79
|
+
|
|
80
|
+
A content type can publish a folder written for an editor, such as an Obsidian vault, as it is:
|
|
81
|
+
|
|
82
|
+
```json
|
|
83
|
+
{
|
|
84
|
+
"content": {
|
|
85
|
+
"kb": {
|
|
86
|
+
"source": "../..",
|
|
87
|
+
"format": "Markdown",
|
|
88
|
+
"exclude": ["internal/**", "STYLE.md", ".*/**", "**/node_modules/**"],
|
|
89
|
+
"where": { "publish": true, "status": { "$ne": "draft" } },
|
|
90
|
+
"route": "/kb/{category:slug}/{slug}/",
|
|
91
|
+
"indexRoute": "/kb/{dir:slug}/",
|
|
92
|
+
"links": "warn",
|
|
93
|
+
"alerts": { "NOTE": "doc-note", "TIP": "doc-tip", "WARNING": "doc-warning" }
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
| Option | What it does |
|
|
100
|
+
| ------------ | ------------------------------------------------------------------------------------------------------------------- |
|
|
101
|
+
| `exclude` | Globs (relative to `source`) for files that are never read |
|
|
102
|
+
| `where` | A declarative frontmatter filter: literals, `$ne`, `$in`, `$nin`, `$exists`, `$gt`, `$gte`, `$lt`, `$lte`; AND only |
|
|
103
|
+
| `idField` | Frontmatter field used as the entry id |
|
|
104
|
+
| `route` | URL template for each entry; stamped at `_meta.route` and `_meta.url` |
|
|
105
|
+
| `indexRoute` | URL template for a folder's `README.md` or `index.md` |
|
|
106
|
+
| `links` | `warn` (default), `error` or `ignore`: how a relative link to an entry with no page is reported |
|
|
107
|
+
| `alerts` | GitHub alert type to custom element, `true` for the built-in markup, `null` for a plain blockquote |
|
|
108
|
+
|
|
109
|
+
With a `route`, `$paths: { "contentType": "kb" }` needs no parameter name, a `ContentEntry` with no `id` binds to its page, relative links between entries are rewritten to routes, and `README.md` maps to its folder. Full reference: [Content collections](https://jxsuite.com/docs/framework/site/content-collections) and [Obsidian vault as content](https://jxsuite.com/docs/framework/site/obsidian-vault).
|
|
110
|
+
|
|
78
111
|
## `Markdown`
|
|
79
112
|
|
|
80
113
|
One class carries every format capability:
|