jekyll-carve 0.1.4 → 0.1.5
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/README.md +9 -287
- data/lib/jekyll/carve/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ee0dd725f2e978b4b58399574f0048b8c3b57e065c4b829313a49b19405181b6
|
|
4
|
+
data.tar.gz: 9aafac417e690c501f476bba589f0eb59bdda2987ce9a76b5fd6144ef80c199b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 63a663cb509fc3fa5ff68b776be24add79aedf2dfdf3523c2fbab7d0d4d4f3d390015aa027722e8a22e48cda0dec6c3106fdf038179febdc5c245678ec9fc89e
|
|
7
|
+
data.tar.gz: 72d041918581593eef7bb4cd4dd3f57ab96f1d868b9f15cdb207259557c704c150813fbb79df03b30350ff5b3f634ee12f2c7d6aef20254f55d719a12a547a4d
|
data/README.md
CHANGED
|
@@ -1,303 +1,25 @@
|
|
|
1
1
|
# jekyll-carve
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
[Carve](https://github.com/markup-carve/carve) markup language. It renders
|
|
5
|
-
`.crv` pages to HTML by delegating to the native
|
|
6
|
-
[`carve-lang`](https://github.com/markup-carve/carve-rb) gem (`Carve.to_html`). No
|
|
7
|
-
parser is reimplemented here; this is a thin `Jekyll::Converter` adapter over
|
|
8
|
-
the engine.
|
|
3
|
+
Jekyll converter for `.crv` pages, using the carve-lang gem 0.1.11 or later. It renders Carve pages through the native engine. Read the [Carve documentation](https://markup-carve.github.io/carve/) for the language syntax.
|
|
9
4
|
|
|
10
5
|
## Install
|
|
11
6
|
|
|
12
|
-
Add both gems to your site's `Gemfile`:
|
|
13
|
-
|
|
14
|
-
```ruby
|
|
15
|
-
# Gemfile
|
|
16
|
-
gem "jekyll-carve"
|
|
17
|
-
gem "carve-lang" # the native Carve engine (a runtime dependency, listed for clarity)
|
|
18
|
-
```
|
|
19
|
-
|
|
20
7
|
```sh
|
|
21
|
-
bundle
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
Then enable the plugin in `_config.yml`:
|
|
25
|
-
|
|
26
|
-
```yaml
|
|
27
|
-
plugins:
|
|
28
|
-
- jekyll-carve
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
> [!NOTE]
|
|
32
|
-
> The `carve-lang` gem ships a Rust native extension and is compiled at install
|
|
33
|
-
> time. It requires a Rust toolchain (`cargo`) and Ruby development headers.
|
|
34
|
-
> See the carve-rb README for build notes (including the libclang/`stdarg.h`
|
|
35
|
-
> workaround on some systems).
|
|
36
|
-
|
|
37
|
-
## Configuration
|
|
38
|
-
|
|
39
|
-
Carve engine options are read from `_config.yml` under the `carve` key:
|
|
40
|
-
|
|
41
|
-
```yaml
|
|
42
|
-
carve:
|
|
43
|
-
extensions:
|
|
44
|
-
- heading_permalinks
|
|
45
|
-
- math_block
|
|
46
|
-
- autolink
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
`carve.extensions` is an array of opt-in Carve extension names (Strings or
|
|
50
|
-
hyphenated/underscored forms, passed straight through to the engine). When the
|
|
51
|
-
key is absent, no extensions are enabled. The recognized extensions are listed
|
|
52
|
-
in `Carve::EXTENSIONS`; an unknown name raises `ArgumentError` at build time.
|
|
53
|
-
|
|
54
|
-
### `carve.symbols` - what `:smile:` renders as
|
|
55
|
-
|
|
56
|
-
Carve parses `:name:` in core, no extension needed, but what a name renders as
|
|
57
|
-
is a render option. With no map configured a shortcode renders as its own
|
|
58
|
-
source text:
|
|
59
|
-
|
|
60
|
-
```text
|
|
61
|
-
Ship it :smile:
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
```html
|
|
65
|
-
<p>Ship it :smile:</p>
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
`carve.symbols` supplies the map. It takes a mapping written inline:
|
|
69
|
-
|
|
70
|
-
```yaml
|
|
71
|
-
carve:
|
|
72
|
-
symbols:
|
|
73
|
-
smile: "😄"
|
|
74
|
-
ship: "🚀"
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
or a path to a JSON object, so a large map does not have to live in
|
|
78
|
-
`_config.yml`:
|
|
79
|
-
|
|
80
|
-
```yaml
|
|
81
|
-
carve:
|
|
82
|
-
symbols: _data/symbols.json
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
```json
|
|
86
|
-
{
|
|
87
|
-
"smile": "😄",
|
|
88
|
-
"ship": "🚀"
|
|
89
|
-
}
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
or a list mixing both, merged left to right, so a generated map can carry a few
|
|
93
|
-
site-specific overrides:
|
|
94
|
-
|
|
95
|
-
```yaml
|
|
96
|
-
carve:
|
|
97
|
-
symbols:
|
|
98
|
-
- _data/emoji.json
|
|
99
|
-
- ship: "🚀"
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
A path is resolved against the site source and confined to it, symlinks
|
|
103
|
-
included - a link inside the source pointing at a file outside it is refused
|
|
104
|
-
rather than followed. A name that
|
|
105
|
-
is not in the map keeps rendering as its own text, and the map does not loosen
|
|
106
|
-
Carve's word-boundary rule: `10:30:` and `a:smile:b` are not shortcodes, and
|
|
107
|
-
`` `:smile:` `` inside a code span stays code.
|
|
108
|
-
|
|
109
|
-
No emoji table ships with this plugin. Jekyll has no emoji database in core, so
|
|
110
|
-
bundling one here would be a second source of truth next to whatever your
|
|
111
|
-
Markdown pages already use (`jemoji`, for instance) - and the two would drift.
|
|
112
|
-
Point `carve.symbols` at a JSON file you generate from that same source and
|
|
113
|
-
both page types resolve one map.
|
|
114
|
-
|
|
115
|
-
A misconfigured map fails the build rather than being warned past: a missing
|
|
116
|
-
file, invalid JSON, a JSON top level that is not an object, or a value that is
|
|
117
|
-
not a string each raise `ArgumentError` naming the file or the key. A value is
|
|
118
|
-
not coerced, because it reaches the page raw - `count: 1` is a mistake worth
|
|
119
|
-
stopping for, not something to stringify and emit. A NAME is coerced, since
|
|
120
|
-
YAML hands back a Symbol or a boolean for some unquoted keys and a name never
|
|
121
|
-
reaches the output.
|
|
122
|
-
|
|
123
|
-
> [!WARNING]
|
|
124
|
-
> A symbol value is inserted as **trusted raw output**. It is not escaped, so
|
|
125
|
-
> `smile: "<img src='/s.svg'>"` emits a real `<img>` element rather than
|
|
126
|
-
> escaped text. This is deliberate in the engine - `carve-lang` documents it as
|
|
127
|
-
> "NEVER build a symbols map out of untrusted / user-supplied input" - and it
|
|
128
|
-
> is why this plugin reads the map only from `_config.yml` and from files at
|
|
129
|
-
> paths named there. Never generate `carve.symbols` from page content, from
|
|
130
|
-
> front matter, from a comment system, or from anything else a visitor can
|
|
131
|
-
> influence.
|
|
132
|
-
|
|
133
|
-
### `carve.includes` - pulling one file into another
|
|
134
|
-
|
|
135
|
-
A Carve page can pull another file in with `{{ path }}`. It stays literal until
|
|
136
|
-
the site asks:
|
|
137
|
-
|
|
138
|
-
```yaml
|
|
139
|
-
carve:
|
|
140
|
-
includes: true
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
Includes need carve-lang 0.1.4 or later. On an older engine, a page that
|
|
144
|
-
reaches them stops the build with a message naming the upgrade.
|
|
145
|
-
|
|
146
|
-
Paths resolve relative to the file that wrote them, and nothing resolves outside
|
|
147
|
-
the containment root. The root is Jekyll's source directory unless
|
|
148
|
-
`carve.include_root` names another one, and an include that would leave it is
|
|
149
|
-
not expanded.
|
|
150
|
-
|
|
151
|
-
```yaml
|
|
152
|
-
carve:
|
|
153
|
-
includes: true
|
|
154
|
-
include_root: /srv/shared/fragments
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
`carve.include_root` must be an **absolute** path. A relative one is refused
|
|
158
|
-
rather than resolved, because resolving it lands on whatever directory the build
|
|
159
|
-
ran from, which is not a root anyone chose. The page being rendered has to sit
|
|
160
|
-
inside the root too.
|
|
161
|
-
|
|
162
|
-
A target that cannot be read is reported against the page that asked for it, and
|
|
163
|
-
the directive is left as written. The message does not say whether the file was
|
|
164
|
-
missing or refused by containment: both report `include-unresolved`, so a page
|
|
165
|
-
cannot be used to probe the filesystem. The class is at `--verbose`.
|
|
166
|
-
|
|
167
|
-
Under `jekyll serve`, a page is rebuilt when a target it read changes, because
|
|
168
|
-
every resolved target is registered with Jekyll's regeneration path.
|
|
169
|
-
|
|
170
|
-
A conversion with no page behind it - the converter called directly on a String -
|
|
171
|
-
leaves the directive literal, since there is no file for a relative path to
|
|
172
|
-
resolve against.
|
|
173
|
-
|
|
174
|
-
> [!NOTE]
|
|
175
|
-
> Fragments under the source directory are pages in their own right, so Jekyll
|
|
176
|
-
> will publish them. Exclude them in `_config.yml`, or keep them outside the
|
|
177
|
-
> source and point `include_root` at the tree above both.
|
|
178
|
-
|
|
179
|
-
### `carve.lint` - reporting what renders but is lost
|
|
180
|
-
|
|
181
|
-
Carve's linter reports constructs that parse and render, but not the way the
|
|
182
|
-
author meant: a block attribute that attaches to nothing, a link to an id no
|
|
183
|
-
heading has, an unclosed code fence. Turn it on to see them as build warnings:
|
|
184
|
-
|
|
185
|
-
```yaml
|
|
186
|
-
carve:
|
|
187
|
-
lint: true
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
```
|
|
191
|
-
Carve lint: guide/intro.crv:7:1: unattached-block-attribute: This block attribute reaches no block: ...
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
Each warning names the page, the line and column in the file, and the rule id.
|
|
195
|
-
The line counts the front matter, so it matches your editor; a Liquid tag that
|
|
196
|
-
expands to several lines shifts the lines below it, since the linter reads the
|
|
197
|
-
page after Liquid. Pages still render.
|
|
198
|
-
|
|
199
|
-
To fail the build instead, use `strict`:
|
|
200
|
-
|
|
201
|
-
```yaml
|
|
202
|
-
carve:
|
|
203
|
-
lint: strict
|
|
8
|
+
bundle add jekyll-carve
|
|
204
9
|
```
|
|
205
10
|
|
|
206
|
-
Every page is linted and reported first, then `jekyll build` stops with an
|
|
207
|
-
error before writing the site.
|
|
208
|
-
|
|
209
|
-
The linter reads the same `carve.extensions` the pages render with. With
|
|
210
|
-
`carve.includes` on it also lints each included Carve file, and a finding there
|
|
211
|
-
names that file: `index.crv (parts/intro.crv:3:1): ...`. Include warnings such
|
|
212
|
-
as `include-unresolved` are logged once, by the include pass, but count toward
|
|
213
|
-
`strict`.
|
|
214
|
-
|
|
215
|
-
`carve.lint` needs carve-lang 0.1.11 or later, the first engine that exposes the
|
|
216
|
-
linter. That is why it is this gem's floor.
|
|
217
|
-
|
|
218
11
|
## Usage
|
|
219
12
|
|
|
220
|
-
Create a page with a `.crv` extension. It MUST begin with Jekyll
|
|
221
|
-
YAML front matter, and the Carve body follows below:
|
|
222
|
-
|
|
223
|
-
```text
|
|
224
|
-
---
|
|
225
|
-
layout: default
|
|
226
|
-
title: Home
|
|
227
|
-
---
|
|
228
|
-
# Welcome to *Carve*
|
|
229
|
-
|
|
230
|
-
This is /italic/ and *bold* text.
|
|
231
|
-
|
|
232
|
-
- Apple
|
|
233
|
-
- Banana
|
|
234
|
-
```
|
|
235
|
-
|
|
236
|
-
Note Carve's inline syntax: `*...*` is **strong** (bold) and `/.../` is
|
|
237
|
-
_emphasis_ (italic) - the opposite of Markdown.
|
|
238
|
-
|
|
239
|
-
## Highlighting Carve code blocks
|
|
240
|
-
|
|
241
|
-
This plugin renders `.crv` pages. To highlight a ` ```carve ` block inside a
|
|
242
|
-
Markdown page, add [rouge-carve](https://github.com/markup-carve/rouge-carve),
|
|
243
|
-
which registers a Carve lexer with Rouge, Jekyll's default highlighter:
|
|
244
|
-
|
|
245
|
-
```ruby
|
|
246
|
-
# Gemfile
|
|
247
|
-
group :jekyll_plugins do
|
|
248
|
-
gem "rouge-carve"
|
|
249
|
-
end
|
|
250
|
-
```
|
|
251
|
-
|
|
252
|
-
Jekyll requires every gem in the `jekyll_plugins` group on its own. Without
|
|
253
|
-
that group, list it in `_config.yml` instead:
|
|
254
|
-
|
|
255
13
|
```yaml
|
|
256
|
-
plugins:
|
|
257
|
-
- jekyll-carve
|
|
258
|
-
- rouge-carve
|
|
14
|
+
plugins: [jekyll-carve]
|
|
259
15
|
```
|
|
260
16
|
|
|
261
|
-
##
|
|
262
|
-
|
|
263
|
-
This is the one nuance to understand:
|
|
264
|
-
|
|
265
|
-
- **Jekyll only runs a file through a converter if it has YAML front matter**
|
|
266
|
-
(a `---` ... `---` block at the very top). A `.crv` file with no front
|
|
267
|
-
matter is treated as a static file and copied verbatim, NOT converted.
|
|
268
|
-
- **Jekyll strips that front matter before calling the converter.** So the
|
|
269
|
-
converter (and therefore the Carve engine) receives only the document
|
|
270
|
-
**body**, never the Jekyll front matter.
|
|
271
|
-
- **Carve itself also uses `---` for its own frontmatter.** In a Jekyll site
|
|
272
|
-
the Jekyll front matter wins: the top `---` ... `---` block is consumed by
|
|
273
|
-
Jekyll, and whatever remains is handed to Carve as the body.
|
|
274
|
-
|
|
275
|
-
Practical rule: a `.crv` page in Jekyll needs at least an empty front matter
|
|
276
|
-
block so Jekyll processes it:
|
|
277
|
-
|
|
278
|
-
```text
|
|
279
|
-
---
|
|
280
|
-
---
|
|
281
|
-
# Your Carve content here
|
|
282
|
-
```
|
|
283
|
-
|
|
284
|
-
Put page metadata (`title`, `layout`, etc.) in the Jekyll front matter. Do not
|
|
285
|
-
add a second Carve `---` frontmatter block expecting Carve to parse it; Jekyll
|
|
286
|
-
has already removed the leading block by the time Carve runs.
|
|
287
|
-
|
|
288
|
-
## Converter API
|
|
289
|
-
|
|
290
|
-
`Jekyll::Carve::Converter < Jekyll::Converter`:
|
|
17
|
+
## Documentation
|
|
291
18
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
| `output_ext(ext)` | `".html"` (includes the dot so Jekyll emits `page.html`). |
|
|
296
|
-
| `convert(content)` | `Carve.to_html(content, extensions: configured, symbols: configured)` - the rendered HTML. |
|
|
297
|
-
| `carve_extensions` | The extension list read from `carve.extensions` in `_config.yml` (empty by default). |
|
|
298
|
-
| `carve_symbols` | The `:name:` map read from `carve.symbols` in `_config.yml`, or `nil` when the key is absent. Resolved once per build. |
|
|
299
|
-
| `reset_symbols` | Drops the cached map. Called from the `site, after_reset` hook this plugin registers, which is what scopes the cache to a build so `jekyll serve --watch` picks up an edit to a symbol file. |
|
|
19
|
+
- [Carve documentation](https://markup-carve.github.io/carve/)
|
|
20
|
+
- [Documentation index](docs/README.md)
|
|
21
|
+
- [Development](docs/development.md)
|
|
300
22
|
|
|
301
|
-
##
|
|
23
|
+
## License
|
|
302
24
|
|
|
303
|
-
|
|
25
|
+
[MIT](LICENSE)
|
data/lib/jekyll/carve/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: jekyll-carve
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- markup-carve
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-11-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: carve-lang
|