@dr-ishaan/remake-blocks 1.5.0 → 1.5.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/README.md +66 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @dr-ishaan/remake-blocks
|
|
2
2
|
|
|
3
|
-
Astro 6 + remark plugin for rendering GitHub-style callouts (admonitions), enhanced blockquotes,
|
|
3
|
+
Astro 6 + remark plugin for rendering GitHub-style callouts (admonitions), enhanced blockquotes, disclosure widgets, pull quotes, and epigraphs in Markdown content — **27 first-class types + 4 themes + inline callouts + directive syntax + safe-by-default HTML escaping + Lucide/emoji icon sets**.
|
|
4
4
|
|
|
5
5
|
Each directive maps 1:1 to its own unique visual identity, SVG icon, color palette, and CSS class. No alias resolution.
|
|
6
6
|
|
|
@@ -16,6 +16,9 @@ Each directive maps 1:1 to its own unique visual identity, SVG icon, color palet
|
|
|
16
16
|
- **Custom titles** — `> [!WARNING] Deprecated API`
|
|
17
17
|
- **Collapsible callouts** — `> [!FAQ]-` (collapsed) and `> [!TIP]+` (expanded)
|
|
18
18
|
- **Disclosure widgets** — `> [!] Title` creates a plain collapsible block
|
|
19
|
+
- **Pull quotes** — `> [!PULL]` creates a large, centered, italic display quote with auto-detected `<cite>` attribution
|
|
20
|
+
- **Epigraphs** — `> [!EPIGRAPH]` creates a small, centered, bold italic quote with `<cite>` attribution
|
|
21
|
+
- **Attribution auto-detection** — `— Author` or `-- Author` at end of body is auto-detected and rendered as `<cite>`
|
|
19
22
|
- **Accordion grouping** — consecutive `[!]` blocks auto-group into an accordion
|
|
20
23
|
- **Tree view** — nested `[!]` blocks get depth indicators
|
|
21
24
|
- **Custom callout types** — define your own with icon, color, and CSS class
|
|
@@ -165,6 +168,15 @@ Each of these is its **own distinct type** with unique colors, not an alias:
|
|
|
165
168
|
|
|
166
169
|
Consecutive `[!]` blocks are automatically grouped into an accordion. Nested `[!]` blocks get tree-view styling.
|
|
167
170
|
|
|
171
|
+
### Pull Quotes & Epigraphs
|
|
172
|
+
|
|
173
|
+
| Directive | Description | CSS Class |
|
|
174
|
+
|-----------|-------------|-----------|
|
|
175
|
+
| `[!PULL]` | Large, centered, italic display quote. Auto-detects `— Author` → `<cite>`. Supports `{inline}` for floating. | `.pull-quote` |
|
|
176
|
+
| `[!EPIGRAPH]` | Small, centered, bold italic quote. Auto-detects `— Author` → `<cite>`. Max-width 70%. | `.epigraph` |
|
|
177
|
+
|
|
178
|
+
**Attribution auto-detection**: If the last line of the body starts with `—` (em dash) or `--` (double hyphen), it's automatically extracted and rendered as a `<cite>` element. If no attribution is found, the entire body is the quote text.
|
|
179
|
+
|
|
168
180
|
---
|
|
169
181
|
|
|
170
182
|
## Syntax
|
|
@@ -252,6 +264,32 @@ Use `{key=value}` syntax after the directive:
|
|
|
252
264
|
> Content visible by default.
|
|
253
265
|
```
|
|
254
266
|
|
|
267
|
+
### Pull quotes
|
|
268
|
+
|
|
269
|
+
```markdown
|
|
270
|
+
> [!PULL]
|
|
271
|
+
> The best way to predict the future is to invent it.
|
|
272
|
+
> — Alan Kay
|
|
273
|
+
|
|
274
|
+
> [!PULL]{inline}
|
|
275
|
+
> A floated pull quote with text wrapping around it.
|
|
276
|
+
> — Someone
|
|
277
|
+
|
|
278
|
+
> [!PULL]
|
|
279
|
+
> A pull quote with no attribution.
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
### Epigraphs
|
|
283
|
+
|
|
284
|
+
```markdown
|
|
285
|
+
> [!EPIGRAPH]
|
|
286
|
+
> The fog comes on little cat feet.
|
|
287
|
+
> — Carl Sandburg
|
|
288
|
+
|
|
289
|
+
> [!EPIGRAPH]
|
|
290
|
+
> An epigraph with no attribution.
|
|
291
|
+
```
|
|
292
|
+
|
|
255
293
|
---
|
|
256
294
|
|
|
257
295
|
## Configuration
|
|
@@ -534,6 +572,24 @@ Collapsible callouts use `<details>`/`<summary>`:
|
|
|
534
572
|
</details>
|
|
535
573
|
```
|
|
536
574
|
|
|
575
|
+
Pull quotes render as:
|
|
576
|
+
|
|
577
|
+
```html
|
|
578
|
+
<aside class="pull-quote" dir="auto">
|
|
579
|
+
<p class="pull-quote-text">The best way to predict the future is to invent it.</p>
|
|
580
|
+
<p class="pull-quote-attribution">— <cite>Alan Kay</cite></p>
|
|
581
|
+
</aside>
|
|
582
|
+
```
|
|
583
|
+
|
|
584
|
+
Epigraphs render as:
|
|
585
|
+
|
|
586
|
+
```html
|
|
587
|
+
<aside class="epigraph" dir="auto">
|
|
588
|
+
<p class="epigraph-text">The fog comes on little cat feet.</p>
|
|
589
|
+
<p class="epigraph-attribution">— <cite>Carl Sandburg</cite></p>
|
|
590
|
+
</aside>
|
|
591
|
+
```
|
|
592
|
+
|
|
537
593
|
---
|
|
538
594
|
|
|
539
595
|
## Exported Helpers
|
|
@@ -616,9 +672,13 @@ The plugin processes markdown through 4 passes. Each syntax is detected at a dif
|
|
|
616
672
|
| `[3]` | Custom title text | `Breaking Change` | Override default title |
|
|
617
673
|
| `[4]` | Overrides block | `{icon=false appearance=minimal}` | Parsed by `parseOverrides()` + `parseDirectiveAttrs()` |
|
|
618
674
|
|
|
619
|
-
### Disclosure
|
|
675
|
+
### Disclosure, Pull Quote & Epigraph detection
|
|
676
|
+
|
|
677
|
+
The `[!]`, `[!PULL]`, and `[!EPIGRAPH]` syntaxes are all detected in the **same blockquote pass** as regular callouts. The key difference is what's added to the regex alternatives:
|
|
620
678
|
|
|
621
|
-
|
|
679
|
+
- `[!]` → empty string `""` added to regex (when `enableDisclosures: true`)
|
|
680
|
+
- `[!PULL]` → `"PULL"` always added to regex
|
|
681
|
+
- `[!EPIGRAPH]` → `"EPIGRAPH"` always added to regex
|
|
622
682
|
|
|
623
683
|
| Aspect | Regular callout (`> [!NOTE]`) | Disclosure (`> [!]`) |
|
|
624
684
|
|--------|------------------------------|---------------------|
|
|
@@ -672,11 +732,13 @@ All 3 syntaxes produce the same `ParsedCallout` object, which is passed to `buil
|
|
|
672
732
|
|
|
673
733
|
| Field | Type | Source | Description |
|
|
674
734
|
|-------|------|--------|-------------|
|
|
675
|
-
| `type` | `string` | Regex group [1] | Callout type (lowercased) or `"
|
|
735
|
+
| `type` | `string` | Regex group [1] | Callout type (lowercased), `"disclosure"`, `"pull"`, or `"epigraph"` |
|
|
676
736
|
| `customTitle` | `string \| undefined` | Regex group [3] or `[Title]` or `"Title"` | User-provided title (overrides default) |
|
|
677
737
|
| `collapsible` | `boolean` | Fold marker or `???`/`???+` | Whether callout is collapsible |
|
|
678
738
|
| `collapsibleOpen` | `boolean` | `+` marker or `???+` or no marker (disclosures) | Whether collapsible starts expanded |
|
|
679
739
|
| `isDisclosure` | `boolean` | Empty type match | True for `[!]` syntax |
|
|
740
|
+
| `isPullQuote` | `boolean` | Type = `"pull"` | True for `[!PULL]` syntax |
|
|
741
|
+
| `isEpigraph` | `boolean` | Type = `"epigraph"` | True for `[!EPIGRAPH]` syntax |
|
|
680
742
|
| `overrides` | `object \| undefined` | `{overrides}` block via `parseOverrides()` | Per-callout icon/appearance/inline overrides |
|
|
681
743
|
| `directiveAttrs` | `object \| undefined` | `{attrs}` block via `parseDirectiveAttrs()` | Per-callout id/class/HTML attributes |
|
|
682
744
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dr-ishaan/remake-blocks",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"description": "Astro 6 + remark plugin — 27 callout types, 4 themes, disclosure widgets, inline callouts, directive syntax, MkDocs syntax, i18n labels, safe-by-default XSS escaping, WCAG accessibility, Lucide/emoji icons",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|