@ox-content/napi 3.0.0-alpha.4 → 3.0.0-alpha.6

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.
Files changed (3) hide show
  1. package/index.d.ts +90 -7
  2. package/index.js +1 -0
  3. package/package.json +8 -8
package/index.d.ts CHANGED
@@ -196,7 +196,7 @@ export declare function generateSsgBareHtml(content: string, title: string): str
196
196
  export declare function generateSsgBarePage(page: JsSsgBarePage): string
197
197
 
198
198
  /** Generates SSG HTML page with navigation and search. */
199
- export declare function generateSsgHtml(pageData: JsSsgPageData, navGroups: Array<JsSsgNavGroup>, config: JsSsgConfig): string
199
+ export declare function generateSsgHtml(pageData: JsSsgPageData, navGroups: Array<JsSsgNavGroup>, config: JsSsgConfig): JsSsgHtmlResult
200
200
 
201
201
  /** Returns unique git authors for a file. Empty when git is missing or fails. */
202
202
  export declare function getGitContributors(filePath: string, root?: string | undefined | null): Array<JsGitContributor>
@@ -922,6 +922,12 @@ export interface JsGraphOptions {
922
922
  externalPackageSources?: Array<JsExternalPackageSource>
923
923
  }
924
924
 
925
+ /** One page-head validation finding. */
926
+ export interface JsHeadDiagnostic {
927
+ strict: boolean
928
+ message: string
929
+ }
930
+
925
931
  /** Header nav link or dropdown. */
926
932
  export interface JsHeaderNavItem {
927
933
  /** Display label. */
@@ -1080,6 +1086,8 @@ export interface JsJsonLd {
1080
1086
  publisher?: JsJsonLdPublisher
1081
1087
  /** Site origin used for `@id` / `url`. */
1082
1088
  siteUrl?: string
1089
+ pageType?: string
1090
+ graph?: Array<string>
1083
1091
  }
1084
1092
 
1085
1093
  /** Optional JSON-LD publisher. Only configured fields are emitted. */
@@ -1110,6 +1118,52 @@ export interface JsLocalePath {
1110
1118
  root?: string
1111
1119
  }
1112
1120
 
1121
+ /** One configured magic-link alias. */
1122
+ export interface JsMagicLinkAlias {
1123
+ /** Absolute `http:` / `https:` URL. */
1124
+ href: string
1125
+ /** Optional display label. Defaults to the alias key. */
1126
+ label?: string
1127
+ /** Optional avatar or favicon URL. */
1128
+ image?: string
1129
+ }
1130
+
1131
+ /** Replace the resolved image for matching hrefs. */
1132
+ export interface JsMagicLinkImageOverride {
1133
+ /** Exact href to replace. */
1134
+ href?: string
1135
+ /** Href prefix to replace. */
1136
+ prefix?: string
1137
+ /** Replacement image URL. Must be `http:` or `https:`. */
1138
+ image: string
1139
+ }
1140
+
1141
+ /** Opt-in `{link:...}` rich magic links. */
1142
+ export interface JsMagicLinkOptions {
1143
+ /**
1144
+ * Enable `{link:@user}`, `{link:alias}`, and `{link:label|url}`.
1145
+ *
1146
+ * Default: `false`.
1147
+ */
1148
+ enabled?: boolean
1149
+ /** Named aliases mapped to href / label / image. */
1150
+ aliases?: Record<string, JsMagicLinkAlias>
1151
+ /**
1152
+ * Emit a favicon URL for explicit links that have no image.
1153
+ *
1154
+ * Default: `false`. No transform-time network request.
1155
+ */
1156
+ favicon?: boolean
1157
+ /**
1158
+ * Favicon URL template with a `{host}` placeholder.
1159
+ *
1160
+ * Default: `https://{host}/favicon.ico` when `favicon` is true.
1161
+ */
1162
+ faviconTemplate?: string
1163
+ /** Image replacements applied after alias / GitHub / favicon resolution. */
1164
+ imageOverrides?: Array<JsMagicLinkImageOverride>
1165
+ }
1166
+
1113
1167
  export interface JsMarkdownLintDiagnostic {
1114
1168
  ruleId: string
1115
1169
  severity: string
@@ -1600,14 +1654,12 @@ export interface JsSsgBarePage {
1600
1654
 
1601
1655
  /** SSG configuration. */
1602
1656
  export interface JsSsgConfig {
1603
- /** Site name. */
1604
1657
  siteName: string
1605
- /** Base URL path. */
1606
1658
  base: string
1607
- /** Optional site-root href for breadcrumbs. */
1608
1659
  breadcrumbRootHref?: string
1609
- /** OG image URL. */
1610
1660
  ogImage?: string
1661
+ siteUrl?: string
1662
+ headValidation?: string
1611
1663
  /** Theme configuration. */
1612
1664
  theme?: JsThemeConfig
1613
1665
  /** Current locale for this page. */
@@ -1660,6 +1712,12 @@ export interface JsSsgGeneratedHtmlPage {
1660
1712
  html: string
1661
1713
  }
1662
1714
 
1715
+ /** Themed SSG HTML plus page-head diagnostics. */
1716
+ export interface JsSsgHtmlResult {
1717
+ html: string
1718
+ diagnostics: Array<JsHeadDiagnostic>
1719
+ }
1720
+
1663
1721
  /** Navigation group for SSG. */
1664
1722
  export interface JsSsgNavGroup {
1665
1723
  /** Group title. */
@@ -1724,6 +1782,10 @@ export interface JsSsgPageData {
1724
1782
  layout?: string
1725
1783
  /** Per-page chrome flags. Honored only when page chrome is enabled. */
1726
1784
  chrome?: JsPageChromeFlags
1785
+ /** Frontmatter `robots`. */
1786
+ robots?: string
1787
+ /** Frontmatter `canonical`. */
1788
+ canonical?: string
1727
1789
  }
1728
1790
 
1729
1791
  /** Resolved SSG output and public route paths. */
@@ -1850,15 +1912,15 @@ export interface JsThemeConfig {
1850
1912
  aside?: boolean
1851
1913
  /** Breadcrumb trail from the site root through sidebar ancestors. */
1852
1914
  breadcrumbs?: boolean
1915
+ /** Heading permalink visibility. `"hover"` or `"always"`. CSS only. */
1916
+ headingPermalink?: string
1853
1917
  /** Light mode colors. */
1854
1918
  colors?: JsThemeColors
1855
1919
  /** Dark mode colors. */
1856
1920
  darkColors?: JsThemeColors
1857
- /** Font configuration. */
1858
1921
  fonts?: JsThemeFonts
1859
1922
  /** Entry page configuration. */
1860
1923
  entryPage?: JsThemeEntryPage
1861
- /** Layout configuration. */
1862
1924
  layout?: JsThemeLayout
1863
1925
  /** Header configuration. */
1864
1926
  header?: JsThemeHeader
@@ -1973,6 +2035,12 @@ export interface JsTransformOptions {
1973
2035
  * Default: `false`, or `true` when `gfm` is `true`.
1974
2036
  */
1975
2037
  footnotes?: boolean
2038
+ /**
2039
+ * Render footnotes as a semantic ordered section with numeric markers.
2040
+ *
2041
+ * Default: `false`.
2042
+ */
2043
+ semanticFootnotes?: boolean
1976
2044
  /**
1977
2045
  * Enable GFM task-list item markers.
1978
2046
  *
@@ -2072,6 +2140,12 @@ export interface JsTransformOptions {
2072
2140
  * Default: `true`; ignored when [`Self::autolink_urls`] is off.
2073
2141
  */
2074
2142
  autolinkTargetBlank?: boolean
2143
+ /**
2144
+ * Opt-in visible heading permalinks (`<a class="header-anchor" href="#id">`).
2145
+ *
2146
+ * Default: disabled. Existing HTML stays unchanged until this is enabled.
2147
+ */
2148
+ headingPermalinks?: boolean
2075
2149
  /**
2076
2150
  * Opt-in Obsidian-style wiki links.
2077
2151
  *
@@ -2152,6 +2226,12 @@ export interface JsTransformOptions {
2152
2226
  * Default: disabled.
2153
2227
  */
2154
2228
  badges?: JsBadgeOptions
2229
+ /**
2230
+ * Opt-in `{link:...}` rich magic links.
2231
+ *
2232
+ * Default: disabled.
2233
+ */
2234
+ magicLinks?: JsMagicLinkOptions
2155
2235
  /**
2156
2236
  * Opt-in figures, captions, and lazy images.
2157
2237
  *
@@ -2371,6 +2451,9 @@ export declare function render(astJson: string): RenderResult
2371
2451
  */
2372
2452
  export declare function renderFrameworkComponentCode(html: string, target: string, islands?: Array<JsFrameworkComponentIsland> | undefined | null, mode?: string | undefined | null): string
2373
2453
 
2454
+ /** Resolve Unhead-compatible page-head descriptors to HTML. */
2455
+ export declare function renderHead(inputJson: string): JsSsgHtmlResult
2456
+
2374
2457
  /** Render result containing the HTML output. */
2375
2458
  export interface RenderResult {
2376
2459
  /** The rendered HTML. */
package/index.js CHANGED
@@ -209,6 +209,7 @@ module.exports.generateSearchModuleFromOptions = binding.generateSearchModuleFro
209
209
  module.exports.collectSearchMarkdownFiles = binding.collectSearchMarkdownFiles;
210
210
  module.exports.normalizeVitePressFrontmatter = binding.normalizeVitePressFrontmatter;
211
211
  module.exports.generateSsgHtml = binding.generateSsgHtml;
212
+ module.exports.renderHead = binding.renderHead;
212
213
  module.exports.generateSsgBareHtml = binding.generateSsgBareHtml;
213
214
  module.exports.highlightCodeBlock = binding.highlightCodeBlock;
214
215
  module.exports.applyPendingHighlights = binding.applyPendingHighlights;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ox-content/napi",
3
- "version": "3.0.0-alpha.4",
3
+ "version": "3.0.0-alpha.6",
4
4
  "description": "Node.js bindings for Ox Content - High-performance Markdown parser",
5
5
  "keywords": [
6
6
  "markdown",
@@ -47,12 +47,12 @@
47
47
  ]
48
48
  },
49
49
  "optionalDependencies": {
50
- "@ox-content/binding-darwin-x64": "3.0.0-alpha.4",
51
- "@ox-content/binding-darwin-arm64": "3.0.0-alpha.4",
52
- "@ox-content/binding-linux-x64-gnu": "3.0.0-alpha.4",
53
- "@ox-content/binding-linux-x64-musl": "3.0.0-alpha.4",
54
- "@ox-content/binding-linux-arm64-gnu": "3.0.0-alpha.4",
55
- "@ox-content/binding-linux-arm64-musl": "3.0.0-alpha.4",
56
- "@ox-content/binding-win32-x64-msvc": "3.0.0-alpha.4"
50
+ "@ox-content/binding-darwin-x64": "3.0.0-alpha.6",
51
+ "@ox-content/binding-darwin-arm64": "3.0.0-alpha.6",
52
+ "@ox-content/binding-linux-x64-gnu": "3.0.0-alpha.6",
53
+ "@ox-content/binding-linux-x64-musl": "3.0.0-alpha.6",
54
+ "@ox-content/binding-linux-arm64-gnu": "3.0.0-alpha.6",
55
+ "@ox-content/binding-linux-arm64-musl": "3.0.0-alpha.6",
56
+ "@ox-content/binding-win32-x64-msvc": "3.0.0-alpha.6"
57
57
  }
58
58
  }