@markdownspace/site-generator 1.0.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/LICENSE ADDED
@@ -0,0 +1,15 @@
1
+ ISC License
2
+
3
+ Copyright (c) 2024-2026 Devon Bradley and the markdown.space contributors
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted, provided that the above
7
+ copyright notice and this permission notice appear in all copies.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
12
+ SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
15
+ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,85 @@
1
+ # Markdown Space Site Generator
2
+
3
+ Turn markdown / MDX documents into complete, styled websites. This is the
4
+ site generation engine behind [markdown.space](https://markdown.space) — it
5
+ renders markdown with YAML frontmatter into full HTML pages with Bootstrap or
6
+ Bulma themes, navbars, syntax highlighting, PWA support, and MDX/React
7
+ components.
8
+
9
+ ## Install
10
+
11
+ ```
12
+ npm i @markdownspace/site-generator
13
+ ```
14
+
15
+ ## Usage
16
+
17
+ ```js
18
+ import SiteGenerator, {
19
+ parseFrontmatter,
20
+ AvailableBootstrapThemes,
21
+ AvailableBulmaThemes
22
+ } from '@markdownspace/site-generator'
23
+
24
+ const html = SiteGenerator.generate(
25
+ project, // { id, name, slug, pwa_support, documents? }
26
+ doc, // { id, name, slug }
27
+ [], // template contents to prefix (usually `_templates/*` docs)
28
+ rawMarkdown, // the document body, optionally starting with YAML frontmatter
29
+ baseURL // e.g. 'https://example.com/'
30
+ )
31
+ ```
32
+
33
+ `generate()` returns a complete HTML document string.
34
+
35
+ The same package runs in the browser (live previews), in Node, and in
36
+ Cloudflare Workers.
37
+
38
+ ### Frontmatter options
39
+
40
+ Control the generated site from YAML frontmatter at the top of the document:
41
+
42
+ ```yaml
43
+ ---
44
+ title: My Page
45
+ description: A page about something
46
+ theme: litera # bootswatch/bulmaswatch theme name, or a full CSS URL
47
+ cssFramework: bulma # 'bulma' (default) or 'bootstrap'
48
+ navbar: true
49
+ navbarTheme: dark
50
+ navbarLogo: /logo.png
51
+ navbarAutoLinks: true # navbar links to every document in the project
52
+ overrideNavLinks: # or explicit links
53
+ - text: Home
54
+ href: /
55
+ mdx: true # compile MDX/JSX (React via esm.sh)
56
+ autoclasses: # extra classes for rehype-add-classes
57
+ h2: title is-4
58
+ favicon: /favicon.ico
59
+ ogImage: /og-image.png
60
+ filesHost: https://files.example.com # override asset host (default: https://files.markdown.space)
61
+ defaultFaviconBase: https://cdn.example.com # default favicon set base (default: markdown.space R2)
62
+ codeTheme: atom-dark-one
63
+ headPrepend: '<!-- ... -->'
64
+ headAppend: ''
65
+ bodyPrepend: ''
66
+ bodyAppend: ''
67
+ ---
68
+ ```
69
+
70
+ ## Development
71
+
72
+ ```
73
+ npm i
74
+ npm run build # esbuild bundle to dist/ + type declarations to dist-types/
75
+ npm test # vitest
76
+ npm run build:w # watch mode
77
+ ```
78
+
79
+ The bundle inlines the mustache layout templates (`src/templates/*.mustache`)
80
+ and polyfills node built-ins so the output runs in browsers and workers.
81
+
82
+ ## Releasing
83
+
84
+ Releases are published to npm automatically when a GitHub release is created
85
+ (`.github/workflows/publish-npm.yml`).