@netfoundry/docusaurus-theme 0.2.0 → 0.2.3
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/dist/src/components/Alert/Alert.js +51 -6
- package/dist/src/components/Alert/Alert.js.map +7 -1
- package/dist/src/components/Alert/index.js +29 -2
- package/dist/src/components/Alert/index.js.map +7 -1
- package/dist/src/components/CodeBlock/CodeBlock.js +53 -7
- package/dist/src/components/CodeBlock/CodeBlock.js.map +7 -1
- package/dist/src/components/CodeBlock/index.js +29 -2
- package/dist/src/components/CodeBlock/index.js.map +7 -1
- package/dist/src/components/Common/Common.js +59 -16
- package/dist/src/components/Common/Common.js.map +7 -1
- package/dist/src/components/Common/Logos.d.ts +6 -0
- package/dist/src/components/Common/Logos.d.ts.map +1 -0
- package/dist/src/components/Common/Logos.js +93 -0
- package/dist/src/components/Common/Logos.js.map +7 -0
- package/dist/src/components/Common/index.d.ts +1 -0
- package/dist/src/components/Common/index.d.ts.map +1 -1
- package/dist/src/components/Common/index.js +25 -2
- package/dist/src/components/Common/index.js.map +7 -1
- package/dist/src/components/NetFoundry/Divider/Divider.js +46 -5
- package/dist/src/components/NetFoundry/Divider/Divider.js.map +7 -1
- package/dist/src/components/NetFoundry/Divider/index.js +23 -2
- package/dist/src/components/NetFoundry/Divider/index.js.map +7 -1
- package/dist/src/components/NetFoundry/index.js +23 -2
- package/dist/src/components/NetFoundry/index.js.map +7 -1
- package/dist/src/components/NetFoundryFooter/NetFoundryFooter.d.ts +2 -21
- package/dist/src/components/NetFoundryFooter/NetFoundryFooter.d.ts.map +1 -1
- package/dist/src/components/NetFoundryFooter/NetFoundryFooter.js +115 -58
- package/dist/src/components/NetFoundryFooter/NetFoundryFooter.js.map +7 -1
- package/dist/src/components/NetFoundryFooter/defaults.js +50 -23
- package/dist/src/components/NetFoundryFooter/defaults.js.map +7 -1
- package/dist/src/components/NetFoundryFooter/index.js +23 -2
- package/dist/src/components/NetFoundryFooter/index.js.map +7 -1
- package/dist/src/components/NetFoundryFooter/types.d.ts +27 -0
- package/dist/src/components/NetFoundryFooter/types.d.ts.map +1 -0
- package/dist/src/components/NetFoundryFooter/types.js +53 -0
- package/dist/src/components/NetFoundryFooter/types.js.map +7 -0
- package/dist/src/components/NetFoundryHighlight/NetFoundryHighlight.js +32 -5
- package/dist/src/components/NetFoundryHighlight/NetFoundryHighlight.js.map +7 -1
- package/dist/src/components/NetFoundryHighlight/index.js +29 -2
- package/dist/src/components/NetFoundryHighlight/index.js.map +7 -1
- package/dist/src/components/NetFoundryHorizontalSection/NetFoundryHorizontalSection.js +52 -7
- package/dist/src/components/NetFoundryHorizontalSection/NetFoundryHorizontalSection.js.map +7 -1
- package/dist/src/components/NetFoundryHorizontalSection/index.js +29 -2
- package/dist/src/components/NetFoundryHorizontalSection/index.js.map +7 -1
- package/dist/src/components/NetFoundryLayout/NetFoundryLayout.js +111 -34
- package/dist/src/components/NetFoundryLayout/NetFoundryLayout.js.map +7 -1
- package/dist/src/components/NetFoundryLayout/index.js +23 -2
- package/dist/src/components/NetFoundryLayout/index.js.map +7 -1
- package/dist/src/components/NetFoundryNavbarItems/NetFoundryNavbarItems.js +40 -13
- package/dist/src/components/NetFoundryNavbarItems/NetFoundryNavbarItems.js.map +7 -1
- package/dist/src/components/NetFoundryNavbarItems/index.js +29 -2
- package/dist/src/components/NetFoundryNavbarItems/index.js.map +7 -1
- package/dist/src/components/OsTabs/OsTabs.js +53 -17
- package/dist/src/components/OsTabs/OsTabs.js.map +7 -1
- package/dist/src/components/OsTabs/index.js +29 -2
- package/dist/src/components/OsTabs/index.js.map +7 -1
- package/dist/src/components/ProductSearch/ProductSearch.js +243 -122
- package/dist/src/components/ProductSearch/ProductSearch.js.map +7 -1
- package/dist/src/components/ProductSearch/index.js +42 -4
- package/dist/src/components/ProductSearch/index.js.map +7 -1
- package/dist/src/components/StarUs/StarUs.js +45 -6
- package/dist/src/components/StarUs/StarUs.js.map +7 -1
- package/dist/src/components/StarUs/index.js +39 -2
- package/dist/src/components/StarUs/index.js.map +7 -1
- package/dist/src/components/index.js +45 -13
- package/dist/src/components/index.js.map +7 -1
- package/dist/src/config.d.ts +9 -0
- package/dist/src/config.d.ts.map +1 -0
- package/dist/src/config.js +34 -0
- package/dist/src/config.js.map +7 -0
- package/dist/src/css-modules.d.js +2 -0
- package/dist/src/css-modules.d.js.map +7 -0
- package/dist/src/docusaurus-envhelper.js +111 -64
- package/dist/src/docusaurus-envhelper.js.map +7 -1
- package/dist/src/docusaurus-plugins/index.js +35 -8
- package/dist/src/docusaurus-plugins/index.js.map +7 -1
- package/dist/src/docusaurus-plugins/logger.js +66 -38
- package/dist/src/docusaurus-plugins/logger.js.map +7 -1
- package/dist/src/docusaurus-plugins/remarkCodeSections.js +127 -94
- package/dist/src/docusaurus-plugins/remarkCodeSections.js.map +7 -1
- package/dist/src/docusaurus-plugins/remarkReplaceMetaUrl.js +50 -22
- package/dist/src/docusaurus-plugins/remarkReplaceMetaUrl.js.map +7 -1
- package/dist/src/docusaurus-plugins/remarkScopedPath.js +78 -46
- package/dist/src/docusaurus-plugins/remarkScopedPath.js.map +7 -1
- package/dist/src/docusaurus-plugins/remarkYamlTable.js +84 -49
- package/dist/src/docusaurus-plugins/remarkYamlTable.js.map +7 -1
- package/dist/src/docusaurus-plugins/remarkYouTube.js +65 -42
- package/dist/src/docusaurus-plugins/remarkYouTube.js.map +7 -1
- package/dist/src/docusaurus-plugins/timedPlugin.js +42 -15
- package/dist/src/docusaurus-plugins/timedPlugin.js.map +7 -1
- package/dist/src/docusaurus.d.js +2 -0
- package/dist/src/docusaurus.d.js.map +7 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +63 -31
- package/dist/src/index.js.map +7 -1
- package/dist/src/node.js +23 -7
- package/dist/src/node.js.map +7 -1
- package/dist/src/options.d.ts +7 -0
- package/dist/src/options.d.ts.map +1 -1
- package/dist/src/options.js +17 -2
- package/dist/src/options.js.map +7 -1
- package/dist/src/plugins.js +23 -7
- package/dist/src/plugins.js.map +7 -1
- package/dist/src/ui.js +25 -8
- package/dist/src/ui.js.map +7 -1
- package/dist/src/version.js +29 -2
- package/dist/src/version.js.map +7 -1
- package/dist/theme/BlogPostPage/Metadata.js +35 -2
- package/dist/theme/BlogPostPage/Metadata.js.map +7 -1
- package/dist/theme/BlogPostPage/StructuredData.js +35 -2
- package/dist/theme/BlogPostPage/StructuredData.js.map +7 -1
- package/dist/theme/BlogPostPage/index.js +98 -24
- package/dist/theme/BlogPostPage/index.js.map +7 -1
- package/dist/theme/DocSearch/index.js +95 -27
- package/dist/theme/DocSearch/index.js.map +7 -1
- package/dist/theme/Layout/index.js +81 -35
- package/dist/theme/Layout/index.js.map +7 -1
- package/dist/theme/Navbar/Content/index.js +69 -26
- package/dist/theme/Navbar/Content/index.js.map +7 -1
- package/dist/theme/Navbar/Logo/index.d.ts.map +1 -1
- package/dist/theme/Navbar/Logo/index.js +87 -42
- package/dist/theme/Navbar/Logo/index.js.map +7 -1
- package/dist/theme/OsTabs/index.js +50 -19
- package/dist/theme/OsTabs/index.js.map +7 -1
- package/dist/theme/SearchBar/index.js +89 -34
- package/dist/theme/SearchBar/index.js.map +7 -1
- package/package.json +11 -25
- package/css/layout.css +0 -14
- package/css/legacy.css +0 -2313
- package/css/tabs-v1-gradient.css +0 -92
- package/css/tabs-v2-glass.css +0 -116
- package/css/tabs-v3-minimal.css +0 -86
- package/css/tabs-v4-segmented.css +0 -85
- package/css/tabs-v5-neon.css +0 -99
- package/css/tabs-v6-neumorphic.css +0 -89
- package/css/tabs-v7-brutalist.css +0 -81
- package/css/tabs-v8-float.css +0 -114
- package/css/tabs-v9-line.css +0 -104
- package/css/theme.css +0 -72
- package/css/vars-dark.css +0 -7
- package/css/vars.css +0 -8
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/docusaurus-plugins/remarkScopedPath.ts"],
|
|
4
|
+
"sourcesContent": ["import { Plugin } from 'unified'\r\nimport { visit } from 'unist-util-visit'\r\nimport { Image, Link } from 'mdast'\r\nimport { MdxJsxFlowElement, MdxjsEsm } from 'mdast-util-mdx'\r\nimport {Logger, LogLevel, resolveLogLevel} from './logger'\r\n\r\nconsole.log(\"\uD83E\uDD96 remarkScopedPath plugin module loaded\")\r\n\r\ninterface ScopedPathOptions {\r\n from: string\r\n to: string\r\n}\r\ninterface Options {\r\n mappings: ScopedPathOptions[]\r\n logLevel?: LogLevel\r\n}\r\n\r\nexport const remarkScopedPath: Plugin<[Options]> = (options?: Options) => {\r\n const { mappings = [], logLevel = LogLevel.Silent } = options ?? {}\r\n const logger = new Logger(resolveLogLevel(options?.logLevel), 'remarkScopedPath')\r\n\r\n logger.log(`initialized with ${mappings.length} mappings`)\r\n\r\n return (tree, file) => {\r\n const filePath = file?.path || file?.history?.slice(-1)[0] || 'unknown'\r\n logger.log(`processing file: ${filePath}`, LogLevel.Debug)\r\n\r\n const rewrite = (val: string, from: string, to: string, ctx: string) => {\r\n if (val.startsWith(from)) {\r\n const newVal = val.replace(from, to)\r\n logger.log(`\uD83D\uDD04 ${ctx} ${val} \u2192 ${newVal}`, LogLevel.Info)\r\n return newVal\r\n }\r\n return val\r\n }\r\n\r\n visit(tree, 'image', (node: Image) => {\r\n for (const { from, to } of mappings) node.url = rewrite(node.url, from, to, 'img')\r\n })\r\n\r\n visit(tree, 'link', (node: Link) => {\r\n for (const { from, to } of mappings) node.url = rewrite(node.url, from, to, 'link')\r\n })\r\n\r\n visit(tree, 'mdxJsxFlowElement', (node: MdxJsxFlowElement) => {\r\n node.attributes?.forEach(attr => {\r\n if (attr.type === 'mdxJsxAttribute' && typeof attr.value === 'string') {\r\n for (const { from, to } of mappings)\r\n attr.value = rewrite(attr.value, from, to, `jsx <${node.name}> ${attr.name}:`)\r\n }\r\n })\r\n })\r\n\r\n visit(tree, 'mdxjsEsm', (node: MdxjsEsm) => {\r\n for (const { from, to } of mappings) {\r\n const re = new RegExp(`(['\"])${from}/`, 'g')\r\n const newVal = node.value.replace(re, `$1${to}/`)\r\n if (newVal !== node.value) {\r\n logger.log(\r\n `esm rewrite (${from} \u2192 ${to}):\\n--- before ---\\n${node.value}\\n--- after ---\\n${newVal}`,\r\n LogLevel.Info\r\n )\r\n node.value = newVal\r\n }\r\n }\r\n })\r\n\r\n logger.log(` `, LogLevel.Debug)\r\n }\r\n}\r\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,8BAAsB;AAGtB,oBAAgD;AAEhD,QAAQ,IAAI,iDAA0C;AAW/C,MAAM,mBAAsC,CAAC,YAAsB;AACtE,QAAM,EAAE,WAAW,CAAC,GAAG,WAAW,uBAAS,OAAO,IAAI,WAAW,CAAC;AAClE,QAAM,SAAS,IAAI,yBAAO,+BAAgB,SAAS,QAAQ,GAAG,kBAAkB;AAEhF,SAAO,IAAI,oBAAoB,SAAS,MAAM,WAAW;AAEzD,SAAO,CAAC,MAAM,SAAS;AACnB,UAAM,WAAW,MAAM,QAAQ,MAAM,SAAS,MAAM,EAAE,EAAE,CAAC,KAAK;AAC9D,WAAO,IAAI,oBAAoB,QAAQ,IAAI,uBAAS,KAAK;AAEzD,UAAM,UAAU,CAAC,KAAa,MAAc,IAAY,QAAgB;AACpE,UAAI,IAAI,WAAW,IAAI,GAAG;AACtB,cAAM,SAAS,IAAI,QAAQ,MAAM,EAAE;AACnC,eAAO,IAAI,aAAM,GAAG,IAAI,GAAG,WAAM,MAAM,IAAI,uBAAS,IAAI;AACxD,eAAO;AAAA,MACX;AACA,aAAO;AAAA,IACX;AAEA,uCAAM,MAAM,SAAS,CAAC,SAAgB;AAClC,iBAAW,EAAE,MAAM,GAAG,KAAK,SAAU,MAAK,MAAM,QAAQ,KAAK,KAAK,MAAM,IAAI,KAAK;AAAA,IACrF,CAAC;AAED,uCAAM,MAAM,QAAQ,CAAC,SAAe;AAChC,iBAAW,EAAE,MAAM,GAAG,KAAK,SAAU,MAAK,MAAM,QAAQ,KAAK,KAAK,MAAM,IAAI,MAAM;AAAA,IACtF,CAAC;AAED,uCAAM,MAAM,qBAAqB,CAAC,SAA4B;AAC1D,WAAK,YAAY,QAAQ,UAAQ;AAC7B,YAAI,KAAK,SAAS,qBAAqB,OAAO,KAAK,UAAU,UAAU;AACnE,qBAAW,EAAE,MAAM,GAAG,KAAK;AACvB,iBAAK,QAAQ,QAAQ,KAAK,OAAO,MAAM,IAAI,QAAQ,KAAK,IAAI,KAAK,KAAK,IAAI,GAAG;AAAA,QACrF;AAAA,MACJ,CAAC;AAAA,IACL,CAAC;AAED,uCAAM,MAAM,YAAY,CAAC,SAAmB;AACxC,iBAAW,EAAE,MAAM,GAAG,KAAK,UAAU;AACjC,cAAM,KAAK,IAAI,OAAO,SAAS,IAAI,KAAK,GAAG;AAC3C,cAAM,SAAS,KAAK,MAAM,QAAQ,IAAI,KAAK,EAAE,GAAG;AAChD,YAAI,WAAW,KAAK,OAAO;AACvB,iBAAO;AAAA,YACH,gBAAgB,IAAI,WAAM,EAAE;AAAA;AAAA,EAAuB,KAAK,KAAK;AAAA;AAAA,EAAoB,MAAM;AAAA,YACvF,uBAAS;AAAA,UACb;AACA,eAAK,QAAQ;AAAA,QACjB;AAAA,MACJ;AAAA,IACJ,CAAC;AAED,WAAO,IAAI,KAAK,uBAAS,KAAK;AAAA,EAClC;AACJ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,50 +1,85 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
if (!parent || index === undefined)
|
|
12
|
-
return;
|
|
13
|
-
if (node.lang === 'yaml-table') {
|
|
14
|
-
try {
|
|
15
|
-
const data = yaml.load(node.value);
|
|
16
|
-
if (Array.isArray(data) && data.length > 0 && typeof data[0] === 'object') {
|
|
17
|
-
const headers = Object.keys(data[0]);
|
|
18
|
-
const tableRows = data.map((row) => ({
|
|
19
|
-
type: 'tableRow',
|
|
20
|
-
children: headers.map((header) => ({
|
|
21
|
-
type: 'tableCell',
|
|
22
|
-
children: [{ type: 'text', value: String(row[header] ?? '') }],
|
|
23
|
-
})),
|
|
24
|
-
}));
|
|
25
|
-
const tableNode = {
|
|
26
|
-
type: 'table',
|
|
27
|
-
align: headers.map(() => null),
|
|
28
|
-
children: [
|
|
29
|
-
{
|
|
30
|
-
type: 'tableRow',
|
|
31
|
-
children: headers.map((header) => ({
|
|
32
|
-
type: 'tableCell',
|
|
33
|
-
children: [{ type: 'text', value: header }],
|
|
34
|
-
})),
|
|
35
|
-
},
|
|
36
|
-
...tableRows,
|
|
37
|
-
],
|
|
38
|
-
};
|
|
39
|
-
parent.children[index] = tableNode;
|
|
40
|
-
logger.log(`generated table with ${headers.length} columns and ${data.length} rows`, LogLevel.Info);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
catch (error) {
|
|
44
|
-
logger.log(`YAML parsing error: ${error.message}`, LogLevel.Info);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
};
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
49
11
|
};
|
|
50
|
-
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var remarkYamlTable_exports = {};
|
|
30
|
+
__export(remarkYamlTable_exports, {
|
|
31
|
+
remarkYamlTable: () => remarkYamlTable
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(remarkYamlTable_exports);
|
|
34
|
+
var import_unist_util_visit = require("unist-util-visit");
|
|
35
|
+
var import_js_yaml = __toESM(require("js-yaml"));
|
|
36
|
+
var import_logger = require("./logger");
|
|
37
|
+
console.log("\u{1F996} remarkYamlTable plugin module loaded");
|
|
38
|
+
const remarkYamlTable = (options) => {
|
|
39
|
+
const { logLevel = import_logger.LogLevel.Silent } = options ?? {};
|
|
40
|
+
const logger = new import_logger.Logger((0, import_logger.resolveLogLevel)(options?.logLevel), "remarkYamlTable");
|
|
41
|
+
logger.log("initialized");
|
|
42
|
+
return (tree) => {
|
|
43
|
+
(0, import_unist_util_visit.visit)(tree, "code", (node, index, parent) => {
|
|
44
|
+
if (!parent || index === void 0) return;
|
|
45
|
+
if (node.lang === "yaml-table") {
|
|
46
|
+
try {
|
|
47
|
+
const data = import_js_yaml.default.load(node.value);
|
|
48
|
+
if (Array.isArray(data) && data.length > 0 && typeof data[0] === "object") {
|
|
49
|
+
const headers = Object.keys(data[0]);
|
|
50
|
+
const tableRows = data.map((row) => ({
|
|
51
|
+
type: "tableRow",
|
|
52
|
+
children: headers.map((header) => ({
|
|
53
|
+
type: "tableCell",
|
|
54
|
+
children: [{ type: "text", value: String(row[header] ?? "") }]
|
|
55
|
+
}))
|
|
56
|
+
}));
|
|
57
|
+
const tableNode = {
|
|
58
|
+
type: "table",
|
|
59
|
+
align: headers.map(() => null),
|
|
60
|
+
children: [
|
|
61
|
+
{
|
|
62
|
+
type: "tableRow",
|
|
63
|
+
children: headers.map((header) => ({
|
|
64
|
+
type: "tableCell",
|
|
65
|
+
children: [{ type: "text", value: header }]
|
|
66
|
+
}))
|
|
67
|
+
},
|
|
68
|
+
...tableRows
|
|
69
|
+
]
|
|
70
|
+
};
|
|
71
|
+
parent.children[index] = tableNode;
|
|
72
|
+
logger.log(`generated table with ${headers.length} columns and ${data.length} rows`, import_logger.LogLevel.Info);
|
|
73
|
+
}
|
|
74
|
+
} catch (error) {
|
|
75
|
+
logger.log(`YAML parsing error: ${error.message}`, import_logger.LogLevel.Info);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
82
|
+
0 && (module.exports = {
|
|
83
|
+
remarkYamlTable
|
|
84
|
+
});
|
|
85
|
+
//# sourceMappingURL=remarkYamlTable.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/docusaurus-plugins/remarkYamlTable.ts"],
|
|
4
|
+
"sourcesContent": ["import { Plugin } from 'unified'\r\nimport { visit } from 'unist-util-visit'\r\nimport yaml from 'js-yaml'\r\nimport { Parent } from 'unist'\r\nimport { Literal } from 'unist'\r\nimport {Logger, LogLevel, resolveLogLevel} from './logger'\r\n\r\nconsole.log(\"\uD83E\uDD96 remarkYamlTable plugin module loaded\")\r\n\r\ninterface Code extends Literal {\r\n type: 'code'\r\n lang?: string\r\n value: string\r\n}\r\n\r\ninterface TableCell {\r\n type: 'tableCell'\r\n children: { type: 'text'; value: string }[]\r\n}\r\n\r\ninterface TableRow {\r\n type: 'tableRow'\r\n children: TableCell[]\r\n}\r\n\r\ninterface Table {\r\n type: 'table'\r\n align: (null | 'left' | 'right' | 'center')[]\r\n children: TableRow[]\r\n}\r\n\r\ninterface Options {\r\n logLevel?: LogLevel\r\n}\r\n\r\nexport const remarkYamlTable: Plugin<[Options]> = (options?: Options) => {\r\n const { logLevel = LogLevel.Silent } = options ?? {}\r\n const logger = new Logger(resolveLogLevel(options?.logLevel), 'remarkYamlTable')\r\n\r\n logger.log('initialized')\r\n\r\n return (tree) => {\r\n visit(tree, 'code', (node: Code, index: number | undefined, parent: Parent | undefined) => {\r\n if (!parent || index === undefined) return\r\n if (node.lang === 'yaml-table') {\r\n try {\r\n const data = yaml.load(node.value)\r\n if (Array.isArray(data) && data.length > 0 && typeof data[0] === 'object') {\r\n const headers = Object.keys(data[0] as Record<string, unknown>)\r\n\r\n const tableRows: TableRow[] = (data as Record<string, unknown>[]).map((row) => ({\r\n type: 'tableRow',\r\n children: headers.map<TableCell>((header) => ({\r\n type: 'tableCell',\r\n children: [{ type: 'text', value: String(row[header] ?? '') }],\r\n })),\r\n }))\r\n\r\n const tableNode: Table = {\r\n type: 'table',\r\n align: headers.map(() => null),\r\n children: [\r\n {\r\n type: 'tableRow',\r\n children: headers.map<TableCell>((header) => ({\r\n type: 'tableCell',\r\n children: [{ type: 'text', value: header }],\r\n })),\r\n },\r\n ...tableRows,\r\n ],\r\n }\r\n\r\n parent.children[index] = tableNode\r\n logger.log(`generated table with ${headers.length} columns and ${data.length} rows`, LogLevel.Info)\r\n }\r\n } catch (error) {\r\n logger.log(`YAML parsing error: ${(error as Error).message}`, LogLevel.Info)\r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kBAC9C,EAAE;AAAA,gBACN;AAAA,gBACA,GAAG;AAAA,cACP;AAAA,YACJ;AAEA,mBAAO,SAAS,KAAK,IAAI;AACzB,mBAAO,IAAI,wBAAwB,QAAQ,MAAM,gBAAgB,KAAK,MAAM,SAAS,uBAAS,IAAI;AAAA,UACtG;AAAA,QACJ,SAAS,OAAO;AACZ,iBAAO,IAAI,uBAAwB,MAAgB,OAAO,IAAI,uBAAS,IAAI;AAAA,QAC/E;AAAA,MACJ;AAAA,IACJ,CAAC;AAAA,EACL;AACJ;",
|
|
6
|
+
"names": ["yaml"]
|
|
7
|
+
}
|
|
@@ -1,44 +1,67 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var remarkYouTube_exports = {};
|
|
20
|
+
__export(remarkYouTube_exports, {
|
|
21
|
+
remarkYouTube: () => remarkYouTube
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(remarkYouTube_exports);
|
|
24
|
+
var import_unist_util_visit = require("unist-util-visit");
|
|
25
|
+
var import_logger = require("./logger");
|
|
26
|
+
console.log("\u{1F996} remarkYouTube plugin module loaded");
|
|
27
|
+
const remarkYouTube = (options) => {
|
|
28
|
+
const { logLevel = import_logger.LogLevel.Silent } = options ?? {};
|
|
29
|
+
const logger = new import_logger.Logger((0, import_logger.resolveLogLevel)(options?.logLevel), "remarkYouTube");
|
|
30
|
+
logger.log("initialized");
|
|
31
|
+
return (tree) => {
|
|
32
|
+
(0, import_unist_util_visit.visit)(tree, ["link", "text"], (node, index, parent) => {
|
|
33
|
+
if (!parent || typeof index !== "number") return;
|
|
34
|
+
let raw = node.url || node.value || "";
|
|
35
|
+
let ytUrl = raw.trim();
|
|
36
|
+
const hashnodeMatch = ytUrl.match(/^%\[(.+)\]$/);
|
|
37
|
+
if (hashnodeMatch) {
|
|
38
|
+
ytUrl = hashnodeMatch[1];
|
|
39
|
+
logger.log(`hashnode-style embed detected: ${ytUrl}`, import_logger.LogLevel.Info);
|
|
40
|
+
}
|
|
41
|
+
const m = ytUrl.match(/youtube\.com\/watch\?v=([A-Za-z0-9_-]+)/) || ytUrl.match(/youtu\.be\/([A-Za-z0-9_-]+)/) || ytUrl.match(/youtube-nocookie\.com\/watch\?v=([A-Za-z0-9_-]+)/);
|
|
42
|
+
if (m) {
|
|
43
|
+
logger.log(`rewriting YouTube URL: ${ytUrl} \u2192 videoId=${m[1]}`, import_logger.LogLevel.Debug);
|
|
44
|
+
parent.children.splice(index, 1, {
|
|
45
|
+
type: "mdxJsxFlowElement",
|
|
46
|
+
name: "LiteYouTubeEmbed",
|
|
47
|
+
attributes: [
|
|
48
|
+
{ type: "mdxJsxAttribute", name: "id", value: m[1] },
|
|
49
|
+
{ type: "mdxJsxAttribute", name: "title", value: "YouTube video" }
|
|
50
|
+
]
|
|
41
51
|
});
|
|
42
|
-
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
(0, import_unist_util_visit.visit)(tree, "text", (node, index, parent) => {
|
|
55
|
+
if (!parent || typeof index !== "number") return;
|
|
56
|
+
if (node.value.trim() === "%[" || node.value.trim() === "]") {
|
|
57
|
+
logger.log(`stripping hashnode bracket artifact: ${node.value}`, import_logger.LogLevel.Debug);
|
|
58
|
+
parent.children.splice(index, 1);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
};
|
|
43
62
|
};
|
|
44
|
-
|
|
63
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
64
|
+
0 && (module.exports = {
|
|
65
|
+
remarkYouTube
|
|
66
|
+
});
|
|
67
|
+
//# sourceMappingURL=remarkYouTube.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/docusaurus-plugins/remarkYouTube.ts"],
|
|
4
|
+
"sourcesContent": ["import type { Plugin } from 'unified'\nimport { visit } from 'unist-util-visit'\nimport type { Node } from 'unist'\nimport {Logger, LogLevel, resolveLogLevel} from './logger'\n\nconsole.log(\"\uD83E\uDD96 remarkYouTube plugin module loaded\")\n\ninterface YouTubeOptions {\n logLevel?: LogLevel\n}\n\nexport const remarkYouTube: Plugin<[YouTubeOptions]> = (options?: YouTubeOptions) => {\n const { logLevel = LogLevel.Silent } = options ?? {}\n const logger = new Logger(resolveLogLevel(options?.logLevel), 'remarkYouTube')\n\n logger.log('initialized')\n\n return (tree: Node) => {\n visit(tree, ['link', 'text'], (node: any, index: number | undefined, parent: any) => {\n if (!parent || typeof index !== 'number') return\n let raw = node.url || node.value || ''\n let ytUrl = raw.trim()\n\n const hashnodeMatch = ytUrl.match(/^%\\[(.+)\\]$/)\n if (hashnodeMatch) {\n ytUrl = hashnodeMatch[1]\n logger.log(`hashnode-style embed detected: ${ytUrl}`, LogLevel.Info)\n }\n\n const m =\n ytUrl.match(/youtube\\.com\\/watch\\?v=([A-Za-z0-9_-]+)/) ||\n ytUrl.match(/youtu\\.be\\/([A-Za-z0-9_-]+)/) ||\n ytUrl.match(/youtube-nocookie\\.com\\/watch\\?v=([A-Za-z0-9_-]+)/)\n\n if (m) {\n logger.log(`rewriting YouTube URL: ${ytUrl} \u2192 videoId=${m[1]}`, LogLevel.Debug)\n parent.children.splice(index, 1, {\n type: 'mdxJsxFlowElement',\n name: 'LiteYouTubeEmbed',\n attributes: [\n { type: 'mdxJsxAttribute', name: 'id', value: m[1] },\n { type: 'mdxJsxAttribute', name: 'title', value: 'YouTube video' },\n ],\n })\n }\n })\n\n visit(tree, 'text', (node: any, index: number | undefined, parent: any) => {\n if (!parent || typeof index !== 'number') return\n if (node.value.trim() === '%[' || node.value.trim() === ']') {\n logger.log(`stripping hashnode bracket artifact: ${node.value}`, LogLevel.Debug)\n parent.children.splice(index, 1)\n }\n })\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,8BAAsB;AAEtB,oBAAgD;AAEhD,QAAQ,IAAI,8CAAuC;AAM5C,MAAM,gBAA0C,CAAC,YAA6B;AACjF,QAAM,EAAE,WAAW,uBAAS,OAAO,IAAI,WAAW,CAAC;AACnD,QAAM,SAAS,IAAI,yBAAO,+BAAgB,SAAS,QAAQ,GAAG,eAAe;AAE7E,SAAO,IAA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-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var timedPlugin_exports = {};
|
|
20
|
+
__export(timedPlugin_exports, {
|
|
21
|
+
timedPlugin: () => timedPlugin
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(timedPlugin_exports);
|
|
24
|
+
var import_logger = require("./logger");
|
|
25
|
+
function timedPlugin(name, plugin, opts = {}) {
|
|
26
|
+
const { logLevel = import_logger.LogLevel.Info } = opts;
|
|
27
|
+
const logger = new import_logger.Logger((0, import_logger.resolveLogLevel)(opts?.logLevel), name);
|
|
28
|
+
return ((...args) => {
|
|
29
|
+
const instance = plugin(...args);
|
|
30
|
+
return (tree, file) => {
|
|
31
|
+
const start = Date.now();
|
|
32
|
+
const res = instance(tree, file);
|
|
33
|
+
const dur = Date.now() - start;
|
|
34
|
+
logger.log(`\u23F1 finished in ${dur}ms`);
|
|
35
|
+
return res;
|
|
36
|
+
};
|
|
37
|
+
});
|
|
15
38
|
}
|
|
16
|
-
|
|
39
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
40
|
+
0 && (module.exports = {
|
|
41
|
+
timedPlugin
|
|
42
|
+
});
|
|
43
|
+
//# sourceMappingURL=timedPlugin.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/docusaurus-plugins/timedPlugin.ts"],
|
|
4
|
+
"sourcesContent": ["import { Plugin } from \"unified\"\r\nimport {Logger, LogLevel, resolveLogLevel} from './logger'\r\n\r\nexport function timedPlugin<T extends Plugin>(\r\n name: string,\r\n plugin: T,\r\n opts: { logLevel?: LogLevel } = {}\r\n): T {\r\n const { logLevel = LogLevel.Info } = opts\r\n const logger = new Logger(resolveLogLevel(opts?.logLevel), name)\r\n\r\n return ((...args: any[]) => {\r\n const instance = (plugin as any)(...args)\r\n return (tree: any, file: any) => {\r\n const start = Date.now()\r\n const res = instance(tree, file)\r\n const dur = Date.now() - start\r\n logger.log(`\u23F1 finished in ${dur}ms`)\r\n return res\r\n }\r\n }) as any\r\n}\r\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBAAgD;AAEzC,SAAS,YACZ,MACA,QACA,OAAgC,CAAC,GAChC;AACD,QAAM,EAAE,WAAW,uBAAS,KAAK,IAAI;AACrC,QAAM,SAAS,IAAI,yBAAO,+BAAgB,MAAM,QAAQ,GAAG,IAAI;AAE/D,UAAQ,IAAI,SAAgB;AACxB,UAAM,WAAY,OAAe,GAAG,IAAI;AACxC,WAAO,CAAC,MAAW,SAAc;AAC7B,YAAM,QAAQ,KAAK,IAAI;AACvB,YAAM,MAAM,SAAS,MAAM,IAAI;AAC/B,YAAM,MAAM,KAAK,IAAI,IAAI;AACzB,aAAO,IAAI,sBAAiB,GAAG,IAAI;AACnC,aAAO;AAAA,IACX;AAAA,EACJ;AACJ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAGxD,MAAM,CAAC,OAAO,UAAU,eAAe,CACrC,OAAO,EAAE,WAAW,EACpB,OAAO,GAAE,sBAA2B,GACnC,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAGxD,MAAM,CAAC,OAAO,UAAU,eAAe,CACrC,OAAO,EAAE,WAAW,EACpB,OAAO,GAAE,sBAA2B,GACnC,MAAM,CAqCR;AAGD,YAAY,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/src/index.js
CHANGED
|
@@ -1,32 +1,64 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var src_exports = {};
|
|
30
|
+
__export(src_exports, {
|
|
31
|
+
default: () => themeNetFoundry
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(src_exports);
|
|
34
|
+
var import_path = __toESM(require("path"));
|
|
35
|
+
function themeNetFoundry(context, options = {}) {
|
|
36
|
+
return {
|
|
37
|
+
name: "@netfoundry/docusaurus-theme",
|
|
38
|
+
// Register theme component overrides
|
|
39
|
+
getThemePath() {
|
|
40
|
+
return import_path.default.resolve(__dirname, "../theme");
|
|
41
|
+
},
|
|
42
|
+
// For TypeScript development
|
|
43
|
+
getTypeScriptThemePath() {
|
|
44
|
+
return import_path.default.resolve(__dirname, "../theme");
|
|
45
|
+
},
|
|
46
|
+
getPathsToWatch() {
|
|
47
|
+
return [
|
|
48
|
+
import_path.default.resolve(__dirname, "../static")
|
|
49
|
+
];
|
|
50
|
+
},
|
|
51
|
+
// Automatically inject CSS
|
|
52
|
+
getClientModules() {
|
|
53
|
+
const modules = [
|
|
54
|
+
import_path.default.resolve(__dirname, "../css/theme.css")
|
|
55
|
+
];
|
|
56
|
+
if (options.customCss) {
|
|
57
|
+
const customCssArray = Array.isArray(options.customCss) ? options.customCss : [options.customCss];
|
|
58
|
+
modules.push(...customCssArray);
|
|
59
|
+
}
|
|
60
|
+
return modules;
|
|
61
|
+
}
|
|
62
|
+
};
|
|
28
63
|
}
|
|
29
|
-
|
|
30
|
-
// should be imported directly from '@netfoundry/docusaurus-shared/ui' in client code,
|
|
31
|
-
// not from this theme entry point, as this file runs at Node.js config time.
|
|
32
|
-
//# sourceMappingURL=index.js.map
|
|
64
|
+
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["import type { LoadContext, Plugin } from '@docusaurus/types';\r\nimport type { NetFoundryThemeOptions } from './options';\r\nimport path from 'path';\r\n\r\nexport default function themeNetFoundry(\r\n context: LoadContext,\r\n options: NetFoundryThemeOptions = {}\r\n): Plugin {\r\n return {\r\n name: '@netfoundry/docusaurus-theme',\r\n\r\n // Register theme component overrides\r\n getThemePath() {\r\n return path.resolve(__dirname, '../theme');\r\n },\r\n\r\n // For TypeScript development\r\n getTypeScriptThemePath() {\r\n return path.resolve(__dirname, '../theme');\r\n },\r\n\r\n getPathsToWatch() {\r\n return [\r\n path.resolve(__dirname, '../static'),\r\n ];\r\n },\r\n\r\n // Automatically inject CSS\r\n getClientModules() {\r\n const modules: string[] = [\r\n path.resolve(__dirname, '../css/theme.css'),\r\n ];\r\n\r\n // Add custom CSS if specified in options\r\n if (options.customCss) {\r\n const customCssArray = Array.isArray(options.customCss)\r\n ? options.customCss\r\n : [options.customCss];\r\n modules.push(...customCssArray);\r\n }\r\n\r\n return modules;\r\n },\r\n };\r\n}\r\n\r\n// Re-export types for consumers (types are safe to export at config time)\r\nexport type { NetFoundryThemeOptions, NetFoundryThemeConfig } from './options';\r\n\r\n// NOTE: UI components (defaultNetFoundryFooterProps, defaultSocialProps, etc.)\r\n// should be imported directly from '@netfoundry/docusaurus-shared/ui' in client code,\r\n// not from this theme entry point, as this file runs at Node.js config time.\r\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,kBAAiB;AAEF,SAAR,gBACL,SACA,UAAkC,CAAC,GAC3B;AACR,SAAO;AAAA,IACL,MAAM;AAAA;AAAA,IAGN,eAAe;AACb,aAAO,YAAAA,QAAK,QAAQ,WAAW,UAAU;AAAA,IAC3C;AAAA;AAAA,IAGA,yBAAyB;AACvB,aAAO,YAAAA,QAAK,QAAQ,WAAW,UAAU;AAAA,IAC3C;AAAA,IAEA,kBAAkB;AAChB,aAAO;AAAA,QACL,YAAAA,QAAK,QAAQ,WAAW,WAAW;AAAA,MACrC;AAAA,IACF;AAAA;AAAA,IAGA,mBAAmB;AACjB,YAAM,UAAoB;AAAA,QACxB,YAAAA,QAAK,QAAQ,WAAW,kBAAkB;AAAA,MAC5C;AAGA,UAAI,QAAQ,WAAW;AACrB,cAAM,iBAAiB,MAAM,QAAQ,QAAQ,SAAS,IAClD,QAAQ,YACR,CAAC,QAAQ,SAAS;AACtB,gBAAQ,KAAK,GAAG,cAAc;AAAA,MAChC;AAEA,aAAO;AAAA,IACT;AAAA,EACF;AACF;",
|
|
6
|
+
"names": ["path"]
|
|
7
|
+
}
|
package/dist/src/node.js
CHANGED
|
@@ -1,7 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
+
var node_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(node_exports);
|
|
18
|
+
__reExport(node_exports, require("./docusaurus-envhelper"), module.exports);
|
|
19
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
20
|
+
0 && (module.exports = {
|
|
21
|
+
...require("./docusaurus-envhelper")
|
|
22
|
+
});
|
|
23
|
+
//# sourceMappingURL=node.js.map
|
package/dist/src/node.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/node.ts"],
|
|
4
|
+
"sourcesContent": ["/**\r\n * Node.js utilities entry point\r\n *\r\n * Import from '@netfoundry/docusaurus-theme/node' in Node.js contexts.\r\n */\r\nexport * from './docusaurus-envhelper';\r\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAKA,yBAAc,mCALd;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/src/options.d.ts
CHANGED
|
@@ -56,6 +56,13 @@ export interface ProductOverride {
|
|
|
56
56
|
footer?: FooterConfig;
|
|
57
57
|
starBanner?: StarBannerConfig;
|
|
58
58
|
navbarItems?: any[];
|
|
59
|
+
logo?: {
|
|
60
|
+
to?: string;
|
|
61
|
+
text?: string;
|
|
62
|
+
alt?: string;
|
|
63
|
+
logoLight?: string;
|
|
64
|
+
logoDark?: string;
|
|
65
|
+
};
|
|
59
66
|
}
|
|
60
67
|
/**
|
|
61
68
|
* Theme configuration in themeConfig.netfoundry
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,2CAA2C;IAC3C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yBAAyB;IACzB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,iEAAiE;IACjE,kBAAkB,CAAC,EAAE,SAAS,EAAE,CAAC;IACjC,8BAA8B;IAC9B,cAAc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,MAAM,GAAG,OAAO,CAAC;CACxB"}
|
package/dist/src/options.js
CHANGED
|
@@ -1,2 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var options_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(options_exports);
|
|
17
|
+
//# sourceMappingURL=options.js.map
|
package/dist/src/options.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/options.ts"],
|
|
4
|
+
"sourcesContent": ["import type { ReactNode } from 'react';\n\n/**\n * Social media link configuration for the footer\n */\nexport interface SocialProps {\n githubUrl?: string;\n twitterUrl?: string;\n linkedInUrl?: string;\n youtubeUrl?: string;\n facebookUrl?: string;\n instagramUrl?: string;\n}\n\n/**\n * Footer configuration for the theme\n */\nexport interface FooterConfig {\n /** Description text shown in the footer */\n description?: string;\n /** Social media links */\n socialProps?: SocialProps;\n /** Documentation section links (as ReactNode for JSX support) */\n documentationLinks?: ReactNode[];\n /** Community section links */\n communityLinks?: ReactNode[];\n /** Resources section links */\n resourceLinks?: ReactNode[];\n}\n\n/**\n * Star banner configuration\n */\nexport interface StarBannerConfig {\n /** GitHub repository URL */\n repoUrl: string;\n /** Label text for the star button */\n label: string;\n}\n\n/**\n * Navbar product configuration\n */\nexport interface NavbarProductConfig {\n pathPrefix: string;\n items: any[]; // Docusaurus NavbarItem types\n}\n\n/**\n * Options passed to the theme plugin in docusaurus.config.ts\n */\nexport interface NetFoundryThemeOptions {\n /** Custom CSS file path(s) to include */\n customCss?: string | string[];\n}\n\n/**\n * Product-specific overrides\n */\nexport interface ProductOverride {\n pathPrefix: string;\n footer?: FooterConfig;\n starBanner?: StarBannerConfig;\n navbarItems?: any[];\n logo?: {\n to?: string;\n text?: string;\n alt?: string;\n logoLight?: string;\n logoDark?: string;\n };\n}\n\n/**\n * Theme configuration in themeConfig.netfoundry\n */\nexport interface NetFoundryThemeConfig {\n /** Default footer configuration */\n footer?: FooterConfig;\n /** Default star banner configuration */\n starBanner?: StarBannerConfig;\n /** Whether to show the star banner (default: false) */\n showStarBanner?: boolean;\n /** Product-specific overrides based on path */\n products?: ProductOverride[];\n}\n\n/**\n * Extended Docusaurus ThemeConfig with NetFoundry configuration\n */\nexport interface ThemeConfigWithNetFoundry {\n netfoundry?: NetFoundryThemeConfig;\n [key: string]: unknown;\n}"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|