@stacksjs/bunpress 0.2.34 → 0.2.36
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/bin/cli.js +1 -1
- package/dist/chunk-2ak6pzvc.js +2 -0
- package/dist/{chunk-19em34hd.js → chunk-7xnbwx77.js} +1 -1
- package/dist/chunk-94yk2vs9.js +38 -0
- package/dist/{chunk-nfaqt4jb.js → chunk-967sb9pd.js} +6 -6
- package/dist/{chunk-zxfhq634.js → chunk-9g247fj7.js} +2 -2
- package/dist/{chunk-nv4f6b5n.js → chunk-af54cmqz.js} +1 -1
- package/dist/{chunk-gvc75334.js → chunk-e93ycakx.js} +5660 -7473
- package/dist/{chunk-dgdd6yma.js → chunk-kw0tya77.js} +2 -2
- package/dist/src/doc-trail.d.ts +37 -0
- package/dist/src/index.js +1 -1
- package/dist/src/serve.d.ts +12 -0
- package/dist/src/themes/bun/index.d.ts +6 -16
- package/package.json +1 -1
- package/dist/chunk-epvd70ef.js +0 -2
- package/dist/chunk-twt99rzk.js +0 -38
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{ja as $0,ka as J0,na as C,oa as K0}from"./chunk-94yk2vs9.js";import{loadConfig as B0}from"bunfig";var M0={docsDir:"./docs",outDir:"./dist",theme:"vitepress",nav:[{text:"Guide",link:"/install"},{text:"API",link:"/advanced#api-reference"},{text:"Examples",link:"/examples"}],plugins:[],markdown:{title:"BunPress Documentation",meta:{description:"Documentation built with BunPress",generator:"BunPress",viewport:"width=device-width, initial-scale=1.0"},sidebar:{"/":[{text:"Getting Started",items:[{text:"Introduction",link:"/"},{text:"Installation",link:"/install"},{text:"Quick Start",link:"/quick-start"},{text:"Usage",link:"/usage"},{text:"Configuration",link:"/config"}]},{text:"Core Features",items:[{text:"Features Overview",link:"/features"},{text:"Markdown Extensions",link:"/markdown-extensions"},{text:"Syntax Highlighting",link:"/syntax-highlighting"},{text:"Table of Contents",link:"/table-of-contents"},{text:"CLI Commands",link:"/cli"}]},{text:"SEO & Analytics",items:[{text:"SEO Features",link:"/seo"},{text:"Analytics (Fathom)",link:"/config#fathom-analytics-configuration"}]},{text:"Advanced",items:[{text:"Advanced Usage",link:"/advanced"},{text:"Examples",link:"/examples"},{text:"Best Practices",link:"/best-practices"}]},{text:"More",items:[{text:"Showcase",link:"/showcase"},{text:"Partners",link:"/partners"},{text:"License",link:"/license"},{text:"Postcardware",link:"/postcardware"}]}]},css:`
|
|
3
3
|
/* Additional BunPress customizations */
|
|
4
4
|
/* Note: Base styles are provided by the VitePress theme */
|
|
5
5
|
|
|
@@ -1754,4 +1754,4 @@ else {
|
|
|
1754
1754
|
`}var{Glob:t,YAML:p0}=globalThis.Bun;import{join as g0}from"path";var F1="/search-index.json",A={include:["**/*.md"],exclude:["public/**","**/node_modules/**"],searchFields:["title","content","headings","keywords"],maxResults:10,minQueryLength:1,fuzzy:!1,fuzziness:1,stemmer:"none",maxContentLength:800,boost:{title:10,headings:5,content:1}};function V0(Z){let Q=Z?.options??{};return{...A,...Q,include:Q.include??A.include,exclude:Q.exclude??A.exclude,searchFields:Q.searchFields??A.searchFields,maxResults:Q.maxResults??Z?.maxResults??A.maxResults,boost:{...A.boost,...Q.boost??{}}}}var e=[{key:"k",meta:!0,ctrl:!1,alt:!1,shift:!1},{key:"k",meta:!1,ctrl:!0,alt:!1,shift:!1},{key:"/",meta:!1,ctrl:!1,alt:!1,shift:!1}];function h0(Z){if(!Z)return e;let Q=(Array.isArray(Z)?Z:[Z]).map((J)=>String(J).toLowerCase()),X={meta:!1,ctrl:!1,alt:!1,shift:!1},$="";for(let J of Q)if(J==="meta"||J==="cmd"||J==="command")X.meta=!0;else if(J==="ctrl"||J==="control")X.ctrl=!0;else if(J==="alt"||J==="option")X.alt=!0;else if(J==="shift")X.shift=!0;else $=J;if(!$)return e;return[{key:$,...X}]}function Q0(Z){if(typeof Z!=="function")return null;let Q=Function.prototype.toString.call(Z);return Q.includes("[native code]")?null:Q}function R1(Z,Q){let X=Z?.search??Z?.markdown?.search,$=V0(X),J=X?.resultOptions??{};return{indexUrl:Q,placeholder:X?.placeholder??"Search documentation",lazy:X?.lazy!==!1,maxResults:$.maxResults,minQueryLength:$.minQueryLength,searchFields:$.searchFields,boost:{title:$.boost.title??10,headings:$.boost.headings??5,content:$.boost.content??1},fuzzy:$.fuzzy,fuzziness:$.fuzziness,stemmer:$.stemmer,shortcuts:{keyboard:X?.keyboardShortcuts!==!1,keys:h0(X?.shortcut)},result:{showDescription:J.showDescription!==!1,descriptionLength:J.descriptionLength??180,highlightMatches:J.highlightMatches!==!1,showPath:J.showPath!==!1},tokenizeSource:Q0(X?.options?.tokenize),onSearchSource:Q0(X?.onSearch),locale:null}}function X0(Z){return p(i(Z)).replace(/^:::.*$/gm," ").replace(/^\s{0,3}>\s*\[!(?:NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*$/gim," ").replace(/<[^>]+>/g," ").replace(/!\[[^\]]*\]\([^)]*\)/g," ").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/[*_~]{1,3}([^*_~]+)[*_~]{1,3}/g,"$1").replace(/^\s{0,3}>\s?/gm,"").replace(/^\s*[-*+]\s+/gm,"").replace(/^\s*\d+\.\s+/gm,"").replace(/^\s*\|?[\s:|-]+\|[\s:|-]*$/gm," ").replace(/^\s{0,3}(?:-{3,}|\*{3,}|_{3,})\s*$/gm," ").replace(/\|/g," ").replace(/\s+/g," ").trim()}function d0(Z){let Q=Z.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/);if(!Q)return{body:Z,data:{}};let X={};try{X=p0.parse(Q[1])??{}}catch{X={}}return{body:Z.slice(Q[0].length),data:X}}function c0(Z){let Q=Z.replace(/\.md$/,"");if(Q==="index")return"/";if(Q.endsWith("/index"))return`/${Q.slice(0,-6)}`;return`/${Q}`}function l0(Z,Q,X){let{body:$,data:J}=d0(Q);if(J.search===!1)return[];if(J.layout==="home")return[];let V=typeof J.search==="object"&&J.search!==null?J.search:{},W=Array.isArray(V.keywords)?V.keywords.map(String):[],Y=c0(Z),q=$.split(`
|
|
1755
1755
|
`),K=$.match(/^#\s+(.+)$/m),j=V.title||J.title||(K?K[1].trim():Y),B=[],G=new Set,z={title:j,anchor:"",level:1,buffer:[]},N=()=>{let M=X0(z.buffer.join(`
|
|
1756
1756
|
`)).slice(0,X.maxContentLength);if(!M&&!z.title)return;let U={url:z.anchor?`${Y}#${z.anchor}`:Y,page:j,title:X0(z.title)||j,text:M,level:z.level};if(W.length)U.keywords=W;B.push(U)},I=y();for(let M of q){let U=I(M)?null:M.match(/^(#{1,6})\s+(.+?)\s*$/);if(!U){z.buffer.push(M);continue}let L=U[1].length,H=U[2].replace(/\s*\{#([\w-]+)\}\s*$/,""),R=U[2].match(/\{#([\w-]+)\}\s*$/),D=v(R?R[1]:b(T(H)),G);if(L===1){z.buffer.push("");continue}N(),z={title:H,anchor:D,level:L,buffer:[]}}return N(),B.filter((M)=>M.text||M.level>1)}function s0(Z,Q){let{storeFields:X}=Q;if(!X||!X.length)return Z;let $=new Set(["url",...X]);if(Q.searchFields.includes("title"))$.add("title");if(Q.searchFields.includes("content"))$.add("text");if(Q.searchFields.includes("headings"))$.add("page");if(Q.searchFields.includes("keywords"))$.add("keywords");return Z.map((J)=>{let V={};for(let[W,Y]of Object.entries(J))if($.has(W)&&Y!==void 0)V[W]=Y;return V})}function Z0(Z){return Z.split("#")[0]}function r0(Z,Q){if(!Q.enabled)return{locale:Q.defaultLocale,page:Z};let X=Z.split("/");if(X.length>1&&Q.locales.includes(X[0])&&X[0]!==Q.defaultLocale)return{locale:X[0],page:X.slice(1).join("/")};let $=Z.match(/^(.*)\.([A-Za-z-]+)(\.md)$/);if($&&Q.locales.includes($[2]))return{locale:$[2],page:`${$[1]}${$[3]}`};return{locale:Q.defaultLocale,page:Z}}async function D1(Z,Q){let X=Q?.search??Q?.markdown?.search,$=V0(X),J=J0(Q),V=$.exclude.map((j)=>new t(j)),W=[],Y=new Set,q=new Map;for(let j of J.locales)q.set(j,new Set);for(let j of $.include){let B=new t(j);for await(let G of B.scan(Z)){let z=G.replace(/\\/g,"/");if(V.some((N)=>N.match(z)))continue;Y.add(z)}}for(let j of[...Y].sort())try{let B=await Bun.file(g0(Z,j)).text(),{locale:G,page:z}=r0(j,J);for(let N of l0(z,B,$)){if(J.enabled)N.locale=G,N.url=C(J,G,N.url);W.push(N),q.get(G)?.add(Z0(N.url))}}catch{}if(J.enabled){let j=W.filter((B)=>B.locale===J.defaultLocale);for(let B of J.locales){if(B===J.defaultLocale)continue;let G=q.get(B)??new Set;for(let z of j){let N=C(J,B,z.url);if(G.has(Z0(N)))continue;W.push({...z,url:N,locale:B})}}}let K=Q?$0(Q):"";if(K)for(let j of W)j.url=`${K}${j.url}`;return s0(W,$)}function W0(Z){let Q={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:"\xA0"};return Z.replace(/&(#x[\da-f]+|#\d+|[a-z]+);/gi,(X,$)=>{if($[0]==="#"){let J=$[1]==="x"||$[1]==="X"?Number.parseInt($.slice(2),16):Number.parseInt($.slice(1),10);return Number.isFinite(J)&&J>0&&J<=1114111?String.fromCodePoint(J):X}return Q[$.toLowerCase()]??X})}function Y0(Z){return String(Z??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}var{Glob:o0}=globalThis.Bun;import{dirname as i0,isAbsolute as q0,join as n0,relative as z0,resolve as E,sep as j0}from"path";async function y1(Z){let Q=[];for await(let X of new o0("**/*.md").scan({cwd:Z,onlyFiles:!0}))Q.push(n0(Z,X));return Q}function G0(Z){return Z.split("/").map((Q)=>encodeURIComponent(Q)).join("/")}function x(Z){let Q=Z==="index"?"":Z.replace(/\/index$/,"/");return`/${G0(Q)}`}function k(Z){return Z.split("/").map((X)=>encodeURIComponent(decodeURIComponent(X))).join("/").replace(/\/+$/,"")||"/"}function S1(Z,Q,X){let $=E(Q),J={...X,locales:[...X.locales]},V=new Set(Z.map((G)=>E(G))),W=new Map,Y=new Set;for(let G of V){let z=z0($,G).split(j0).join("/").replace(/\.md$/,"");if(z===".."||z.startsWith("../")||q0(z))throw Error("Markdown source is outside the documentation root");let N=J.defaultLocale,I=!1;if(J.enabled){let M=z.split("/");if(M.length>1&&J.locales.includes(M[0])&&M[0]!==J.defaultLocale)N=M.shift(),I=!0,z=M.join("/");else{let U=z.match(/^(.*)\.([A-Za-z-]+)$/);if(U&&J.locales.includes(U[2]))z=U[1],N=U[2],I=!0}}W.set(G,{path:z,locale:N,explicitLocale:I}),Y.add(z)}let q=[],K=new Map,j=new Map,B=new Map;for(let G of J.locales)for(let z of Y){let N=J.enabled?K0(J,$,G,`/${z}`).map((U)=>E(U)).find((U)=>V.has(U)):E($,`${z}.md`);if(!N||!V.has(N))continue;let I=Object.freeze({sourceFile:N,relativePath:z,locale:G}),M=`${G}\x00${k(x(z))}`;if(j.has(M))throw Error(`Documentation pages share an output route: ${x(z)}`);j.set(M,I),K.set(`${G}\x00${z}`,I),B.set(`${G}\x00${k(`/${G0(z)}`)}`,I),q.push(I)}return Object.freeze({pages:Object.freeze(q),findPage(G,z){let N=`${G}\x00${k(z)}`;return j.get(N)??B.get(N)},resolveLink(G,z){if(!z||/^(?:[a-z][a-z\d+.-]*:|\/|#|\?)/i.test(z))return z;let N=z.search(/[?#]/),I=N===-1?z:z.slice(0,N),M=N===-1?"":z.slice(N),U=I.replace(/%([\da-f]{2})/gi,(a0,N0)=>String.fromCharCode(Number.parseInt(N0,16)));if(!/\.md$/i.test(U))return z;let L=decodeURIComponent(I),H=E(i0(G.sourceFile),L),R=z0($,H);if(R===".."||R.startsWith(`..${j0}`)||q0(R))return z;let D=W.get(H);if(!D)throw Error(`Markdown link has no documentation source: ${I}`);let m=D.explicitLocale?D.locale:G.locale,f=K.get(`${m}\x00${D.path}`);if(!f)throw Error(`Markdown link has no rendered page: ${I}`);return`${C(J,m,x(f.relativePath))}${M}`}})}async function P1(Z,Q,X=new Map){let $=[Q.page],J=new Set(X.keys()),V=await new HTMLRewriter().onDocument({comments(W){let Y=X.get(W.text);if(Y===void 0)return;if(!J.delete(W.text))throw Error("Markdown include source boundary was duplicated");if(Y===null){if($.length===1)throw Error("Markdown include source boundaries are unbalanced");$.pop()}else $.push(Y);W.remove()}}).on("a[href]",{element(W){let Y=W0(W.getAttribute("href")),q=Q.catalog.resolveLink($[$.length-1],Y);if(q!==Y)W.setAttribute("href",Y0(q))}}).transform(new Response(Z)).text();if(J.size||$.length!==1)throw Error("Markdown include source boundaries did not survive rendering");return V}
|
|
1757
|
-
export{M0 as
|
|
1757
|
+
export{M0 as B,U0 as C,F0 as D,e0 as E,p as F,X1 as G,$1 as H,J1 as I,b0 as J,T as K,b as L,v as M,n as N,v0 as O,x0 as P,k0 as Q,P as R,a as S,m0 as T,f0 as U,u0 as V,W1 as W,Y1 as X,q1 as Y,z1 as Z,j1 as _,F1 as $,R1 as aa,D1 as ba,W0 as ca,Y0 as da,y1 as ea,S1 as fa,P1 as ga};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { BunPressConfig, SidebarItem } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* The sidebar sections drawn for a path. A path-keyed sidebar picks the
|
|
4
|
+
* longest key the path starts with, so `/guide/` wins over `/`.
|
|
5
|
+
*/
|
|
6
|
+
export declare function sidebarSectionsFor(config: BunPressConfig, currentPath: string): SidebarItem[];
|
|
7
|
+
/**
|
|
8
|
+
* The trail for `currentPath`. Pages that are not in the sidebar get an
|
|
9
|
+
* empty trail: there is no section to name and no order to walk.
|
|
10
|
+
*/
|
|
11
|
+
export declare function resolveDocTrail(sections: SidebarItem[], currentPath: string): DocTrail;
|
|
12
|
+
/**
|
|
13
|
+
* "Section › Page". The last entry is where the reader is, so it is marked
|
|
14
|
+
* as the current page for assistive technology as well as drawn in the
|
|
15
|
+
* accent colour.
|
|
16
|
+
*/
|
|
17
|
+
export declare function renderBreadcrumb(trail: DocTrail, ariaLabel?: string): string;
|
|
18
|
+
/** The previous and next pages, as two cards. Nothing when the page has neither. */
|
|
19
|
+
export declare function renderDocPager(trail: DocTrail, href: (link: string) => string, labels?: { prev: string, next: string, nav: string }): string;
|
|
20
|
+
/**
|
|
21
|
+
* Where a page sits in the sidebar: the trail of section and group titles
|
|
22
|
+
* above it, and the pages before and after it in reading order.
|
|
23
|
+
*
|
|
24
|
+
* Both come from the sidebar the reader is looking at, so they can never
|
|
25
|
+
* disagree with it: the breadcrumb names the section a page is filed under,
|
|
26
|
+
* and the pager walks the sidebar's links top to bottom.
|
|
27
|
+
*/
|
|
28
|
+
export declare interface TrailLink {
|
|
29
|
+
text: string
|
|
30
|
+
link: string
|
|
31
|
+
}
|
|
32
|
+
export declare interface DocTrail {
|
|
33
|
+
ancestors: string[]
|
|
34
|
+
current?: string
|
|
35
|
+
prev?: TrailLink
|
|
36
|
+
next?: TrailLink
|
|
37
|
+
}
|
package/dist/src/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{a as p,b as u,c as m,d as o,e as s,f as h,g as a,h as d,i as t,j as c,k as Oj,l as kj,m as Cj,n as Mj,o as Tj}from"../chunk-
|
|
2
|
+
import{a as p,b as u,c as m,d as o,e as s,f as h,g as a,h as d,i as t,j as c,k as Oj,l as kj,m as Cj,n as Mj,o as Tj,p as Rj}from"../chunk-e93ycakx.js";import{A as Y,w as S,x as V,y as W,z as X}from"../chunk-9g247fj7.js";import{$ as Z,B as x,C as v,D as g,E as f,J as Ej,K as Gj,L as Jj,M as Kj,N as Nj,O as Pj,P as Qj,Q as Sj,R as Vj,S as Wj,T as Xj,U as Yj,V as Zj,W as _j,X as $j,Y as Aj,Z as Fj,_ as Ij,aa as _,ba as $,ca as Lj}from"../chunk-kw0tya77.js";import{ja as i,ka as l,la as n,ma as r,na as e,oa as jj,pa as qj,qa as zj,ra as Bj,sa as Dj}from"../chunk-94yk2vs9.js";function D(E){return E.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function N(E,K=!1){let z=E.trim();if(!z||/[\u0000-\u0020\u007f-\u009f\\]/.test(z))return null;let G=/^([a-z][a-z\d+.-]*):/i.exec(z)?.[1]?.toLowerCase();if(/^[^/]*:/.test(z)&&(!G||!["http","https",...K?[]:["mailto"]].includes(G)))return null;return z}function F(E,K={}){let z=[],G=E.replace(/[\u0000-\u0002]/g,""),Q=(j)=>j.replace(/\u0001(\d+)\u0002/g,(q,B)=>z[Number(B)]??""),J=(j)=>D(Q(j));return Bun.markdown.render(G,{text:(j)=>`\x01${z.push(j)-1}\x02`,heading:(j,q)=>`<h${q.level} id="wiki-${D(q.id??"")}">${j}</h${q.level}>`,paragraph:(j)=>`<p>${j}</p>`,blockquote:(j)=>`<blockquote>${j}</blockquote>`,strong:(j)=>`<strong>${j}</strong>`,emphasis:(j)=>`<em>${j}</em>`,strikethrough:(j)=>`<del>${j}</del>`,hr:()=>"<hr>",codespan:(j)=>`<code>${J(j)}</code>`,code:(j,q)=>{return`<pre><code${q?.language&&/^[\w+#.-]{1,30}$/.test(q.language)?` class="language-${D(q.language)}"`:""}>${J(j)}</code></pre>`},list:(j,q)=>q.ordered?`<ol start="${q.start??1}">${j}</ol>`:`<ul>${j}</ul>`,listItem:(j,q)=>`<li>${typeof q.checked==="boolean"?`<input type="checkbox" disabled${q.checked?" checked":""}>`:""}${j}</li>`,table:(j)=>`<table>${j}</table>`,thead:(j)=>`<thead>${j}</thead>`,tbody:(j)=>`<tbody>${j}</tbody>`,tr:(j)=>`<tr>${j}</tr>`,th:(j)=>`<th>${j}</th>`,td:(j)=>`<td>${j}</td>`,link:(j,q)=>{let B=N(q.href);if(!B)return j;let P=N(K.resolveLink?.(B)??B);return P?`<a href="${D(P)}" rel="nofollow noopener noreferrer">${j}</a>`:j},image:(j,q)=>{let B=N(q.src,!0);return B?`<img src="${D(B)}" alt="${J(j)}" loading="lazy">`:J(j)},html:(j)=>j},{tables:!0,strikethrough:!0,tasklists:!0,autolinks:!0,headings:{ids:!0}}).replace(/\u0001(\d+)\u0002/g,(j,q)=>D(z[Number(q)]??""))}export{Cj as wrapInLayout,Oj as stripConfiguredBasePath,Tj as startServer,r as splitLocaleFromPath,u as setLanguageAliases,Rj as serveCLI,l as resolveI18nConfig,p as resetHighlighter,Kj as reserveUniqueSlug,F as renderUntrustedMarkdown,$j as processInlineTocSyntax,t as prewarmHighlighter,m as normalizeLanguage,Mj as markdownToHtml,Gj as markdownHeadingText,e as localizeUrl,zj as localeLabel,jj as localeContentCandidates,n as loadI18nTranslations,o as isLanguageSupported,h as highlightCodeSync,s as highlightCode,d as getSyntaxHighlightingStyles,c as getHighlighterInstance,i as getConfiguredBasePath,f as getConfig,Nj as generateUniqueSlug,Fj as generateTocStyles,Ij as generateTocScripts,_j as generateTocPositions,Vj as generateTocHtml,Zj as generateTocData,Jj as generateSlug,Y as generateSitemap,Xj as generateSidebarTocHtml,V as generateRssFeed,W as generateRobotsTxt,Dj as generateLocaleDetectionScript,Wj as generateInlineTocHtml,Bj as generateHreflangTags,Yj as generateFloatingTocHtml,Sj as filterHeadings,Pj as extractHeadings,Aj as enhanceHeadingsWithAnchors,Ej as defaultTocConfig,x as defaultConfig,Lj as decodeHtmlEntities,qj as configForLocale,g as config,Qj as buildTocHierarchy,X as buildSitemap,_ as buildSearchRuntimeConfig,$ as buildSearchIndex,S as buildRssFeed,v as applyConfigPlugins,Z as SEARCH_INDEX_PATH,a as LIGHT_TOKEN_PALETTE,kj as BUN_THEME_FONTS};
|
package/dist/src/serve.d.ts
CHANGED
|
@@ -30,6 +30,18 @@ export declare function serveCLI(options?: {
|
|
|
30
30
|
watch?: boolean
|
|
31
31
|
config?: BunPressConfig
|
|
32
32
|
}): Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* Build web-font markup from `config.fonts`: `<link>` tags (preconnect +
|
|
35
|
+
* Google Fonts stylesheet) for the document head, and raw `@font-face` CSS for
|
|
36
|
+
* self-hosted fonts. Returns empty strings when no fonts are configured.
|
|
37
|
+
*/
|
|
38
|
+
/**
|
|
39
|
+
* The faces the bun theme is drawn in: Archivo, condensed and heavy, for the
|
|
40
|
+
* headings, and Martian Mono for code and labels. Both are on Google Fonts
|
|
41
|
+
* with the width axes the theme asks for. A site that sets `fonts` itself
|
|
42
|
+
* keeps exactly what it set.
|
|
43
|
+
*/
|
|
44
|
+
export declare const BUN_THEME_FONTS: string[];
|
|
33
45
|
/** Which code-block extras are switched on, from `features.codeBlocks`. */
|
|
34
46
|
export declare interface CodeBlockFeatures {
|
|
35
47
|
lineHighlighting: boolean
|
|
@@ -1,26 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Get all Bun theme CSS combined
|
|
2
|
+
* Get all Bun theme CSS combined: the default theme, then the Bun layer.
|
|
3
3
|
*/
|
|
4
4
|
export declare function getBunThemeCSS(): string;
|
|
5
|
-
/**
|
|
6
|
-
* Get Bun theme CSS variables only
|
|
7
|
-
*/
|
|
5
|
+
/** The Bun palette and tokens only. */
|
|
8
6
|
export declare function getBunVars(): string;
|
|
9
|
-
/**
|
|
10
|
-
* Get Bun base styles only
|
|
11
|
-
*/
|
|
7
|
+
/** The Bun chrome and prose layer, without the default theme under it. */
|
|
12
8
|
export declare function getBunBase(): string;
|
|
13
|
-
/**
|
|
14
|
-
* Get Bun custom block styles only
|
|
15
|
-
*/
|
|
9
|
+
/** The Bun callout styles only. */
|
|
16
10
|
export declare function getBunCustomBlocks(): string;
|
|
17
|
-
/**
|
|
18
|
-
* Get Bun code group styles only
|
|
19
|
-
*/
|
|
11
|
+
/** The Bun code block, code group and syntax styles only. */
|
|
20
12
|
export declare function getBunCodeGroups(): string;
|
|
21
|
-
/**
|
|
22
|
-
* Get Bun extra styles only
|
|
23
|
-
*/
|
|
13
|
+
/** The Bun home page styles only. */
|
|
24
14
|
export declare function getBunExtras(): string;
|
|
25
15
|
declare const bunTheme: BunTheme;
|
|
26
16
|
export declare interface BunTheme {
|
package/package.json
CHANGED
package/dist/chunk-epvd70ef.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{k as c,l as d,m as e,n as f,o as g}from"./chunk-gvc75334.js";import{ba as b}from"./chunk-dgdd6yma.js";import{ia as a}from"./chunk-twt99rzk.js";export{d as wrapInLayout,c as stripConfiguredBasePath,f as startServer,g as serveCLI,e as markdownToHtml,a as getConfiguredBasePath,b as decodeHtmlEntities};
|
package/dist/chunk-twt99rzk.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
var Y=import.meta.require;function Q(q){return(q.sitemap?.baseUrl||q.url||"").replace(/\/$/,"")}function j(q){if(q.basePath){let B=q.basePath.trim().replace(/\/+$/,"");if(!B||B==="/")return"";return B.startsWith("/")?B:`/${B}`}let G=Q(q);if(!G)return"";try{let B=new URL(G).pathname.replace(/\/+$/,"");return B==="/"?"":B}catch{return""}}var V={"search.placeholder":"Search documentation","toc.title":"On this page","nav.menu":"Menu","search.noResults":"No results for","theme.toggle":"Toggle dark mode"};function A(q){let G=q?.i18n,B=(G?.locales??[]).filter(Boolean),H=G?.defaultLocale||B[0]||q?.lang||"en",J=(G?.enabled??B.length>1)&&B.length>0;return{enabled:J,locales:J?B:[H],defaultLocale:H,fallbackLocale:G?.fallbackLocale??H,localePath:G?.localePath??"./locales",detectLocale:G?.detectLocale===!0,localeNames:G?.localeNames??{},localeConfig:G?.localeConfig??{},translate:(K)=>V[K]??K}}async function E(q,G){if(!q.enabled)return q;try{let{createTranslator:B,loadTranslations:H}=await import("@stacksjs/ts-i18n"),J=await H({translationsDir:q.localePath,defaultLocale:q.defaultLocale,fallbackLocale:q.fallbackLocale,sources:G?.i18n?.sources??["ts","yaml","json"],optional:!0,verbose:!1}),K=B(J,{defaultLocale:q.defaultLocale,fallbackLocale:q.fallbackLocale}),P=new Set;for(let M of Object.values(J))for(let N of Object.keys(M??{}))P.add(N);let W=[...P].sort((M,N)=>M==="theme"?-1:N==="theme"?1:M.localeCompare(N));return{...q,translate:(M,N,X)=>{for(let R of[M,...W.map((O)=>`${O}.${M}`)])try{let O=K(R,N,X);if(typeof O==="string"&&O&&O!==R)return O}catch{}return V[M]??M}}}catch(B){return console.warn("[bunpress] i18n translations could not be loaded; falling back to defaults \u2014",B instanceof Error?B.message:B),q}}function F(q,G){if(!q.enabled)return{locale:q.defaultLocale,path:G};let B=G.match(/^\/([^/]+)(\/.*)?$/);if(B&&q.locales.includes(B[1])&&B[1]!==q.defaultLocale)return{locale:B[1],path:B[2]||"/"};return{locale:q.defaultLocale,path:G}}function Z(q,G,B){if(!q.enabled||G===q.defaultLocale)return B||"/";return`/${G}${B==="/"?"":B}`||`/${G}`}function I(q,G,B,H){let J=H==="/"?"/index":H,K=[];if(q.enabled&&B!==q.defaultLocale)K.push(`${G}/${B}${J}.md`),K.push(`${G}/${B}${J}/index.md`),K.push(`${G}${J}.${B}.md`);if(K.push(`${G}${J}.md`),K.push(`${G}${J}/index.md`),q.enabled)K.push(`${G}${J}.${q.defaultLocale}.md`);return K}function _(q,G,B){let H=G.localeConfig[B];if(!H)return q;return{...q,...H,themeConfig:H.themeConfig?{...q.themeConfig,...H.themeConfig}:q.themeConfig,markdown:H.markdown?{...q.markdown,...H.markdown}:q.markdown}}function D(q,G){return q.localeNames[G]??G}function S(q,G,B){if(!q.enabled)return"";let H=Q(G);if(!H)return"";let J=q.locales.map((K)=>{let P=`${H}${Z(q,K,B==="/index"?"/":B)}`;return`<link rel="alternate" hreflang="${K}" href="${P}">`});return J.push(`<link rel="alternate" hreflang="x-default" href="${H}${B==="/index"?"/":B}">`),J.join(`
|
|
3
|
-
`)}function w(q){if(!q.enabled||!q.detectLocale)return"";return`
|
|
4
|
-
(function () {
|
|
5
|
-
var LOCALES = ${JSON.stringify(q.locales)};
|
|
6
|
-
var DEFAULT = ${JSON.stringify(q.defaultLocale)};
|
|
7
|
-
var KEY = 'bunpress-locale';
|
|
8
|
-
|
|
9
|
-
try {
|
|
10
|
-
var current = location.pathname.split('/')[1];
|
|
11
|
-
if (LOCALES.indexOf(current) !== -1) {
|
|
12
|
-
// Reading a non-default locale is itself a choice; remember it.
|
|
13
|
-
localStorage.setItem(KEY, current);
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
if (localStorage.getItem(KEY)) return;
|
|
17
|
-
|
|
18
|
-
var preferred = (navigator.languages || [navigator.language || ''])
|
|
19
|
-
.map(function (tag) { return String(tag).toLowerCase(); });
|
|
20
|
-
|
|
21
|
-
for (var i = 0; i < preferred.length; i++) {
|
|
22
|
-
var tag = preferred[i];
|
|
23
|
-
var exact = LOCALES.indexOf(tag) !== -1 ? tag : null;
|
|
24
|
-
// 'en-GB' should match an 'en' locale.
|
|
25
|
-
var base = exact || (LOCALES.indexOf(tag.split('-')[0]) !== -1 ? tag.split('-')[0] : null);
|
|
26
|
-
if (base && base !== DEFAULT) {
|
|
27
|
-
localStorage.setItem(KEY, base);
|
|
28
|
-
location.replace(\`/\${base}\${location.pathname}\${location.search}\${location.hash}\`);
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
if (base === DEFAULT) return;
|
|
32
|
-
}
|
|
33
|
-
} catch (_) {
|
|
34
|
-
// Storage or history unavailable: leave the reader where they are.
|
|
35
|
-
}
|
|
36
|
-
})();
|
|
37
|
-
`.trim()}
|
|
38
|
-
export{Y as ga,Q as ha,j as ia,A as ja,E as ka,F as la,Z as ma,I as na,_ as oa,D as pa,S as qa,w as ra};
|