inkpen 0.7.1 → 0.8.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.
- checksums.yaml +4 -4
- data/CLAUDE.md +64 -4
- data/README.md +4 -0
- data/app/assets/javascripts/inkpen/export/markdown.js +12 -3
- data/app/assets/javascripts/inkpen.bundle.js +1163 -0
- data/app/assets/javascripts/inkpen.bundle.js.map +7 -0
- data/config/importmap.rb +19 -170
- data/lib/inkpen/markdown_mode.rb +213 -0
- data/lib/inkpen/version.rb +1 -1
- metadata +9 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d494c04bfb8bd300d7530a7bf25bf25bcb9de03940d05efae4b7000056344ba4
|
|
4
|
+
data.tar.gz: 242089e92a90223d06f5ea5569df0e3cd8653c073705989b0b2c168ef8d9f65b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8622c8eec93c586b4e588d830a8f14a1b235a38c1a88269dc4327952586e308898e4ed20b5d2fac9821af1e79c67deb5263a920969c718d3c160caacca5abf91
|
|
7
|
+
data.tar.gz: 6d4efde0df050df0601d615662443887aca6ab7f267c80ad1903cd94db63fd3c9277fe4768246db9d5419b7659c66d0a2cda6f04c5f0141e88dfd3b41bbb3240
|
data/CLAUDE.md
CHANGED
|
@@ -132,10 +132,70 @@ app/
|
|
|
132
132
|
|
|
133
133
|
## Development
|
|
134
134
|
|
|
135
|
+
### Ruby side
|
|
136
|
+
|
|
135
137
|
```bash
|
|
136
|
-
|
|
137
|
-
bundle exec rake test
|
|
138
|
+
bundle install
|
|
139
|
+
bundle exec rake test # Minitest unit tests
|
|
140
|
+
bin/console # IRB with Inkpen loaded
|
|
141
|
+
```
|
|
138
142
|
|
|
139
|
-
|
|
140
|
-
|
|
143
|
+
### JavaScript side (since 0.8.0)
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
npm install # installs production deps + esbuild + vitest
|
|
147
|
+
npm test # runs the spec 01 markdown round-trip tests (vitest)
|
|
148
|
+
npm run build # rebuilds app/assets/javascripts/inkpen.bundle.js
|
|
149
|
+
npm run build:check # validates the bundle: parses, has expected
|
|
150
|
+
# exports, contains zero third-party CDN refs
|
|
141
151
|
```
|
|
152
|
+
|
|
153
|
+
**The bundle is committed to the repo.** Run `npm run build` after every
|
|
154
|
+
JS change so consumers don't need to install npm.
|
|
155
|
+
|
|
156
|
+
### Releasing a new version
|
|
157
|
+
|
|
158
|
+
See `02-addons/107-inkpen-docs/docs/release-process.md` for the full
|
|
159
|
+
release runbook. TL;DR:
|
|
160
|
+
|
|
161
|
+
1. Bump `lib/inkpen/version.rb` + `inkpen.gemspec` (stub line +
|
|
162
|
+
`s.version`).
|
|
163
|
+
2. `npm run build && npm run build:check && npm test &&
|
|
164
|
+
bundle exec rake test`.
|
|
165
|
+
3. `bundle exec rake build` → `pkg/inkpen-X.Y.Z.gem`.
|
|
166
|
+
4. Smoke test in InventList (open Nodepad, confirm zero `esm.sh`
|
|
167
|
+
requests in DevTools).
|
|
168
|
+
5. Publish (path-pinned / private gemserver / rubygems — see release
|
|
169
|
+
doc).
|
|
170
|
+
|
|
171
|
+
## Bundle / vendoring (since 0.8.0)
|
|
172
|
+
|
|
173
|
+
`config/importmap.rb` no longer pins to `esm.sh`. All upstream
|
|
174
|
+
dependencies (TipTap@2.10.3, ProseMirror@1.x, lowlight, highlight.js,
|
|
175
|
+
tippy, popperjs, linkifyjs, and three third-party TipTap extensions)
|
|
176
|
+
are vendored into a single ESM bundle at
|
|
177
|
+
`app/assets/javascripts/inkpen.bundle.js` (1.9 MB minified, source map
|
|
178
|
+
beside it).
|
|
179
|
+
|
|
180
|
+
The build entrypoint is `app/assets/javascripts/inkpen/index.js`. The
|
|
181
|
+
bundle preserves `import "inkpen"` as a side-effecting import that
|
|
182
|
+
registers `inkpen--editor`, `inkpen--toolbar`,
|
|
183
|
+
`inkpen--sticky-toolbar` Stimulus controllers on `window.Stimulus`
|
|
184
|
+
(or starts its own Application if the host hasn't already).
|
|
185
|
+
|
|
186
|
+
**Host externals kept out of the bundle** (host provides them):
|
|
187
|
+
|
|
188
|
+
- `@hotwired/stimulus`
|
|
189
|
+
- `@hotwired/turbo-rails`
|
|
190
|
+
|
|
191
|
+
**Why this exists:** three production CDN incidents on 2026-05-14
|
|
192
|
+
caused by importmap pinning to esm.sh. Plan and audit live at
|
|
193
|
+
`02-addons/107-inkpen-docs/plans/05-vendor-bundle-cdn-decoupling.md`.
|
|
194
|
+
|
|
195
|
+
## Internal planning docs
|
|
196
|
+
|
|
197
|
+
Inkpen has a dedicated planning surface at
|
|
198
|
+
`02-addons/107-inkpen-docs/`. Roadmap, plans, sessions, handoffs,
|
|
199
|
+
audits all live there. Don't recreate that structure here; this gem
|
|
200
|
+
ships its own consumer-facing docs in `docs/` (README, CHANGELOG,
|
|
201
|
+
FEATURES, ROADMAP, MARKDOWN_MODE planning doc, audits).
|
data/README.md
CHANGED
|
@@ -400,6 +400,10 @@ bundle exec rake test # Run tests
|
|
|
400
400
|
bin/console # Interactive console
|
|
401
401
|
```
|
|
402
402
|
|
|
403
|
+
## Used by
|
|
404
|
+
|
|
405
|
+
Powering the series editor at [inventlist.com/stream?type=series](https://inventlist.com/stream?type=series) — where indie builders write build-in-public stories.
|
|
406
|
+
|
|
403
407
|
## Contributing
|
|
404
408
|
|
|
405
409
|
Bug reports and pull requests are welcome on GitHub.
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
* Supports frontmatter, tables, task lists, callouts, and custom blocks.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
import { parseMarkdownToHTMLReal } from "./markdown_parser.js"
|
|
9
|
+
|
|
8
10
|
// Mark serializers for inline formatting
|
|
9
11
|
const MARK_SERIALIZERS = {
|
|
10
12
|
bold: (text) => `**${text}**`,
|
|
@@ -74,13 +76,20 @@ export function importFromMarkdown(markdown, schema, options = {}) {
|
|
|
74
76
|
// Parse frontmatter if present
|
|
75
77
|
const { content, frontmatter } = parseFrontmatter(markdown)
|
|
76
78
|
|
|
77
|
-
//
|
|
78
|
-
|
|
79
|
+
// Parser selection. Default is the legacy regex parser to preserve
|
|
80
|
+
// behavior for existing callers. Pass `options.parser: "real"` to opt
|
|
81
|
+
// into the GFM-correct marked-based parser. Step 6 of spec 01 will flip
|
|
82
|
+
// the default once round-trip fixtures pass.
|
|
83
|
+
const parser = options.parser === "real" ? "real" : "legacy"
|
|
84
|
+
const html = parser === "real"
|
|
85
|
+
? parseMarkdownToHTMLReal(content)
|
|
86
|
+
: parseMarkdownToHTML(content)
|
|
79
87
|
|
|
80
88
|
// Return structured result
|
|
81
89
|
return {
|
|
82
90
|
html,
|
|
83
|
-
frontmatter
|
|
91
|
+
frontmatter,
|
|
92
|
+
parser
|
|
84
93
|
}
|
|
85
94
|
}
|
|
86
95
|
|