rouge-carve 0.1.0 → 0.1.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +2 -19
- data/lib/rouge/lexers/carve.rb +41 -0
- data/lib/rouge-carve.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: c4006805a5023dc8b016745f1ab3dc73bf29fa24de27acc46c19696658a9ee36
|
|
4
|
+
data.tar.gz: 85965e83d476add300683d7e5ce7464d6affb784b067b3797318ef45575d5c78
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: eb1fb40ca27583ebb19f1af32bf208efcdd5d21c2f880f5e400f4c06562d4a79a977988008ec054d448d1e7ac9c0020acdce83db8b2cd19d0bcb6912878896dd
|
|
7
|
+
data.tar.gz: 7bf48fae5c12930737941c834ec4347dcd5f1a30a77e4cbcbdf99e8fa20c4d90c39d9f45bfaa9d1be3a2edea3d1025ef1f31f5ffa3ecbfade9212e0a4a4811ff
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.1.1] - 2026-09-21
|
|
4
|
+
|
|
5
|
+
- The reserved include directive `{{ path #section @key:value }}` (PART 9
|
|
6
|
+
section 19, markup-carve/carve#291) is lexed BY PART: the path as
|
|
7
|
+
`Name.Namespace`, the selector as `Name.Label`, and each option as
|
|
8
|
+
`Name.Attribute` plus its value. It used to shred into the constructs its own
|
|
9
|
+
selector is spelled with, so `#intro` in a path was colored as a hashtag.
|
|
10
|
+
|
|
3
11
|
## [0.1.0] - 2026-08-27
|
|
4
12
|
|
|
5
13
|
First release.
|
data/README.md
CHANGED
|
@@ -66,23 +66,6 @@ shared with the Prism, highlight.js and Pygments grammars, so the four agree:
|
|
|
66
66
|
it over-colours an indented-at-document-level opener rather than
|
|
67
67
|
under-colouring the far more common indented construct inside a list item.
|
|
68
68
|
|
|
69
|
-
## Testing
|
|
70
|
-
|
|
71
|
-
```bash
|
|
72
|
-
bundle install
|
|
73
|
-
bundle exec rspec
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
Two gates, and the second is the one that finds things:
|
|
77
|
-
|
|
78
|
-
- `spec/carve_spec.rb` pins the constructs, including each inverted delimiter.
|
|
79
|
-
- `script/corpus_check.rb` lexes every `.crv` document in the Carve spec
|
|
80
|
-
repository and fails on a single `Error` token. A lexer emitting `Error` is
|
|
81
|
-
telling the reader its own rules ran out. Both bugs found during development -
|
|
82
|
-
a blank line inside a comment fence, and a `---` thematic break opening
|
|
83
|
-
frontmatter that never closed - came from this and not from an example
|
|
84
|
-
anybody thought to write.
|
|
85
|
-
|
|
86
69
|
## Related
|
|
87
70
|
|
|
88
71
|
- [carve](https://github.com/markup-carve/carve) - the language and its spec
|
|
@@ -93,6 +76,6 @@ Two gates, and the second is the one that finds things:
|
|
|
93
76
|
- [carve-css](https://github.com/markup-carve/carve-css) - styles for the HTML
|
|
94
77
|
Carve renders
|
|
95
78
|
|
|
96
|
-
##
|
|
79
|
+
## Development
|
|
97
80
|
|
|
98
|
-
|
|
81
|
+
Contributor setup, testing, and maintenance notes are in the [development guide](docs/development.md).
|
data/lib/rouge/lexers/carve.rb
CHANGED
|
@@ -359,6 +359,26 @@ module Rouge
|
|
|
359
359
|
groups Punctuation, Str::Backtick, Punctuation
|
|
360
360
|
end
|
|
361
361
|
|
|
362
|
+
# The reserved include directive `{{ path #section @key:value }}`
|
|
363
|
+
# (PART 9 section 19, grammar.ebnf `include_directive`). The core
|
|
364
|
+
# leaves it literal; a processor expands it only when a host supplies a
|
|
365
|
+
# resolver.
|
|
366
|
+
#
|
|
367
|
+
# One directive rule, because its own selector is spelled with constructs this
|
|
368
|
+
# lexer already knows: `#section` is the tag rule below and an option
|
|
369
|
+
# slot is the mention rule, so without this `#intro` came out coloured
|
|
370
|
+
# as a hashtag inside a path. After the verbatim family, so a directive
|
|
371
|
+
# in a code span stays literal; before every other brace rule, none of
|
|
372
|
+
# which can spell `{{`.
|
|
373
|
+
# THE CLOSER IS IN THE LOOKAHEAD, so an unterminated `{{` never opens
|
|
374
|
+
# the state at all and stays the ordinary text the processor treats it
|
|
375
|
+
# as. Without it the opener scoped and only the newline rule below
|
|
376
|
+
# stopped the damage.
|
|
377
|
+
rule %r/(\{\{)(?=[ \t]+[^\n]*?[ \t]+\}\})([ \t]+)((?:"(?:\\.|[^"\\])*"|[^#@}\s"][^#@}\s]*))/ do
|
|
378
|
+
groups Punctuation, Text, Name::Namespace
|
|
379
|
+
push :includeparts
|
|
380
|
+
end
|
|
381
|
+
|
|
362
382
|
# CriticMarkup substitution and comment, before the forced family:
|
|
363
383
|
# `{~old~>new~}` also matches the forced-strike shape.
|
|
364
384
|
rule %r/(\{~)([^\n]*?)(~>)([^\n]*?)(~\})/ do
|
|
@@ -496,6 +516,27 @@ module Rouge
|
|
|
496
516
|
rule %r/\.\.\./, Punctuation
|
|
497
517
|
end
|
|
498
518
|
|
|
519
|
+
# The tail of an include directive: its selector, option slots, and
|
|
520
|
+
# anything else written there. Scoped BY PART - the opener rule is what
|
|
521
|
+
# keeps the tag and mention rules out, so painting one token buys nothing,
|
|
522
|
+
# and a reader wants the path to look like a path.
|
|
523
|
+
#
|
|
524
|
+
# A part that is neither a section nor an option stays plain text rather
|
|
525
|
+
# than being refused, matching the processor, which leaves a malformed
|
|
526
|
+
# directive alone. A newline pops: the directive requires its closer on
|
|
527
|
+
# the same line, so anything else is not one.
|
|
528
|
+
state :includeparts do
|
|
529
|
+
rule %r/[ \t]+/, Text
|
|
530
|
+
rule %r/\}\}/, Punctuation, :pop!
|
|
531
|
+
rule %r/#[A-Za-z_][\w-]*/, Name::Label
|
|
532
|
+
rule %r/(@[A-Za-z_][\w-]*)(:)([^\s}]+)/ do
|
|
533
|
+
groups Name::Attribute, Punctuation, Literal
|
|
534
|
+
end
|
|
535
|
+
rule %r/[^\s}]+/, Text
|
|
536
|
+
rule %r/\}/, Text
|
|
537
|
+
rule %r/\n/, Text, :pop!
|
|
538
|
+
end
|
|
539
|
+
|
|
499
540
|
state :inlinefootnote do
|
|
500
541
|
rule %r/\]/, Punctuation, :pop!
|
|
501
542
|
mixin :inlinecontent
|
data/lib/rouge-carve.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rouge-carve
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mark Scherer
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-09-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rouge
|