robindoc 0.0.0-experimental-3f39623 → 0.0.0-experimental-5d28895
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/lib/core/utils/parse-structure.d.ts +1 -1
- package/lib/core/utils/parse-structure.d.ts.map +1 -1
- package/lib/core/utils/parse-structure.js +1 -1
- package/lib/core/utils/parse-structure.js.map +1 -1
- package/lib/core/utils/structure-tools.d.ts +26 -0
- package/lib/core/utils/structure-tools.d.ts.map +1 -0
- package/lib/core/utils/structure-tools.js +2 -0
- package/lib/core/utils/structure-tools.js.map +1 -0
- package/lib/styles.css +192 -192
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type DocItem } from "../types/structure";
|
|
2
2
|
import { type Pages, type Crumbs, type Configuration } from "../types/content";
|
|
3
3
|
import { type TreeItem } from "../../components/elements/sidebar/types";
|
|
4
|
-
export declare const parseStructure: (items: DocItem[] | "auto",
|
|
4
|
+
export declare const parseStructure: (items: DocItem[] | "auto", configuration?: Configuration, crumbs?: Crumbs, pathname?: string) => Promise<{
|
|
5
5
|
pages: Pages;
|
|
6
6
|
tree: TreeItem[];
|
|
7
7
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-structure.d.ts","sourceRoot":"","sources":["../../../src/core/utils/parse-structure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,MAAM,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"parse-structure.d.ts","sourceRoot":"","sources":["../../../src/core/utils/parse-structure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,MAAM,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,yCAAyC,CAAC;AAwKxE,eAAO,MAAM,cAAc,GACvB,OAAO,OAAO,EAAE,GAAG,MAAM,EACzB,gBAAe,aAAkB,EACjC,SAAQ,MAAW,EACnB,WAAU,MAAW;;;EAOxB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{getConfiguration as t}from"./get-configuration.js";import{getMetadata as e}from"./get-metadata.js";import{
|
|
1
|
+
import{getConfiguration as t}from"./get-configuration.js";import{getMetadata as e}from"./get-metadata.js";import{normalizePathname as r,mergePathname as s,generatePseudoTitle as a,checkIsLinkExternal as i}from"./path-tools.js";import{loadContent as o}from"./load-content.js";import{createPage as n,shouldSpread as p,createTreeItem as c}from"./structure-tools.js";const u=async(t,i,f)=>{if(!t.provider)return{pages:{},tree:[]};const l=await(async(t,e,a)=>{if(!t.provider)return null;const i=`${e}/structure.json`;if(!(await t.provider.filesPromise).structures.includes(i))return null;const p=await o(i,t.provider);let f;try{f=JSON.parse(p.data)}catch{throw new Error(`Can't parse structure "${i}"`)}const l={},h=[];for(const i in f){const{title:o}=f[i],p=r("index"===i?e:`${e}/${i}`),g=r(s(t.basePath,p)),d=await n(g,p,o,t,a);let m;if(d&&(l[d.pathname]=d.page),"index"!==i){const e=await u(t,d?[...a,g]:a,p);m=e.tree,Object.assign(l,e.pages)}h.push(c(o,g,"row",m))}return{pages:l,tree:h}})(t,f,i);if(l)return l;const h={},g=[],d=f.split("/"),m=d.length,w=await t.provider.filesPromise;for await(const{clientPath:o}of w.docs){const l=o.split("/").length===d.length+1,w=o.startsWith(f);if(!l||!w)continue;const j=r(s(t.basePath,o)),v=(await e({provider:t.provider,uri:o})).title||a(j),y=await n(j,o,v,t,i);y&&(h[y.pathname]=y.page);const b=await u(t,y?[...i,j]:i,o),P=m<=1?"heading":"row";p(m,t.spreadedLevel)?g.push(c(v,j,P),...b.tree):g.push(c(v,j,P,b.tree)),Object.assign(h,b.pages)}return{pages:h,tree:g}},f=async(e,o={},l=[],h="")=>"auto"===e?u(o,l,h):(async(e,o,u,l)=>{const h={},g=[],d=l.split("/").length;for await(const m of e){if("string"==typeof m){const t=await f(m,o,u,l);Object.assign(h,t.pages),g.push(...t.tree);continue}if("separator"===m.type){g.push({type:"separator"});continue}const e=t(m.configuration||{},o),w=m.href||"",j=r(s(e.basePath,w));let v=u;if(w&&!i(j)){const t=await n(j,w,m.title||"",e,u);t&&(h[t.pathname]=t.page,v=[...u,j])}let y=[];if(m.items){const t=await f(m.items,e,v,m.href||"");y=t.tree,Object.assign(h,t.pages)}if(m.hidden)continue;const b=m.title||a(j),P=m.href?j:void 0;p(d,o.spreadedLevel)?g.push(c(b,P,m.type),...y):g.push(c(b,P,m.type,y))}return{pages:h,tree:g}})(e,o,l,h);export{f as parseStructure};
|
|
2
2
|
//# sourceMappingURL=parse-structure.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-structure.js","sources":["../../../src/core/utils/parse-structure.ts"],"sourcesContent":["import { type DocItem } from \"../types/structure\";\nimport { type Pages, type Crumbs, type Configuration } from \"../types/content\";\nimport { type TreeItem } from \"../../components/elements/sidebar/types\";\nimport { getConfiguration } from \"./get-configuration\";\nimport { getMetadata } from \"./get-metadata\";\nimport { generatePseudoTitle, checkIsLinkExternal, mergePathname, normalizePathname } from \"./path-tools\";\nimport { loadContent } from \"./load-content\";\n\nconst parseJSONStructure = async (\n parentConfiguration: Configuration = {},\n parentPathname = \"\",\n crumbs: Crumbs = [],\n nestingLevel: number,\n) => {\n const pages: Pages = {};\n const tree: TreeItem[] = [];\n\n if (!parentConfiguration.provider) return { pages, tree };\n\n const branchFiles = await parentConfiguration.provider.filesPromise;\n\n if (branchFiles.structures.includes(`${parentPathname}/structure.json`)) {\n const content = await loadContent(`${parentPathname}/structure.json`, parentConfiguration.provider);\n try {\n const structure: { [segment: string]: { title: string } } = JSON.parse(content.data);\n for (const segment in structure) {\n const data = structure[segment];\n const clientPath = normalizePathname(\n segment === \"index\" ? parentPathname : parentPathname + \"/\" + segment,\n );\n const pathname = mergePathname(parentConfiguration.basePath, clientPath);\n const pathnameNormalized = normalizePathname(pathname);\n\n if (!checkIsLinkExternal(pathnameNormalized)) {\n const origPath = await parentConfiguration.provider?.getPageSourcePathname(\n clientPath,\n pathnameNormalized,\n );\n if (origPath) {\n pages[pathnameNormalized] = {\n title: data.title,\n uri: clientPath,\n configuration: parentConfiguration,\n origPath,\n crumbs,\n };\n }\n }\n\n let subTree: TreeItem[] | undefined;\n if (segment !== \"index\") {\n const subItemsData = await parseAutoStructure(\n parentConfiguration,\n [...crumbs, pathnameNormalized],\n clientPath,\n nestingLevel + 1,\n );\n subTree = subItemsData.tree;\n Object.assign(pages, subItemsData.pages);\n }\n\n tree.push({\n title: data.title,\n href: pathnameNormalized,\n items: subTree,\n type: \"row\",\n });\n }\n } catch {\n throw new Error(`Can't parse structure \"${parentPathname}/structure.json\"`);\n }\n return { pages, tree };\n }\n};\n\nconst parseAutoStructure = async (\n parentConfiguration: Configuration = {},\n crumbs: Crumbs = [],\n parentPathname = \"\",\n nestingLevel: number,\n) => {\n const pages: Pages = {};\n const tree: TreeItem[] = [];\n\n if (!parentConfiguration.provider) return { pages, tree };\n\n const branchFiles = await parentConfiguration.provider.filesPromise;\n\n if (branchFiles.structures.includes(`${parentPathname}/structure.json`)) {\n const jsonStructureData = await parseJSONStructure(\n parentConfiguration,\n parentPathname,\n crumbs,\n nestingLevel + 1,\n );\n if (jsonStructureData) {\n return jsonStructureData;\n }\n }\n\n for await (const generatedItem of branchFiles.docs) {\n const linkLevel = generatedItem.clientPath.split(\"/\").filter(Boolean).length;\n const topLevelLink = linkLevel < 2;\n\n if (\n (!parentPathname && !topLevelLink) ||\n (parentPathname &&\n !generatedItem.clientPath.match(new RegExp(`^${parentPathname.replace(/\\/$/, \"\")}/[^/]+$`)))\n ) {\n continue;\n }\n\n const { clientPath } = generatedItem;\n const pathname = mergePathname(parentConfiguration.basePath, clientPath);\n const pathnameNormalized = normalizePathname(pathname);\n\n const metadata = await getMetadata({ provider: parentConfiguration.provider, uri: clientPath });\n const title = metadata.title || generatePseudoTitle(pathnameNormalized);\n const origPath = await parentConfiguration.provider?.getPageSourcePathname(clientPath, pathnameNormalized);\n if (origPath) {\n pages[pathnameNormalized] = {\n title,\n uri: clientPath,\n configuration: parentConfiguration,\n origPath,\n crumbs,\n };\n }\n\n const subItemsData = await parseAutoStructure(\n parentConfiguration,\n [...crumbs, pathnameNormalized],\n clientPath,\n nestingLevel + 1,\n );\n Object.assign(pages, subItemsData.pages);\n\n if (nestingLevel < (parentConfiguration.spreadedLevel || 1)) {\n tree.push(\n {\n title,\n href: pathnameNormalized,\n type: nestingLevel === 0 ? \"heading\" : \"row\",\n },\n ...subItemsData.tree,\n );\n } else {\n tree.push({\n title,\n href: pathnameNormalized,\n items: subItemsData.tree,\n type: nestingLevel === 0 ? \"heading\" : \"row\",\n });\n }\n }\n\n return { pages, tree };\n};\n\nconst parseStaticStructure = async (\n items: DocItem[],\n parentConfiguration: Configuration = {},\n crumbs: Crumbs = [],\n parentPathname: string,\n nestingLevel: number,\n): Promise<{\n pages: Pages;\n tree: TreeItem[];\n}> => {\n const pages: Pages = {};\n const tree: TreeItem[] = [];\n\n for await (const item of items) {\n if (typeof item === \"string\") {\n const subItemsData = await parseStructure(item, parentConfiguration, crumbs, parentPathname, nestingLevel);\n Object.assign(pages, subItemsData.pages);\n tree.push(...subItemsData.tree);\n continue;\n }\n if (item.type === \"separator\") {\n tree.push({ type: \"separator\" });\n\n continue;\n }\n let subCrumbs = crumbs;\n const configuration = getConfiguration(item.configuration || {}, parentConfiguration);\n const clientPath = item.href;\n const pathname = mergePathname(configuration.basePath, clientPath);\n const pathnameNormalized = normalizePathname(pathname);\n\n if (!checkIsLinkExternal(pathnameNormalized) && clientPath) {\n const origPath = await configuration.provider?.getPageSourcePathname(clientPath, pathnameNormalized);\n\n if (origPath) {\n pages[pathnameNormalized] = {\n title: item.title || \"\",\n uri: clientPath,\n configuration,\n origPath,\n crumbs,\n };\n subCrumbs = [...crumbs, pathnameNormalized];\n }\n }\n\n let subTree: TreeItem[] = [];\n if (item.items) {\n const subItemsData = await parseStructure(\n item.items,\n configuration,\n subCrumbs,\n item.href,\n nestingLevel + 1,\n );\n subTree = subItemsData.tree;\n Object.assign(pages, subItemsData.pages);\n }\n\n if (!item.hidden) {\n if (nestingLevel < (parentConfiguration.spreadedLevel || 1)) {\n tree.push(\n {\n title: item.title || generatePseudoTitle(pathnameNormalized),\n href: item.href ? pathnameNormalized : undefined,\n type: item.type,\n },\n ...subTree,\n );\n } else {\n tree.push({\n title: item.title || generatePseudoTitle(pathnameNormalized),\n href: item.href ? pathnameNormalized : undefined,\n items: subTree,\n type: item.type,\n });\n }\n }\n }\n\n return { pages, tree };\n};\n\nexport const parseStructure = async (\n items: DocItem[] | \"auto\",\n parentConfiguration: Configuration = {},\n crumbs: Crumbs = [],\n pathname: string = \"\",\n nestingLevel: number = 0,\n) => {\n if (items === \"auto\") {\n const structureParsed = await parseAutoStructure(parentConfiguration, crumbs, pathname, nestingLevel);\n return structureParsed;\n }\n\n const structureParsed = await parseStaticStructure(items, parentConfiguration, crumbs, pathname, nestingLevel);\n return structureParsed;\n};\n"],"names":["parseAutoStructure","async","parentConfiguration","crumbs","parentPathname","nestingLevel","pages","tree","provider","branchFiles","filesPromise","structures","includes","jsonStructureData","content","loadContent","structure","JSON","parse","data","segment","clientPath","normalizePathname","pathname","mergePathname","basePath","pathnameNormalized","checkIsLinkExternal","origPath","getPageSourcePathname","title","uri","configuration","subTree","subItemsData","Object","assign","push","href","items","type","Error","parseJSONStructure","generatedItem","docs","linkLevel","split","filter","Boolean","length","match","RegExp","replace","getMetadata","generatePseudoTitle","spreadedLevel","parseStructure","structureParsed","item","subCrumbs","getConfiguration","hidden","undefined","parseSta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,SAEZP,GAGP1B,EAAK8B,KAAK,CACNP,MAAO4B,EAAK5B,OAASwB,EAAoB5B,GACzCY,KAAMoB,EAAKpB,KAAOZ,OAAqBoC,EACvCvB,MAAON,EACPO,KAAMkB,EAAKlB,OAI3B,CAEA,MAAO,CAAElC,QAAOC,SAecwD,CAAqBxB,EAAOrC,EAAqBC,EAAQoB,EAAUlB,GACjG,OAAOoD"}
|
|
1
|
+
{"version":3,"file":"parse-structure.js","sources":["../../../src/core/utils/parse-structure.ts"],"sourcesContent":["import { type DocItem } from \"../types/structure\";\nimport { type Pages, type Crumbs, type Configuration } from \"../types/content\";\nimport { type TreeItem } from \"../../components/elements/sidebar/types\";\nimport { getConfiguration } from \"./get-configuration\";\nimport { getMetadata } from \"./get-metadata\";\nimport { generatePseudoTitle, checkIsLinkExternal, mergePathname, normalizePathname } from \"./path-tools\";\nimport { loadContent } from \"./load-content\";\nimport { createPage, createTreeItem, shouldSpread } from \"./structure-tools\";\n\nconst parseJSONStructure = async (configuration: Configuration, parentPathname: string, crumbs: Crumbs) => {\n if (!configuration.provider) return null;\n\n const branchFiles = await configuration.provider.filesPromise;\n const structurePath = `${parentPathname}/structure.json`;\n\n if (!branchFiles.structures.includes(structurePath)) return null;\n\n const content = await loadContent(structurePath, configuration.provider);\n let structure: { [segment: string]: { title: string } };\n\n try {\n structure = JSON.parse(content.data);\n } catch {\n throw new Error(`Can't parse structure \"${structurePath}\"`);\n }\n\n const pages: Pages = {};\n const tree: TreeItem[] = [];\n\n for (const segment in structure) {\n const { title } = structure[segment];\n const clientPath = normalizePathname(segment === \"index\" ? parentPathname : `${parentPathname}/${segment}`);\n const pathnameNormalized = normalizePathname(mergePathname(configuration.basePath, clientPath));\n\n const pageData = await createPage(pathnameNormalized, clientPath, title, configuration, crumbs);\n if (pageData) {\n pages[pageData.pathname] = pageData.page;\n }\n\n let subTree: TreeItem[] | undefined;\n if (segment !== \"index\") {\n const subResult = await parseAutoStructure(\n configuration,\n pageData ? [...crumbs, pathnameNormalized] : crumbs,\n clientPath,\n );\n subTree = subResult.tree;\n Object.assign(pages, subResult.pages);\n }\n\n tree.push(createTreeItem(title, pathnameNormalized, \"row\", subTree));\n }\n\n return { pages, tree };\n};\n\nconst parseAutoStructure = async (configuration: Configuration, crumbs: Crumbs, parentPathname: string) => {\n if (!configuration.provider) return { pages: {}, tree: [] };\n\n const jsonResult = await parseJSONStructure(configuration, parentPathname, crumbs);\n if (jsonResult) return jsonResult;\n\n const pages: Pages = {};\n const tree: TreeItem[] = [];\n const parentSegments = parentPathname.split(\"/\");\n const nestingLevel = parentSegments.length;\n\n const branchFiles = await configuration.provider.filesPromise;\n\n for await (const { clientPath } of branchFiles.docs) {\n const segments = clientPath.split(\"/\");\n const isDirectChild = segments.length === parentSegments.length + 1;\n const isUnderParent = clientPath.startsWith(parentPathname);\n\n if (!isDirectChild || !isUnderParent) {\n continue;\n }\n\n const pathnameNormalized = normalizePathname(mergePathname(configuration.basePath, clientPath));\n const metadata = await getMetadata({ provider: configuration.provider, uri: clientPath });\n const title = metadata.title || generatePseudoTitle(pathnameNormalized);\n\n const pageData = await createPage(pathnameNormalized, clientPath, title, configuration, crumbs);\n if (pageData) {\n pages[pageData.pathname] = pageData.page;\n }\n\n const subResult = await parseAutoStructure(\n configuration,\n pageData ? [...crumbs, pathnameNormalized] : crumbs,\n clientPath,\n );\n const itemType = nestingLevel <= 1 ? \"heading\" : \"row\";\n\n if (shouldSpread(nestingLevel, configuration.spreadedLevel)) {\n tree.push(createTreeItem(title, pathnameNormalized, itemType), ...subResult.tree);\n } else {\n tree.push(createTreeItem(title, pathnameNormalized, itemType, subResult.tree));\n }\n\n Object.assign(pages, subResult.pages);\n }\n\n return { pages, tree };\n};\n\nconst parseStaticStructure = async (\n items: DocItem[],\n configuration: Configuration,\n crumbs: Crumbs,\n parentPathname: string,\n) => {\n const pages: Pages = {};\n const tree: TreeItem[] = [];\n const nestingLevel = parentPathname.split(\"/\").length;\n\n for await (const item of items) {\n if (typeof item === \"string\") {\n const result = await parseStructure(item, configuration, crumbs, parentPathname);\n Object.assign(pages, result.pages);\n tree.push(...result.tree);\n continue;\n }\n\n if (item.type === \"separator\") {\n tree.push({ type: \"separator\" });\n continue;\n }\n\n const itemConfiguration = getConfiguration(item.configuration || {}, configuration);\n const clientPath = item.href || \"\";\n const pathnameNormalized = normalizePathname(mergePathname(itemConfiguration.basePath, clientPath));\n\n let subCrumbs = crumbs;\n if (clientPath && !checkIsLinkExternal(pathnameNormalized)) {\n const pageData = await createPage(\n pathnameNormalized,\n clientPath,\n item.title || \"\",\n itemConfiguration,\n crumbs,\n );\n if (pageData) {\n pages[pageData.pathname] = pageData.page;\n subCrumbs = [...crumbs, pathnameNormalized];\n }\n }\n\n let subTree: TreeItem[] = [];\n if (item.items) {\n const result = await parseStructure(item.items, itemConfiguration, subCrumbs, item.href || \"\");\n subTree = result.tree;\n Object.assign(pages, result.pages);\n }\n\n if (item.hidden) continue;\n\n const title = item.title || generatePseudoTitle(pathnameNormalized);\n const href = item.href ? pathnameNormalized : undefined;\n\n if (shouldSpread(nestingLevel, configuration.spreadedLevel)) {\n tree.push(createTreeItem(title, href, item.type), ...subTree);\n } else {\n tree.push(createTreeItem(title, href, item.type, subTree));\n }\n }\n\n return { pages, tree };\n};\n\nexport const parseStructure = async (\n items: DocItem[] | \"auto\",\n configuration: Configuration = {},\n crumbs: Crumbs = [],\n pathname: string = \"\",\n) => {\n if (items === \"auto\") {\n return parseAutoStructure(configuration, crumbs, pathname);\n }\n\n return parseStaticStructure(items, configuration, crumbs, pathname);\n};\n"],"names":["parseAutoStructure","async","configuration","crumbs","parentPathname","provider","pages","tree","jsonResult","structurePath","filesPromise","structures","includes","content","loadContent","structure","JSON","parse","data","Error","segment","title","clientPath","normalizePathname","pathnameNormalized","mergePathname","basePath","pageData","createPage","subTree","pathname","page","subResult","Object","assign","push","createTreeItem","parseJSONStructure","parentSegments","split","nestingLevel","length","branchFiles","docs","isDirectChild","isUnderParent","startsWith","getMetadata","uri","generatePseudoTitle","itemType","shouldSpread","spreadedLevel","parseStructure","items","item","result","type","itemConfiguration","getConfiguration","href","subCrumbs","checkIsLinkExternal","hidden","undefined","parseStaticStructure"],"mappings":"2WASA,MA+CMA,EAAqBC,MAAOC,EAA8BC,EAAgBC,KAC5E,IAAKF,EAAcG,SAAU,MAAO,CAAEC,MAAO,GAAIC,KAAM,IAEvD,MAAMC,OAlDiBP,OAAOC,EAA8BE,EAAwBD,KACpF,IAAKD,EAAcG,SAAU,OAAO,KAEpC,MACMI,EAAgB,GAAGL,mBAEzB,WAH0BF,EAAcG,SAASK,cAGhCC,WAAWC,SAASH,GAAgB,OAAO,KAE5D,MAAMI,QAAgBC,EAAYL,EAAeP,EAAcG,UAC/D,IAAIU,EAEJ,IACIA,EAAYC,KAAKC,MAAMJ,EAAQK,KACnC,CAAE,MACE,MAAM,IAAIC,MAAM,0BAA0BV,KAC9C,CAEA,MAAMH,EAAe,CAAA,EACfC,EAAmB,GAEzB,IAAK,MAAMa,KAAWL,EAAW,CAC7B,MAAMM,MAAEA,GAAUN,EAAUK,GACtBE,EAAaC,EAA8B,UAAZH,EAAsBhB,EAAiB,GAAGA,KAAkBgB,KAC3FI,EAAqBD,EAAkBE,EAAcvB,EAAcwB,SAAUJ,IAE7EK,QAAiBC,EAAWJ,EAAoBF,EAAYD,EAAOnB,EAAeC,GAKxF,IAAI0B,EACJ,GALIF,IACArB,EAAMqB,EAASG,UAAYH,EAASI,MAIxB,UAAZX,EAAqB,CACrB,MAAMY,QAAkBhC,EACpBE,EACAyB,EAAW,IAAIxB,EAAQqB,GAAsBrB,EAC7CmB,GAEJO,EAAUG,EAAUzB,KACpB0B,OAAOC,OAAO5B,EAAO0B,EAAU1B,MACnC,CAEAC,EAAK4B,KAAKC,EAAef,EAAOG,EAAoB,MAAOK,GAC/D,CAEA,MAAO,CAAEvB,QAAOC,SAMS8B,CAAmBnC,EAAeE,EAAgBD,GAC3E,GAAIK,EAAY,OAAOA,EAEvB,MAAMF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6B,OAAOC,OAAO5B,EAAOkD,EAAOlD,OAC5BC,EAAK4B,QAAQqB,EAAOjD,MACpB,QACJ,CAEA,GAAkB,cAAdgD,EAAKE,KAAsB,CAC3BlD,EAAK4B,KAAK,CAAEsB,KAAM,cAClB,QACJ,CAEA,MAAMC,EAAoBC,EAAiBJ,EAAKrD,eAAiB,CAAA,EAAIA,GAC/DoB,EAAaiC,EAAKK,MAAQ,GAC1BpC,EAAqBD,EAAkBE,EAAciC,EAAkBhC,SAAUJ,IAEvF,IAAIuC,EAAY1D,EAChB,GAAImB,IAAewC,EAAoBtC,GAAqB,CACxD,MAAMG,QAAiBC,EACnBJ,EACAF,EACAiC,EAAKlC,OAAS,GACdqC,EACAvD,GAEAwB,IACArB,EAAMqB,EAASG,UAAYH,EAASI,KACpC8B,EAAY,IAAI1D,EAAQqB,GAEhC,CAEA,IAAIK,EAAsB,GAC1B,GAAI0B,EAAKD,MAAO,CACZ,MAAME,QAAeH,EAAeE,EAAKD,MAAOI,EAAmBG,EAAWN,EAAKK,MAAQ,IAC3F/B,EAAU2B,EAAOjD,KACjB0B,OAAOC,OAAO5B,EAAOkD,EAAOlD,MAChC,CAEA,GAAIiD,EAAKQ,OAAQ,SAEjB,MAAM1C,EAAQkC,EAAKlC,OAAS4B,EAAoBzB,GAC1CoC,EAAOL,EAAKK,KAAOpC,OAAqBwC,EAE1Cb,EAAaX,EAActC,EAAckD,eACzC7C,EAAK4B,KAAKC,EAAef,EAAOuC,EAAML,EAAKE,SAAU5B,GAErDtB,EAAK4B,KAAKC,EAAef,EAAOuC,EAAML,EAAKE,KAAM5B,GAEzD,CAEA,MAAO,CAAEvB,QAAOC,SAaT0D,CAAqBX,EAAOpD,EAAeC,EAAQ2B"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type Configuration } from "../types/content";
|
|
2
|
+
import { type Crumbs } from "../types/content";
|
|
3
|
+
import { type TreeItem } from "../../components/elements/sidebar/types";
|
|
4
|
+
export declare const createPage: (pathnameNormalized: string, clientPath: string, title: string, configuration: Configuration, crumbs: Crumbs) => Promise<{
|
|
5
|
+
pathname: string;
|
|
6
|
+
page: {
|
|
7
|
+
title: string;
|
|
8
|
+
uri: string;
|
|
9
|
+
configuration: Configuration;
|
|
10
|
+
origPath: string;
|
|
11
|
+
crumbs: Crumbs;
|
|
12
|
+
};
|
|
13
|
+
} | null>;
|
|
14
|
+
export declare const createTreeItem: (title: string, href: string | undefined, type: "heading" | "row" | undefined, items?: TreeItem[]) => {
|
|
15
|
+
title: string;
|
|
16
|
+
href: string | undefined;
|
|
17
|
+
type: "heading" | "row" | undefined;
|
|
18
|
+
items: TreeItem[];
|
|
19
|
+
} | {
|
|
20
|
+
title: string;
|
|
21
|
+
href: string | undefined;
|
|
22
|
+
type: "heading" | "row" | undefined;
|
|
23
|
+
items?: undefined;
|
|
24
|
+
};
|
|
25
|
+
export declare const shouldSpread: (nestingLevel: number, spreadedLevel?: number) => boolean;
|
|
26
|
+
//# sourceMappingURL=structure-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structure-tools.d.ts","sourceRoot":"","sources":["../../../src/core/utils/structure-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,yCAAyC,CAAC;AAGxE,eAAO,MAAM,UAAU,GACnB,oBAAoB,MAAM,EAC1B,YAAY,MAAM,EAClB,OAAO,MAAM,EACb,eAAe,aAAa,EAC5B,QAAQ,MAAM;;;;;;;;;SAWjB,CAAC;AAEF,eAAO,MAAM,cAAc,GACvB,OAAO,MAAM,EACb,MAAM,MAAM,GAAG,SAAS,EACxB,MAAM,SAAS,GAAG,KAAK,GAAG,SAAS,EACnC,QAAQ,QAAQ,EAAE;;;;;;;;;;CAGrB,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,cAAc,MAAM,EAAE,gBAAe,MAAU,YAE3E,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{checkIsLinkExternal as t}from"./path-tools.js";const e=async(e,r,a,i,o)=>{if(t(e))return null;const n=await(i.provider?.getPageSourcePathname(r,e));return n?{pathname:e,page:{title:a,uri:r,configuration:i,origPath:n,crumbs:o}}:null},r=(t,e,r,a)=>a?{title:t,href:e,type:r,items:a}:{title:t,href:e,type:r},a=(t,e=2)=>t<e;export{e as createPage,r as createTreeItem,a as shouldSpread};
|
|
2
|
+
//# sourceMappingURL=structure-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structure-tools.js","sources":["../../../src/core/utils/structure-tools.ts"],"sourcesContent":["import { type Configuration } from \"../types/content\";\nimport { type Crumbs } from \"../types/content\";\nimport { type TreeItem } from \"../../components/elements/sidebar/types\";\nimport { checkIsLinkExternal } from \"./path-tools\";\n\nexport const createPage = async (\n pathnameNormalized: string,\n clientPath: string,\n title: string,\n configuration: Configuration,\n crumbs: Crumbs,\n) => {\n if (checkIsLinkExternal(pathnameNormalized)) return null;\n\n const origPath = await configuration.provider?.getPageSourcePathname(clientPath, pathnameNormalized);\n if (!origPath) return null;\n\n return {\n pathname: pathnameNormalized,\n page: { title, uri: clientPath, configuration, origPath, crumbs },\n };\n};\n\nexport const createTreeItem = (\n title: string,\n href: string | undefined,\n type: \"heading\" | \"row\" | undefined,\n items?: TreeItem[],\n) => {\n return items ? { title, href, type, items } : { title, href, type };\n};\n\nexport const shouldSpread = (nestingLevel: number, spreadedLevel: number = 2) => {\n return nestingLevel < spreadedLevel;\n};\n"],"names":["createPage","async","pathnameNormalized","clientPath","title","configuration","crumbs","checkIsLinkExternal","origPath","provider","getPageSourcePathname","pathname","page","uri","createTreeItem","href","type","items","shouldSpread","nestingLevel","spreadedLevel"],"mappings":"sDAKO,MAAMA,EAAaC,MACtBC,EACAC,EACAC,EACAC,EACAC,KAEA,GAAIC,EAAoBL,GAAqB,OAAO,KAEpD,MAAMM,QAAiBH,EAAcI,UAAUC,sBAAsBP,EAAYD,IACjF,OAAKM,EAEE,CACHG,SAAUT,EACVU,KAAM,CAAER,QAAOS,IAAKV,EAAYE,gBAAeG,WAAUF,WAJvC,MAQbQ,EAAiB,CAC1BV,EACAW,EACAC,EACAC,IAEOA,EAAQ,CAAEb,QAAOW,OAAMC,OAAMC,SAAU,CAAEb,QAAOW,OAAMC,QAGpDE,EAAe,CAACC,EAAsBC,EAAwB,IAChED,EAAeC"}
|
package/lib/styles.css
CHANGED
|
@@ -122,51 +122,6 @@
|
|
|
122
122
|
}
|
|
123
123
|
.r-powered-link:hover {
|
|
124
124
|
color: var(--r-primary-900);
|
|
125
|
-
}.r-docs-container {
|
|
126
|
-
min-height: calc(100dvh - var(--r-header-height));
|
|
127
|
-
overflow-wrap: break-word;
|
|
128
|
-
box-sizing: border-box;
|
|
129
|
-
}
|
|
130
|
-
@media screen and (width >= 768px) {
|
|
131
|
-
.r-docs-container {
|
|
132
|
-
display: grid;
|
|
133
|
-
justify-content: center;
|
|
134
|
-
column-gap: 32px;
|
|
135
|
-
grid-template-areas: "sidebar breadcrumbs" "sidebar contents" "sidebar content" "sidebar pagination";
|
|
136
|
-
grid-template-columns: 1fr calc(100% - 248px);
|
|
137
|
-
grid-template-rows: auto auto 1fr auto;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
@media screen and (width >= 1180px) {
|
|
141
|
-
.r-docs-container {
|
|
142
|
-
column-gap: 40px;
|
|
143
|
-
grid-template-areas: "sidebar breadcrumbs contents" "sidebar content contents" "sidebar pagination contents";
|
|
144
|
-
grid-template-columns: 200px 640px 1fr;
|
|
145
|
-
grid-template-rows: auto 1fr auto;
|
|
146
|
-
}
|
|
147
|
-
}.r-blog-container {
|
|
148
|
-
min-height: calc(100dvh - var(--r-header-height));
|
|
149
|
-
overflow-wrap: break-word;
|
|
150
|
-
box-sizing: border-box;
|
|
151
|
-
}
|
|
152
|
-
@media screen and (width >= 1180px) {
|
|
153
|
-
.r-blog-container {
|
|
154
|
-
display: grid;
|
|
155
|
-
justify-content: space-between;
|
|
156
|
-
column-gap: 40px;
|
|
157
|
-
grid-template-areas: "breadcrumbs contents" "content contents" "pagination contents";
|
|
158
|
-
grid-template-columns: 760px 220px;
|
|
159
|
-
grid-template-rows: auto 1fr auto;
|
|
160
|
-
}
|
|
161
|
-
}.r-page-container {
|
|
162
|
-
min-height: calc(100dvh - var(--r-header-height));
|
|
163
|
-
overflow-wrap: break-word;
|
|
164
|
-
box-sizing: border-box;
|
|
165
|
-
}.keylink-to-content {
|
|
166
|
-
position: absolute !important;
|
|
167
|
-
top: 8px;
|
|
168
|
-
left: 12px;
|
|
169
|
-
z-index: 1001;
|
|
170
125
|
}.r-root {
|
|
171
126
|
--r-header-height: 60px;
|
|
172
127
|
position: relative;
|
|
@@ -400,8 +355,105 @@
|
|
|
400
355
|
--r-cl-60: #86181d;
|
|
401
356
|
--r-cl-61: #144620;
|
|
402
357
|
--r-cl-62: #c24e00;
|
|
358
|
+
}.r-docs-container {
|
|
359
|
+
min-height: calc(100dvh - var(--r-header-height));
|
|
360
|
+
overflow-wrap: break-word;
|
|
361
|
+
box-sizing: border-box;
|
|
362
|
+
}
|
|
363
|
+
@media screen and (width >= 768px) {
|
|
364
|
+
.r-docs-container {
|
|
365
|
+
display: grid;
|
|
366
|
+
justify-content: center;
|
|
367
|
+
column-gap: 32px;
|
|
368
|
+
grid-template-areas: "sidebar breadcrumbs" "sidebar contents" "sidebar content" "sidebar pagination";
|
|
369
|
+
grid-template-columns: 1fr calc(100% - 248px);
|
|
370
|
+
grid-template-rows: auto auto 1fr auto;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
@media screen and (width >= 1180px) {
|
|
374
|
+
.r-docs-container {
|
|
375
|
+
column-gap: 40px;
|
|
376
|
+
grid-template-areas: "sidebar breadcrumbs contents" "sidebar content contents" "sidebar pagination contents";
|
|
377
|
+
grid-template-columns: 200px 640px 1fr;
|
|
378
|
+
grid-template-rows: auto 1fr auto;
|
|
379
|
+
}
|
|
380
|
+
}.r-blog-container {
|
|
381
|
+
min-height: calc(100dvh - var(--r-header-height));
|
|
382
|
+
overflow-wrap: break-word;
|
|
383
|
+
box-sizing: border-box;
|
|
384
|
+
}
|
|
385
|
+
@media screen and (width >= 1180px) {
|
|
386
|
+
.r-blog-container {
|
|
387
|
+
display: grid;
|
|
388
|
+
justify-content: space-between;
|
|
389
|
+
column-gap: 40px;
|
|
390
|
+
grid-template-areas: "breadcrumbs contents" "content contents" "pagination contents";
|
|
391
|
+
grid-template-columns: 760px 220px;
|
|
392
|
+
grid-template-rows: auto 1fr auto;
|
|
393
|
+
}
|
|
394
|
+
}.r-page-container {
|
|
395
|
+
min-height: calc(100dvh - var(--r-header-height));
|
|
396
|
+
overflow-wrap: break-word;
|
|
397
|
+
box-sizing: border-box;
|
|
398
|
+
}.keylink-to-content {
|
|
399
|
+
position: absolute !important;
|
|
400
|
+
top: 8px;
|
|
401
|
+
left: 12px;
|
|
402
|
+
z-index: 1001;
|
|
403
403
|
}.r-keylink.keylink-to-navigation:focus {
|
|
404
404
|
margin-top: -40px;
|
|
405
|
+
}.r-article {
|
|
406
|
+
padding: 20px 0 40px;
|
|
407
|
+
grid-area: content;
|
|
408
|
+
}
|
|
409
|
+
@media screen and (width >= 1180px) {
|
|
410
|
+
.r-article {
|
|
411
|
+
padding: 32px 0 40px;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
.r-article > *:first-child {
|
|
415
|
+
margin-top: 0;
|
|
416
|
+
}
|
|
417
|
+
.r-article > *:last-child {
|
|
418
|
+
margin-bottom: 0;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
.r-checkbox {
|
|
422
|
+
cursor: pointer;
|
|
423
|
+
width: 20px;
|
|
424
|
+
height: 20px;
|
|
425
|
+
margin: 4px;
|
|
426
|
+
vertical-align: middle;
|
|
427
|
+
box-sizing: border-box;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
.r-label {
|
|
431
|
+
cursor: pointer;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
.r-task-ol,
|
|
435
|
+
.r-task-ul {
|
|
436
|
+
list-style: none;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
.r-task-label {
|
|
440
|
+
display: block;
|
|
441
|
+
width: 100%;
|
|
442
|
+
padding-top: 2px;
|
|
443
|
+
padding-bottom: 2px;
|
|
444
|
+
box-sizing: border-box;
|
|
445
|
+
}
|
|
446
|
+
.r-task-label:hover .r-checkbox {
|
|
447
|
+
filter: brightness(0.8);
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
.r-task-li.r-task-li {
|
|
451
|
+
margin-block-start: 2px;
|
|
452
|
+
margin-block-end: 2px;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
.r-label-text {
|
|
456
|
+
vertical-align: middle;
|
|
405
457
|
}.r-sidebar {
|
|
406
458
|
grid-area: sidebar;
|
|
407
459
|
box-sizing: border-box;
|
|
@@ -674,58 +726,6 @@
|
|
|
674
726
|
|
|
675
727
|
.r-sidebar-drop[open] > .r-sidebar-drop-btn > .r-sidebar-drop-icon {
|
|
676
728
|
transform: rotate(90deg);
|
|
677
|
-
}.r-article {
|
|
678
|
-
padding: 20px 0 40px;
|
|
679
|
-
grid-area: content;
|
|
680
|
-
}
|
|
681
|
-
@media screen and (width >= 1180px) {
|
|
682
|
-
.r-article {
|
|
683
|
-
padding: 32px 0 40px;
|
|
684
|
-
}
|
|
685
|
-
}
|
|
686
|
-
.r-article > *:first-child {
|
|
687
|
-
margin-top: 0;
|
|
688
|
-
}
|
|
689
|
-
.r-article > *:last-child {
|
|
690
|
-
margin-bottom: 0;
|
|
691
|
-
}
|
|
692
|
-
|
|
693
|
-
.r-checkbox {
|
|
694
|
-
cursor: pointer;
|
|
695
|
-
width: 20px;
|
|
696
|
-
height: 20px;
|
|
697
|
-
margin: 4px;
|
|
698
|
-
vertical-align: middle;
|
|
699
|
-
box-sizing: border-box;
|
|
700
|
-
}
|
|
701
|
-
|
|
702
|
-
.r-label {
|
|
703
|
-
cursor: pointer;
|
|
704
|
-
}
|
|
705
|
-
|
|
706
|
-
.r-task-ol,
|
|
707
|
-
.r-task-ul {
|
|
708
|
-
list-style: none;
|
|
709
|
-
}
|
|
710
|
-
|
|
711
|
-
.r-task-label {
|
|
712
|
-
display: block;
|
|
713
|
-
width: 100%;
|
|
714
|
-
padding-top: 2px;
|
|
715
|
-
padding-bottom: 2px;
|
|
716
|
-
box-sizing: border-box;
|
|
717
|
-
}
|
|
718
|
-
.r-task-label:hover .r-checkbox {
|
|
719
|
-
filter: brightness(0.8);
|
|
720
|
-
}
|
|
721
|
-
|
|
722
|
-
.r-task-li.r-task-li {
|
|
723
|
-
margin-block-start: 2px;
|
|
724
|
-
margin-block-end: 2px;
|
|
725
|
-
}
|
|
726
|
-
|
|
727
|
-
.r-label-text {
|
|
728
|
-
vertical-align: middle;
|
|
729
729
|
}.r-header-menu {
|
|
730
730
|
display: flex;
|
|
731
731
|
justify-content: flex-end;
|
|
@@ -997,6 +997,13 @@
|
|
|
997
997
|
font-size: 14px;
|
|
998
998
|
color: var(--r-main-600);
|
|
999
999
|
margin: 12px 0 0;
|
|
1000
|
+
}.r-container {
|
|
1001
|
+
max-width: 1180px;
|
|
1002
|
+
padding-right: 12px;
|
|
1003
|
+
padding-left: 12px;
|
|
1004
|
+
margin-right: auto;
|
|
1005
|
+
margin-left: auto;
|
|
1006
|
+
box-sizing: border-box;
|
|
1000
1007
|
}.r-dropdown {
|
|
1001
1008
|
position: relative;
|
|
1002
1009
|
color: var(--r-main-600);
|
|
@@ -1094,13 +1101,6 @@
|
|
|
1094
1101
|
}
|
|
1095
1102
|
.r-header-social-git:hover, .r-header-social-git:focus {
|
|
1096
1103
|
color: var(--r-main-950);
|
|
1097
|
-
}.r-container {
|
|
1098
|
-
max-width: 1180px;
|
|
1099
|
-
padding-right: 12px;
|
|
1100
|
-
padding-left: 12px;
|
|
1101
|
-
margin-right: auto;
|
|
1102
|
-
margin-left: auto;
|
|
1103
|
-
box-sizing: border-box;
|
|
1104
1104
|
}.r-theme-switcher {
|
|
1105
1105
|
position: relative;
|
|
1106
1106
|
display: flex;
|
|
@@ -1187,6 +1187,47 @@
|
|
|
1187
1187
|
user-select: none;
|
|
1188
1188
|
pointer-events: none;
|
|
1189
1189
|
box-sizing: border-box;
|
|
1190
|
+
}.r-breadcrumbs {
|
|
1191
|
+
grid-area: breadcrumbs;
|
|
1192
|
+
list-style: none;
|
|
1193
|
+
margin: 0;
|
|
1194
|
+
padding: 20px 0 0;
|
|
1195
|
+
line-height: 2;
|
|
1196
|
+
}
|
|
1197
|
+
@media screen and (width >= 768px) {
|
|
1198
|
+
.r-breadcrumbs {
|
|
1199
|
+
padding: 32px 0 0;
|
|
1200
|
+
}
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
.r-breadcrumb {
|
|
1204
|
+
display: inline;
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1207
|
+
.r-breadcrumb._previous::after {
|
|
1208
|
+
content: "/";
|
|
1209
|
+
font-weight: 600;
|
|
1210
|
+
margin-inline: 8px;
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
.r-breadcrumb-link {
|
|
1214
|
+
color: var(--r-main-700);
|
|
1215
|
+
text-decoration: none;
|
|
1216
|
+
}
|
|
1217
|
+
.r-breadcrumb-link:hover {
|
|
1218
|
+
color: var(--r-primary-800);
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
.r-breadcrumb-link,
|
|
1222
|
+
.r-breadcrumb-title {
|
|
1223
|
+
display: inline;
|
|
1224
|
+
padding: 6px 0;
|
|
1225
|
+
margin: 0;
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
.r-breadcrumb-title {
|
|
1229
|
+
color: var(--r-main-950);
|
|
1230
|
+
font-weight: 600;
|
|
1190
1231
|
}.r-contents {
|
|
1191
1232
|
grid-area: contents;
|
|
1192
1233
|
}
|
|
@@ -1420,47 +1461,6 @@
|
|
|
1420
1461
|
}
|
|
1421
1462
|
.r-contents-git:hover {
|
|
1422
1463
|
color: var(--r-main-900);
|
|
1423
|
-
}.r-breadcrumbs {
|
|
1424
|
-
grid-area: breadcrumbs;
|
|
1425
|
-
list-style: none;
|
|
1426
|
-
margin: 0;
|
|
1427
|
-
padding: 20px 0 0;
|
|
1428
|
-
line-height: 2;
|
|
1429
|
-
}
|
|
1430
|
-
@media screen and (width >= 768px) {
|
|
1431
|
-
.r-breadcrumbs {
|
|
1432
|
-
padding: 32px 0 0;
|
|
1433
|
-
}
|
|
1434
|
-
}
|
|
1435
|
-
|
|
1436
|
-
.r-breadcrumb {
|
|
1437
|
-
display: inline;
|
|
1438
|
-
}
|
|
1439
|
-
|
|
1440
|
-
.r-breadcrumb._previous::after {
|
|
1441
|
-
content: "/";
|
|
1442
|
-
font-weight: 600;
|
|
1443
|
-
margin-inline: 8px;
|
|
1444
|
-
}
|
|
1445
|
-
|
|
1446
|
-
.r-breadcrumb-link {
|
|
1447
|
-
color: var(--r-main-700);
|
|
1448
|
-
text-decoration: none;
|
|
1449
|
-
}
|
|
1450
|
-
.r-breadcrumb-link:hover {
|
|
1451
|
-
color: var(--r-primary-800);
|
|
1452
|
-
}
|
|
1453
|
-
|
|
1454
|
-
.r-breadcrumb-link,
|
|
1455
|
-
.r-breadcrumb-title {
|
|
1456
|
-
display: inline;
|
|
1457
|
-
padding: 6px 0;
|
|
1458
|
-
margin: 0;
|
|
1459
|
-
}
|
|
1460
|
-
|
|
1461
|
-
.r-breadcrumb-title {
|
|
1462
|
-
color: var(--r-main-950);
|
|
1463
|
-
font-weight: 600;
|
|
1464
1464
|
}.r-pagination {
|
|
1465
1465
|
grid-area: pagination;
|
|
1466
1466
|
display: grid;
|
|
@@ -1719,6 +1719,20 @@
|
|
|
1719
1719
|
}
|
|
1720
1720
|
.r-blockquote-caution .r-blockquote-title {
|
|
1721
1721
|
color: var(--r-caution);
|
|
1722
|
+
}.r-code-span {
|
|
1723
|
+
font-family: var(--monospace-font, monospace, monospace);
|
|
1724
|
+
background-color: var(--r-main-100);
|
|
1725
|
+
border: 1px solid var(--r-main-200);
|
|
1726
|
+
color: var(--r-main-950);
|
|
1727
|
+
border-radius: 4px;
|
|
1728
|
+
padding: 2px 6px;
|
|
1729
|
+
font-size: inherit;
|
|
1730
|
+
font-weight: 500;
|
|
1731
|
+
letter-spacing: 0.5px;
|
|
1732
|
+
}
|
|
1733
|
+
|
|
1734
|
+
.r-code-span + .r-content-link-external {
|
|
1735
|
+
margin-left: -12px;
|
|
1722
1736
|
}.r-code-block {
|
|
1723
1737
|
font-family: var(--monospace-font, monospace, monospace);
|
|
1724
1738
|
font-size: 16px;
|
|
@@ -1732,6 +1746,9 @@
|
|
|
1732
1746
|
scrollbar-width: thin;
|
|
1733
1747
|
scrollbar-color: var(--r-main-200) transparent;
|
|
1734
1748
|
box-sizing: border-box;
|
|
1749
|
+
}.r-img {
|
|
1750
|
+
max-width: 100%;
|
|
1751
|
+
box-sizing: border-box;
|
|
1735
1752
|
}.r-h1 {
|
|
1736
1753
|
font-size: 32px;
|
|
1737
1754
|
line-height: 1.4;
|
|
@@ -1772,23 +1789,6 @@
|
|
|
1772
1789
|
line-height: 1.4;
|
|
1773
1790
|
margin-block-start: 1.8em;
|
|
1774
1791
|
margin-block-end: 1.8em;
|
|
1775
|
-
}.r-code-span {
|
|
1776
|
-
font-family: var(--monospace-font, monospace, monospace);
|
|
1777
|
-
background-color: var(--r-main-100);
|
|
1778
|
-
border: 1px solid var(--r-main-200);
|
|
1779
|
-
color: var(--r-main-950);
|
|
1780
|
-
border-radius: 4px;
|
|
1781
|
-
padding: 2px 6px;
|
|
1782
|
-
font-size: inherit;
|
|
1783
|
-
font-weight: 500;
|
|
1784
|
-
letter-spacing: 0.5px;
|
|
1785
|
-
}
|
|
1786
|
-
|
|
1787
|
-
.r-code-span + .r-content-link-external {
|
|
1788
|
-
margin-left: -12px;
|
|
1789
|
-
}.r-img {
|
|
1790
|
-
max-width: 100%;
|
|
1791
|
-
box-sizing: border-box;
|
|
1792
1792
|
}.r-p {
|
|
1793
1793
|
line-height: 1.8;
|
|
1794
1794
|
margin-block-start: 1em;
|
|
@@ -1893,34 +1893,6 @@
|
|
|
1893
1893
|
|
|
1894
1894
|
.r-copy-button-svg {
|
|
1895
1895
|
display: block;
|
|
1896
|
-
}.r-copy-text {
|
|
1897
|
-
position: relative;
|
|
1898
|
-
cursor: pointer;
|
|
1899
|
-
background: none;
|
|
1900
|
-
border: 0;
|
|
1901
|
-
padding: 0;
|
|
1902
|
-
font: inherit;
|
|
1903
|
-
padding: 6px 0;
|
|
1904
|
-
}
|
|
1905
|
-
.r-copy-text:hover {
|
|
1906
|
-
color: var(--r-main-950);
|
|
1907
|
-
}
|
|
1908
|
-
.r-copy-text::before {
|
|
1909
|
-
content: "";
|
|
1910
|
-
position: absolute;
|
|
1911
|
-
bottom: 0;
|
|
1912
|
-
left: 0;
|
|
1913
|
-
width: 100%;
|
|
1914
|
-
height: 1px;
|
|
1915
|
-
background: linear-gradient(to right, currentColor 30%, transparent 0%, transparent 80%, currentColor 80%) repeat-x 0px/8px;
|
|
1916
|
-
transition: background 0.2s;
|
|
1917
|
-
box-sizing: border-box;
|
|
1918
|
-
opacity: 0.6;
|
|
1919
|
-
}
|
|
1920
|
-
|
|
1921
|
-
.r-copy-text:active,
|
|
1922
|
-
.r-copy-text._active {
|
|
1923
|
-
color: var(--r-success);
|
|
1924
1896
|
}.r-content-link {
|
|
1925
1897
|
text-decoration: none;
|
|
1926
1898
|
color: inherit;
|
|
@@ -1970,6 +1942,34 @@
|
|
|
1970
1942
|
background-color: currentColor;
|
|
1971
1943
|
border-radius: 0 0 0 4px;
|
|
1972
1944
|
box-sizing: border-box;
|
|
1945
|
+
}.r-copy-text {
|
|
1946
|
+
position: relative;
|
|
1947
|
+
cursor: pointer;
|
|
1948
|
+
background: none;
|
|
1949
|
+
border: 0;
|
|
1950
|
+
padding: 0;
|
|
1951
|
+
font: inherit;
|
|
1952
|
+
padding: 6px 0;
|
|
1953
|
+
}
|
|
1954
|
+
.r-copy-text:hover {
|
|
1955
|
+
color: var(--r-main-950);
|
|
1956
|
+
}
|
|
1957
|
+
.r-copy-text::before {
|
|
1958
|
+
content: "";
|
|
1959
|
+
position: absolute;
|
|
1960
|
+
bottom: 0;
|
|
1961
|
+
left: 0;
|
|
1962
|
+
width: 100%;
|
|
1963
|
+
height: 1px;
|
|
1964
|
+
background: linear-gradient(to right, currentColor 30%, transparent 0%, transparent 80%, currentColor 80%) repeat-x 0px/8px;
|
|
1965
|
+
transition: background 0.2s;
|
|
1966
|
+
box-sizing: border-box;
|
|
1967
|
+
opacity: 0.6;
|
|
1968
|
+
}
|
|
1969
|
+
|
|
1970
|
+
.r-copy-text:active,
|
|
1971
|
+
.r-copy-text._active {
|
|
1972
|
+
color: var(--r-success);
|
|
1973
1973
|
}.r-li {
|
|
1974
1974
|
line-height: 1.8;
|
|
1975
1975
|
margin-block-start: 6px;
|
|
@@ -1981,11 +1981,11 @@
|
|
|
1981
1981
|
padding-inline-start: 20px;
|
|
1982
1982
|
margin-block-start: 6px;
|
|
1983
1983
|
margin-block-end: 6px;
|
|
1984
|
-
}.r-
|
|
1984
|
+
}.r-ul {
|
|
1985
1985
|
padding-inline-start: 2rem;
|
|
1986
1986
|
margin-block-start: 1em;
|
|
1987
1987
|
margin-block-end: 1em;
|
|
1988
|
-
}.r-
|
|
1988
|
+
}.r-ol {
|
|
1989
1989
|
padding-inline-start: 2rem;
|
|
1990
1990
|
margin-block-start: 1em;
|
|
1991
1991
|
margin-block-end: 1em;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "robindoc",
|
|
3
|
-
"version": "0.0.0-experimental-
|
|
3
|
+
"version": "0.0.0-experimental-5d28895",
|
|
4
4
|
"description": "Robindoc is a framework for automatically creating documentation websites based on markdown files, built on React.js Server Components",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"scripts": {
|