@docsector/docsector-reader 1.7.0 → 1.7.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 +4 -1
- package/bin/docsector.js +3 -2
- package/package.json +1 -1
- package/src/components/DPageSection.vue +20 -3
package/README.md
CHANGED
|
@@ -41,6 +41,7 @@ Transform Markdown content into beautiful, navigable documentation sites — wit
|
|
|
41
41
|
## ✨ Features
|
|
42
42
|
|
|
43
43
|
- 📝 **Markdown Rendering** — Write docs in Markdown, rendered with syntax highlighting (Prism.js)
|
|
44
|
+
- 🧱 **Raw HTML in Markdown** — Renders inline and block HTML tags inside markdown sections (including homepage remote README content)
|
|
44
45
|
- 🧩 **Mermaid Diagrams** — Native support for fenced ` ```mermaid ` blocks, with automatic dark/light theme switching
|
|
45
46
|
- 🚨 **GitHub-Style Alerts** — Native support for `[!NOTE]`, `[!TIP]`, `[!IMPORTANT]`, `[!WARNING]`, and `[!CAUTION]`
|
|
46
47
|
- 🌍 **Internationalization (i18n)** — Multi-language support with HJSON locale files and per-page translations
|
|
@@ -59,6 +60,7 @@ Transform Markdown content into beautiful, navigable documentation sites — wit
|
|
|
59
60
|
- 🧭 **Content Signals** — Injects `Content-Signal` policy in `robots.txt` with deterministic, idempotent build output
|
|
60
61
|
- 🏠 **Markdown Home at Root** — Homepage is rendered from `src/pages/Homepage.{lang}.md` directly at `/`
|
|
61
62
|
- 🌍 **Remote README as Home** — Optional build-time remote README source for homepage with automatic local fallback
|
|
63
|
+
- 🧬 **Scaffolded Homepage Override Wiring** — New consumer projects automatically wire `virtual:docsector-homepage-override` into i18n message building
|
|
62
64
|
- 🧭 **Quick Links Custom Element** — Use `<d-quick-links>` and `<d-quick-link>` in Markdown to render rich home navigation cards
|
|
63
65
|
- 🗂️ **API Catalog Well-Known** — Auto-generates `/.well-known/api-catalog` as Linkset JSON for machine-readable API discovery
|
|
64
66
|
- ⚙️ **Single Config File** — Customize branding, links, and languages via `docsector.config.js`
|
|
@@ -767,6 +769,7 @@ Consumer projects use the `buildMessages` helper from the engine:
|
|
|
767
769
|
|
|
768
770
|
```javascript
|
|
769
771
|
import { buildMessages } from '@docsector/docsector-reader/i18n'
|
|
772
|
+
import homePageOverride from 'virtual:docsector-homepage-override'
|
|
770
773
|
|
|
771
774
|
const langModules = import.meta.glob('./languages/*.hjson', { eager: true })
|
|
772
775
|
const mdModules = import.meta.glob('../pages/**/*.md', { eager: true, query: '?raw', import: 'default' })
|
|
@@ -774,7 +777,7 @@ const mdModules = import.meta.glob('../pages/**/*.md', { eager: true, query: '?r
|
|
|
774
777
|
import boot from 'pages/boot'
|
|
775
778
|
import pages from 'pages'
|
|
776
779
|
|
|
777
|
-
export default buildMessages({ langModules, mdModules, pages, boot })
|
|
780
|
+
export default buildMessages({ langModules, mdModules, pages, boot, homePageOverride })
|
|
778
781
|
```
|
|
779
782
|
|
|
780
783
|
### Language files
|
package/bin/docsector.js
CHANGED
|
@@ -23,7 +23,7 @@ const packageRoot = resolve(__dirname, '..')
|
|
|
23
23
|
const args = process.argv.slice(2)
|
|
24
24
|
const command = args[0]
|
|
25
25
|
|
|
26
|
-
const VERSION = '1.7.
|
|
26
|
+
const VERSION = '1.7.1'
|
|
27
27
|
|
|
28
28
|
const HELP = `
|
|
29
29
|
Docsector Reader v${VERSION}
|
|
@@ -264,6 +264,7 @@ const TEMPLATE_CSS_STUB = `\
|
|
|
264
264
|
const TEMPLATE_I18N_INDEX = `\
|
|
265
265
|
// @ Import i18n message builder from Docsector Reader
|
|
266
266
|
import { buildMessages } from '@docsector/docsector-reader/i18n'
|
|
267
|
+
import homePageOverride from 'virtual:docsector-homepage-override'
|
|
267
268
|
|
|
268
269
|
// @ Import language HJSON files (Vite-compatible eager import)
|
|
269
270
|
const langModules = import.meta.glob('./languages/*.hjson', { eager: true })
|
|
@@ -274,7 +275,7 @@ const mdModules = import.meta.glob('../pages/**/*.md', { eager: true, query: '?r
|
|
|
274
275
|
import boot from 'pages/boot'
|
|
275
276
|
import pages from 'pages'
|
|
276
277
|
|
|
277
|
-
export default buildMessages({ langModules, mdModules, pages, boot })
|
|
278
|
+
export default buildMessages({ langModules, mdModules, pages, boot, homePageOverride })
|
|
278
279
|
`
|
|
279
280
|
|
|
280
281
|
const TEMPLATE_I18N_HJSON = `\
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docsector/docsector-reader",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.1",
|
|
4
4
|
"description": "A documentation rendering engine built with Vue 3, Quasar v2 and Vite. Transform Markdown into beautiful, navigable documentation sites.",
|
|
5
5
|
"productName": "Docsector Reader",
|
|
6
6
|
"author": "Rodrigo de Araujo Vieira",
|
|
@@ -140,9 +140,11 @@ const tokenized = computed(() => {
|
|
|
140
140
|
allowedAttributes: ['filename']
|
|
141
141
|
})
|
|
142
142
|
|
|
143
|
-
//
|
|
144
|
-
//
|
|
145
|
-
const MarkdownInline = new MarkdownIt(
|
|
143
|
+
// Keep inline rendering aligned with block parsing so raw HTML inline
|
|
144
|
+
// fragments (e.g. <b>, <a>) are rendered instead of escaped.
|
|
145
|
+
const MarkdownInline = new MarkdownIt({
|
|
146
|
+
html: true
|
|
147
|
+
})
|
|
146
148
|
|
|
147
149
|
const markdownEnv = {}
|
|
148
150
|
|
|
@@ -326,6 +328,12 @@ const tokenized = computed(() => {
|
|
|
326
328
|
})
|
|
327
329
|
break
|
|
328
330
|
}
|
|
331
|
+
case 'html_block':
|
|
332
|
+
tokens.push({
|
|
333
|
+
tag: 'html',
|
|
334
|
+
content: element.content
|
|
335
|
+
})
|
|
336
|
+
break
|
|
329
337
|
}
|
|
330
338
|
} else if (level === 1) {
|
|
331
339
|
const parent = tokens[tokens.length - 1]
|
|
@@ -373,6 +381,10 @@ const tokenized = computed(() => {
|
|
|
373
381
|
case 'inline':
|
|
374
382
|
parent.content += element.content
|
|
375
383
|
break
|
|
384
|
+
case 'html_inline':
|
|
385
|
+
case 'html_block':
|
|
386
|
+
parent.content += element.content
|
|
387
|
+
break
|
|
376
388
|
|
|
377
389
|
case 'list_item_close':
|
|
378
390
|
parent.content += '</li>'
|
|
@@ -453,6 +465,11 @@ const tokenized = computed(() => {
|
|
|
453
465
|
<table v-html="token.content"></table>
|
|
454
466
|
</div>
|
|
455
467
|
|
|
468
|
+
<div
|
|
469
|
+
v-else-if="token.tag === 'html'"
|
|
470
|
+
v-html="token.content"
|
|
471
|
+
></div>
|
|
472
|
+
|
|
456
473
|
<p
|
|
457
474
|
v-else-if="token.tag === 'p'"
|
|
458
475
|
v-html="token.content"
|