@stacksjs/bunpress 0.1.21 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/dist/bin/cli.d.ts +3 -0
  2. package/dist/bin/cli.js +1 -1
  3. package/dist/{chunk-kxr6zf7e.js → chunk-2ns9va8d.js} +1315 -464
  4. package/dist/{chunk-qdmkac4z.js → chunk-av14gbps.js} +10 -11
  5. package/dist/{chunk-m0g9vk1e.js → chunk-avg4ftb9.js} +159 -194
  6. package/dist/chunk-fyb5bzsp.js +10 -0
  7. package/dist/chunk-n0ebp7d8.js +38 -0
  8. package/dist/{chunk-qrp18ybj.js → chunk-trhgd2dy.js} +1 -1
  9. package/dist/chunk-w615shtf.js +2 -0
  10. package/dist/chunk-x5m3c6jd.js +469 -0
  11. package/dist/src/build-manifest.d.ts +22 -0
  12. package/dist/src/config.d.ts +12 -0
  13. package/dist/src/data-loader.d.ts +6 -3
  14. package/dist/src/highlighter.d.ts +2 -1
  15. package/dist/src/i18n.d.ts +67 -0
  16. package/dist/src/index.d.ts +2 -0
  17. package/dist/src/index.js +1 -1
  18. package/dist/src/page-meta.d.ts +19 -0
  19. package/dist/src/search-index.d.ts +61 -0
  20. package/dist/src/serve.d.ts +20 -5
  21. package/dist/src/toc.d.ts +6 -2
  22. package/dist/src/types.d.ts +80 -8
  23. package/dist/templates/blocks/alerts/caution.stx +2 -2
  24. package/dist/templates/blocks/alerts/important.stx +2 -2
  25. package/dist/templates/blocks/alerts/note.stx +2 -2
  26. package/dist/templates/blocks/alerts/tip.stx +2 -2
  27. package/dist/templates/blocks/alerts/warning.stx +2 -2
  28. package/dist/templates/blocks/containers/danger.stx +2 -2
  29. package/dist/templates/blocks/containers/details.stx +2 -2
  30. package/dist/templates/blocks/containers/info.stx +2 -2
  31. package/dist/templates/blocks/containers/raw.stx +1 -1
  32. package/dist/templates/blocks/containers/tip.stx +2 -2
  33. package/dist/templates/blocks/containers/warning.stx +2 -2
  34. package/dist/templates/copy-page.stx +81 -0
  35. package/dist/templates/doc-footer.stx +51 -0
  36. package/dist/templates/footer.stx +45 -0
  37. package/dist/templates/hero.stx +9 -2
  38. package/dist/templates/layout-doc.stx +8 -125
  39. package/dist/templates/layout-home.stx +7 -14
  40. package/dist/templates/layout-page.stx +7 -14
  41. package/dist/templates/locale-switcher.stx +115 -0
  42. package/dist/templates/navbar.stx +49 -0
  43. package/dist/templates/page-outline.stx +149 -0
  44. package/dist/templates/page-toc.stx +1 -1
  45. package/dist/templates/search-algolia.stx +85 -0
  46. package/dist/templates/search.stx +661 -0
  47. package/dist/templates/sidebar-section.stx +44 -11
  48. package/dist/templates/sidebar.stx +11 -2
  49. package/dist/themes/vitepress/index.ts +558 -165
  50. package/package.json +16 -7
  51. package/dist/chunk-9cm3e4r4.js +0 -688
  52. package/dist/chunk-mjhqecp5.js +0 -467
  53. package/dist/chunk-wmvgjzgh.js +0 -3
  54. package/dist/chunk-zmxtnx2v.js +0 -8
@@ -0,0 +1,67 @@
1
+ import type { BunPressConfig } from './types';
2
+ /** A site with no i18n block behaves exactly as it always has. */
3
+ export declare function resolveI18nConfig(config: BunPressConfig | undefined): ResolvedI18n;
4
+ /**
5
+ * Load translation files and attach a translator.
6
+ *
7
+ * `ts-i18n` is imported lazily: a site that lists no locales should not pay
8
+ * for it, and a missing install degrades to the English defaults rather than
9
+ * failing the build.
10
+ */
11
+ export declare function loadI18nTranslations(resolved: ResolvedI18n, config: BunPressConfig | undefined): Promise<ResolvedI18n>;
12
+ /**
13
+ * Split a request path into its locale and the path within that locale.
14
+ *
15
+ * The default locale lives at the root, so `/guide` is the default locale and
16
+ * `/es/guide` is Spanish. A prefix that is not a configured locale is left
17
+ * alone — otherwise a page genuinely called `/fr` would be unreachable.
18
+ */
19
+ export declare function splitLocaleFromPath(i18n: ResolvedI18n, pathname: string): { locale: string, path: string };
20
+ /** Build the public URL for a path in a given locale. */
21
+ export declare function localizeUrl(i18n: ResolvedI18n, locale: string, path: string): string;
22
+ /**
23
+ * Candidate markdown files for a path, most specific first.
24
+ *
25
+ * Both documented layouts are supported — a directory per locale
26
+ * (`docs/es/guide.md`) and a suffix per file (`docs/guide.es.md`) — because
27
+ * both appear in the guide and neither is wrong. Default-locale files come
28
+ * last so an untranslated page still renders instead of 404ing.
29
+ */
30
+ export declare function localeContentCandidates(i18n: ResolvedI18n, root: string, locale: string, path: string): string[];
31
+ /**
32
+ * Merge a locale's overrides over the site config.
33
+ *
34
+ * Shallow by design for most keys, but `themeConfig` and `markdown` are merged
35
+ * one level deeper: a locale usually overrides a single nested value (a footer
36
+ * message, a title) and a shallow merge would silently drop the rest.
37
+ */
38
+ export declare function configForLocale(config: BunPressConfig, i18n: ResolvedI18n, locale: string): BunPressConfig;
39
+ /** Display name for a locale, falling back to the code itself. */
40
+ export declare function localeLabel(i18n: ResolvedI18n, locale: string): string;
41
+ /**
42
+ * `hreflang` alternates for the current page.
43
+ *
44
+ * Search engines use these to serve the right language and to avoid treating
45
+ * translations as duplicate content, so they only mean anything with an
46
+ * absolute base URL to point at.
47
+ */
48
+ export declare function generateHreflangTags(i18n: ResolvedI18n, config: BunPressConfig, path: string): string;
49
+ /**
50
+ * Client script that sends a first-time visitor to their browser's language.
51
+ *
52
+ * Deliberately conservative: it runs only at the default locale's root, only
53
+ * once per browser, and records any manual switch so it never fights a
54
+ * reader who chose a language on purpose.
55
+ */
56
+ export declare function generateLocaleDetectionScript(i18n: ResolvedI18n): string;
57
+ export declare interface ResolvedI18n {
58
+ enabled: boolean
59
+ locales: string[]
60
+ defaultLocale: string
61
+ fallbackLocale: string | string[]
62
+ localePath: string
63
+ detectLocale: boolean
64
+ localeNames: Record<string, string>
65
+ localeConfig: Record<string, Partial<BunPressConfig>>
66
+ translate: (key: string, locale: string, params?: Record<string, string | number>) => string
67
+ }
@@ -1,11 +1,13 @@
1
1
  export * from './config';
2
2
  export * from './highlighter';
3
+ export * from './i18n';
3
4
  // export * from './plugin'
4
5
  // Named re-exports for RSS/sitemap/robots — `export *` would clash with the
5
6
  // config interfaces (e.g. RssFeedConfig) already exported from './types'.
6
7
  export { buildRssFeed, generateRssFeed } from './rss';
7
8
  export { generateRobotsTxt } from './robots';
8
9
  export { buildSitemap, generateSitemap } from './sitemap';
10
+ export { buildSearchIndex, buildSearchRuntimeConfig, SEARCH_INDEX_PATH } from './search-index';
9
11
  export * from './serve';
10
12
  export * from './toc';
11
13
  export * from './types';
package/dist/src/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{A as d,B as f,C as a,D as g,a as O,b as P,c as Q,d as S,e as T,f as V,g as W,h as X,i as Y,j as Z,k as _,l as $,m as b,n as v,o as x,p as A,q as F,r as R,s as U,t as m,u as C,v as h,w as l,x as y,y as p,z as c}from"../chunk-kxr6zf7e.js";import{L as j,M as k,N as q,O as u,P as w}from"../chunk-qdmkac4z.js";import{Q as L,R as M,S as N}from"../chunk-m0g9vk1e.js";import"../chunk-wmvgjzgh.js";export{d as wrapInLayout,c as stripConfiguredBasePath,a as startServer,g as serveCLI,O as resetHighlighter,C as processInlineTocSyntax,W as prewarmHighlighter,P as normalizeLanguage,f as markdownToHtml,Q as isLanguageSupported,T as highlightCodeSync,S as highlightCode,V as getSyntaxHighlightingStyles,X as getHighlighterInstance,p as getConfiguredBasePath,N as getConfig,_ as generateUniqueSlug,l as generateTocStyles,y as generateTocScripts,m as generateTocPositions,x as generateTocHtml,U as generateTocData,Z as generateSlug,w as generateSitemap,F as generateSidebarTocHtml,k as generateRssFeed,q as generateRobotsTxt,A as generateInlineTocHtml,R as generateFloatingTocHtml,v as filterHeadings,$ as extractHeadings,h as enhanceHeadingsWithAnchors,Y as defaultTocConfig,L as defaultConfig,M as config,b as buildTocHierarchy,u as buildSitemap,j as buildRssFeed};
2
+ import{A as wj,B as zj,C as Bj,D as Dj,a as W,b as X,c as Y,d as Z,e as _,f as $,g as b,h as v,i as y,j as p,k as f,l as c,m as d,n as g,o as a,p as n,q as o,r,s as t,t as i,u as s,v as e,w as jj,x as kj,y as qj,z as uj}from"../chunk-2ns9va8d.js";import{L as j,M as k,N as q,O as u,P as w}from"../chunk-av14gbps.js";import{Q,R as S,S as T,T as V,U as z,V as B,W as D}from"../chunk-avg4ftb9.js";import{$ as U,Y as A,Z as F,_ as R,aa as m,ba as x,ca as C,da as l,ea as h}from"../chunk-n0ebp7d8.js";export{wj as wrapInLayout,uj as stripConfiguredBasePath,Bj as startServer,R as splitLocaleFromPath,Dj as serveCLI,A as resolveI18nConfig,W as resetHighlighter,s as processInlineTocSyntax,b as prewarmHighlighter,X as normalizeLanguage,zj as markdownToHtml,U as localizeUrl,C as localeLabel,m as localeContentCandidates,F as loadI18nTranslations,Y as isLanguageSupported,_ as highlightCodeSync,Z as highlightCode,$ as getSyntaxHighlightingStyles,v as getHighlighterInstance,qj as getConfiguredBasePath,V as getConfig,f as generateUniqueSlug,jj as generateTocStyles,kj as generateTocScripts,i as generateTocPositions,a as generateTocHtml,t as generateTocData,p as generateSlug,w as generateSitemap,o as generateSidebarTocHtml,k as generateRssFeed,q as generateRobotsTxt,h as generateLocaleDetectionScript,n as generateInlineTocHtml,l as generateHreflangTags,r as generateFloatingTocHtml,g as filterHeadings,c as extractHeadings,e as enhanceHeadingsWithAnchors,y as defaultTocConfig,Q as defaultConfig,x as configForLocale,T as config,d as buildTocHierarchy,u as buildSitemap,B as buildSearchRuntimeConfig,D as buildSearchIndex,j as buildRssFeed,S as applyConfigPlugins,z as SEARCH_INDEX_PATH};
@@ -0,0 +1,19 @@
1
+ /** Forget cached git dates. Used by the dev server's file watcher. */
2
+ export declare function clearGitDateCache(): void;
3
+ /**
4
+ * When a source file was last changed, as an ISO string.
5
+ *
6
+ * Prefers the last commit that touched it — that is the date a reader means by
7
+ * "last updated" — and falls back to the filesystem, which is all that exists
8
+ * for an untracked or freshly written file.
9
+ */
10
+ export declare function resolveLastUpdated(docsDir: string, sourceFile: string): Promise<string | null>;
11
+ /**
12
+ * Build the edit URL for a page.
13
+ *
14
+ * `:path` is the page's path relative to the docs directory, which is what
15
+ * every forge's edit URL expects after the branch segment.
16
+ */
17
+ export declare function buildEditUrl(pattern: string, docsDir: string, sourceFile: string): string;
18
+ /** Render an ISO date for display, honouring the configured format. */
19
+ export declare function formatLastUpdated(iso: string, locale: string, options?: Intl.DateTimeFormatOptions): string;
@@ -0,0 +1,61 @@
1
+ import type { BunPressConfig, LocalSearchOptions, SearchConfig } from './types';
2
+ /**
3
+ * Merge user options over the defaults.
4
+ * Exported so the client-side runtime is configured from exactly the same
5
+ * resolution the indexer used — two copies of this logic would drift.
6
+ */
7
+ export declare function resolveSearchOptions(search: SearchConfig | undefined): typeof DEFAULT_LOCAL_SEARCH_OPTIONS;
8
+ export declare function buildSearchRuntimeConfig(config: BunPressConfig | undefined, indexUrl: string): SearchRuntimeConfig;
9
+ /**
10
+ * Walk the docs directory and build the client search index.
11
+ */
12
+ export declare function buildSearchIndex(docsDir: string, config?: BunPressConfig): Promise<SearchRecord[]>;
13
+ /** Path the client fetches the index from. */
14
+ export declare const SEARCH_INDEX_PATH: '/search-index.json';
15
+ /** Defaults for every documented local-search option. */
16
+ export declare const DEFAULT_LOCAL_SEARCH_OPTIONS: Required<
17
+ Pick<LocalSearchOptions, 'include' | 'exclude' | 'searchFields' | 'maxResults' | 'minQueryLength' | 'fuzzy' | 'fuzziness' | 'stemmer' | 'maxContentLength'>
18
+ > & { boost: Required<NonNullable<LocalSearchOptions['boost']>> };
19
+ /**
20
+ * One searchable record.
21
+ *
22
+ * The unit is a *section*, not a page: a reader searching "line numbers" wants
23
+ * to land on the heading that covers it, not at the top of a 3,000-word
24
+ * reference page and hunt. Every h2-h6 opens a new record, and the prose that
25
+ * follows it — up to the next heading — is that record's body.
26
+ */
27
+ export declare interface SearchRecord {
28
+ url: string
29
+ page: string
30
+ title: string
31
+ text: string
32
+ level: number
33
+ keywords?: string[]
34
+ locale?: string
35
+ }
36
+ /**
37
+ * Everything the browser runtime needs, derived from the same resolution the
38
+ * indexer used so ranking in the page matches how the index was built.
39
+ *
40
+ * `tokenize` and `onSearch` are user functions from a build-time config, so
41
+ * they cross to the browser as source text. That means they must not close
42
+ * over build-time values — the documented examples reference page globals,
43
+ * which is exactly what survives the trip.
44
+ */
45
+ export declare interface SearchRuntimeConfig {
46
+ indexUrl: string
47
+ placeholder: string
48
+ lazy: boolean
49
+ maxResults: number
50
+ minQueryLength: number
51
+ searchFields: string[]
52
+ boost: { title: number, headings: number, content: number }
53
+ fuzzy: boolean
54
+ fuzziness: number
55
+ stemmer: 'english' | 'none'
56
+ shortcuts: { keyboard: boolean, keys: Array<{ key: string, meta: boolean, ctrl: boolean, alt: boolean, shift: boolean }> }
57
+ result: { showDescription: boolean, descriptionLength: number, highlightMatches: boolean, showPath: boolean }
58
+ tokenizeSource: string | null
59
+ onSearchSource: string | null
60
+ locale: string | null
61
+ }
@@ -1,11 +1,9 @@
1
1
  import { config } from './config';
2
- import type { BunPressConfig } from './types';
2
+ import type { BunPressConfig, Frontmatter } from './types';
3
+ import type { ResolvedI18n } from './i18n';
3
4
  export declare function getConfiguredBasePath(config: BunPressConfig): string;
4
5
  export declare function stripConfiguredBasePath(config: BunPressConfig, pathname: string): string;
5
- /**
6
- * Wrap content in BunPress documentation layout
7
- */
8
- export declare function wrapInLayout(content: string, config: BunPressConfig, currentPath: string, layout?: string): Promise<string>;
6
+ export declare function wrapInLayout(content: string, siteConfig: BunPressConfig, currentPath: string, layout?: string, frontmatter?: Frontmatter, options?: WrapLayoutOptions): Promise<string>;
9
7
  /**
10
8
  * Convert markdown to HTML using Bun's built-in markdown parser
11
9
  * See: https://bun.com/docs/runtime/markdown
@@ -30,3 +28,20 @@ export declare function serveCLI(options?: {
30
28
  watch?: boolean
31
29
  config?: BunPressConfig
32
30
  }): Promise<void>;
31
+ /** Which code-block extras are switched on, from `features.codeBlocks`. */
32
+ export declare interface CodeBlockFeatures {
33
+ lineHighlighting: boolean
34
+ lineNumbers: boolean
35
+ diffs: boolean
36
+ errorWarningMarkers: boolean
37
+ }
38
+ /**
39
+ * Wrap content in BunPress documentation layout
40
+ */
41
+ /** Everything the layout needs about the page beyond its rendered content. */
42
+ export declare interface WrapLayoutOptions {
43
+ i18n?: ResolvedI18n
44
+ locale?: string
45
+ sourceFile?: string
46
+ docsDir?: string
47
+ }
package/dist/src/toc.d.ts CHANGED
@@ -56,9 +56,13 @@ export declare function enhanceHeadingsWithAnchors(content: string): string;
56
56
  */
57
57
  export declare function generateTocStyles(): string;
58
58
  /**
59
- * Generate JavaScript for TOC interactions
59
+ * Generate JavaScript for TOC interactions.
60
+ *
61
+ * `smoothScroll`, `activeHighlight` and `collapsible` come straight from
62
+ * TocConfig — each behaviour is emitted only when it is switched on, so a
63
+ * site that turns one off does not ship the code for it either.
60
64
  */
61
- export declare function generateTocScripts(): string;
65
+ export declare function generateTocScripts(config?: Partial<TocConfig>): string;
62
66
  /**
63
67
  * Default TOC configuration
64
68
  */
@@ -8,6 +8,8 @@ export declare interface BunPressConfig {
8
8
  nav?: NavItem[]
9
9
  siteTitle?: string
10
10
  }
11
+ search?: SearchConfig
12
+ i18n?: I18nSiteConfig
11
13
  docsDir?: string
12
14
  outDir?: string
13
15
  basePath?: string
@@ -35,7 +37,6 @@ export declare interface BunPressConfig {
35
37
  * Cloud deployment configuration
36
38
  */
37
39
  export declare interface CloudConfig {
38
- driver?: 'aws'
39
40
  region?: string
40
41
  domain?: string
41
42
  subdomain?: string
@@ -70,11 +71,12 @@ export declare interface MarkdownPluginConfig {
70
71
  title?: string
71
72
  meta?: Record<string, string>
72
73
  parserOptions?: {
73
- gfm?: boolean
74
- breaks?: boolean
75
- headerIds?: boolean
76
- headerPrefix?: string
77
- highlight?: (code: string, lang: string) => string
74
+ tables?: boolean
75
+ strikethrough?: boolean
76
+ tasklists?: boolean
77
+ autolinks?: boolean
78
+ hardBreaks?: boolean
79
+ unsafeHTML?: boolean
78
80
  }
79
81
  preserveDirectoryStructure?: boolean
80
82
  toc?: TocConfig
@@ -229,10 +231,71 @@ export declare interface TablesConfig {
229
231
  */
230
232
  export declare interface SearchConfig {
231
233
  enabled?: boolean
234
+ provider?: 'local' | 'algolia'
235
+ algolia?: AlgoliaSearchConfig
232
236
  placeholder?: string
233
237
  maxResults?: number
234
238
  keyboardShortcuts?: boolean
235
- searchFn?: (query: string, content: string[]) => SearchResult[]
239
+ shortcut?: string | string[]
240
+ lazy?: boolean
241
+ options?: LocalSearchOptions
242
+ resultOptions?: SearchResultOptions
243
+ onSearch?: (query: string, results: SearchResult[]) => void
244
+ }
245
+ /** Algolia DocSearch credentials and query parameters. */
246
+ export declare interface AlgoliaSearchConfig {
247
+ appId: string
248
+ apiKey: string
249
+ indexName: string
250
+ searchParameters?: Record<string, unknown>
251
+ placeholder?: string
252
+ }
253
+ /** Field weights used when ranking a local search hit. */
254
+ export declare interface SearchBoostConfig {
255
+ title?: number
256
+ headings?: number
257
+ content?: number
258
+ }
259
+ export declare interface LocalSearchOptions {
260
+ include?: string[]
261
+ exclude?: string[]
262
+ searchFields?: SearchField[]
263
+ maxResults?: number
264
+ minQueryLength?: number
265
+ boost?: SearchBoostConfig
266
+ tokenize?: (text: string) => string[]
267
+ fuzzy?: boolean
268
+ fuzziness?: number
269
+ stemmer?: 'english' | 'none'
270
+ storeFields?: Array<'title' | 'page' | 'text' | 'url' | 'level' | 'keywords'>
271
+ maxContentLength?: number
272
+ }
273
+ export declare interface SearchResultOptions {
274
+ showDescription?: boolean
275
+ descriptionLength?: number
276
+ highlightMatches?: boolean
277
+ showPath?: boolean
278
+ }
279
+ /**
280
+ * Per-page search control, set in frontmatter as `search:`.
281
+ * `search: false` keeps the page out of the index entirely.
282
+ */
283
+ export declare interface FrontmatterSearchConfig {
284
+ keywords?: string[]
285
+ title?: string
286
+ }
287
+ /*.{yml,json,ts}`.
288
+ */
289
+ export declare interface I18nSiteConfig {
290
+ enabled?: boolean
291
+ locales: string[]
292
+ defaultLocale?: string
293
+ fallbackLocale?: string | string[]
294
+ localePath?: string
295
+ sources?: Array<'ts' | 'yaml' | 'json'>
296
+ detectLocale?: boolean
297
+ localeConfig?: Record<string, Partial<BunPressConfig>>
298
+ localeNames?: Record<string, string>
236
299
  }
237
300
  /**
238
301
  * Search result item
@@ -273,6 +336,14 @@ export declare interface ThemeConfig {
273
336
  darkMode?: boolean | 'auto'
274
337
  cssVars?: Record<string, string>
275
338
  css?: string
339
+ editLink?: {
340
+ pattern: string
341
+ text?: string
342
+ }
343
+ lastUpdated?: boolean | {
344
+ text?: string
345
+ formatOptions?: Intl.DateTimeFormatOptions
346
+ }
276
347
  }
277
348
  /**
278
349
  * Configuration plugin interface
@@ -282,7 +353,6 @@ export declare interface ConfigPlugin {
282
353
  extendConfig?: (config: BunPressConfig) => BunPressConfig
283
354
  validateConfig?: (config: BunPressConfig) => ConfigValidationResult
284
355
  onConfigLoad?: (config: BunPressConfig) => void | Promise<void>
285
- onConfigChange?: (newConfig: BunPressConfig, oldConfig: BunPressConfig) => void | Promise<void>
286
356
  }
287
357
  /**
288
358
  * Configuration validation result
@@ -401,6 +471,8 @@ export type MarkdownPluginOptions = Partial<MarkdownPluginConfig>;
401
471
  * TOC position options
402
472
  */
403
473
  export type TocPosition = 'sidebar' | 'inline' | 'floating';
474
+ /** Which parts of a record are searched and stored. */
475
+ export type SearchField = 'title' | 'content' | 'headings' | 'keywords';
404
476
  /**
405
477
  * Sitemap change frequency values
406
478
  */
@@ -4,6 +4,6 @@
4
4
  Caution
5
5
  </p>
6
6
  <div class="github-alert-content">
7
- {!! content !!}
8
- </div>
7
+ {!! content !!}
8
+ </div>
9
9
  </div>
@@ -4,6 +4,6 @@
4
4
  Important
5
5
  </p>
6
6
  <div class="github-alert-content">
7
- {!! content !!}
8
- </div>
7
+ {!! content !!}
8
+ </div>
9
9
  </div>
@@ -4,6 +4,6 @@
4
4
  Note
5
5
  </p>
6
6
  <div class="github-alert-content">
7
- {!! content !!}
8
- </div>
7
+ {!! content !!}
8
+ </div>
9
9
  </div>
@@ -4,6 +4,6 @@
4
4
  Tip
5
5
  </p>
6
6
  <div class="github-alert-content">
7
- {!! content !!}
8
- </div>
7
+ {!! content !!}
8
+ </div>
9
9
  </div>
@@ -4,6 +4,6 @@
4
4
  Warning
5
5
  </p>
6
6
  <div class="github-alert-content">
7
- {!! content !!}
8
- </div>
7
+ {!! content !!}
8
+ </div>
9
9
  </div>
@@ -1,6 +1,6 @@
1
1
  <div class="custom-block danger">
2
2
  <p class="custom-block-title">{{title}}</p>
3
3
  <div class="custom-block-content">
4
- {!! content !!}
5
- </div>
4
+ {!! content !!}
5
+ </div>
6
6
  </div>
@@ -1,6 +1,6 @@
1
1
  <details class="custom-block details">
2
2
  <summary>{{title}}</summary>
3
3
  <div class="custom-block-content">
4
- {!! content !!}
5
- </div>
4
+ {!! content !!}
5
+ </div>
6
6
  </details>
@@ -1,6 +1,6 @@
1
1
  <div class="custom-block info">
2
2
  <p class="custom-block-title">{{title}}</p>
3
3
  <div class="custom-block-content">
4
- {!! content !!}
5
- </div>
4
+ {!! content !!}
5
+ </div>
6
6
  </div>
@@ -1,3 +1,3 @@
1
1
  <div class="bp-raw">
2
- {!! content !!}
2
+ {!! content !!}
3
3
  </div>
@@ -1,6 +1,6 @@
1
1
  <div class="custom-block tip">
2
2
  <p class="custom-block-title">{{title}}</p>
3
3
  <div class="custom-block-content">
4
- {!! content !!}
5
- </div>
4
+ {!! content !!}
5
+ </div>
6
6
  </div>
@@ -1,6 +1,6 @@
1
1
  <div class="custom-block warning">
2
2
  <p class="custom-block-title">{{title}}</p>
3
3
  <div class="custom-block-content">
4
- {!! content !!}
5
- </div>
4
+ {!! content !!}
5
+ </div>
6
6
  </div>
@@ -0,0 +1,81 @@
1
+ <div class="copy-page-dropdown" id="copy-page-dropdown">
2
+ <div class="copy-page-button-group">
3
+ <button class="copy-page-button copy-page-main" onclick="copyPageDirect(event)" aria-label="Copy page as markdown">
4
+ <svg class="copy-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24">
5
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"></path>
6
+ </svg>
7
+ <svg class="check-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24" style="display: none;">
8
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path>
9
+ </svg>
10
+ <span class="button-text">Copy page</span>
11
+ </button>
12
+ <button class="copy-page-button copy-page-toggle" onclick="toggleCopyPageDropdown(event)" aria-label="More copy options">
13
+ <svg class="chevron" fill="none" stroke="currentColor" viewBox="0 0 24 24">
14
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path>
15
+ </svg>
16
+ </button>
17
+ </div>
18
+ <div class="copy-page-menu">
19
+ <!-- Copy page as Markdown -->
20
+ <div class="copy-page-menu-item" onclick="copyPageAsMarkdown(event)">
21
+ <div class="icon">
22
+ <svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
23
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"></path>
24
+ </svg>
25
+ </div>
26
+ <div class="content">
27
+ <div class="title">Copy page</div>
28
+ <div class="description">Copy page as Markdown for LLMs</div>
29
+ </div>
30
+ </div>
31
+ <!-- View as Markdown -->
32
+ <div class="copy-page-menu-item" onclick="viewAsMarkdown(event)">
33
+ <div class="icon">
34
+ <svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
35
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path>
36
+ </svg>
37
+ </div>
38
+ <div class="content">
39
+ <div class="title">View as Markdown <svg class="external-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"></path></svg></div>
40
+ <div class="description">View this page as plain text</div>
41
+ </div>
42
+ </div>
43
+ <div class="copy-page-menu-divider"></div>
44
+ <!-- Open in ChatGPT -->
45
+ <a class="copy-page-menu-item" onclick="openInChatGPT(event)" href="#">
46
+ <div class="icon">
47
+ <svg viewBox="0 0 24 24" fill="currentColor">
48
+ <path d="M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.8956zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z"/>
49
+ </svg>
50
+ </div>
51
+ <div class="content">
52
+ <div class="title">Open in ChatGPT <svg class="external-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"></path></svg></div>
53
+ <div class="description">Copy content and open ChatGPT</div>
54
+ </div>
55
+ </a>
56
+ <!-- Open in Claude -->
57
+ <a class="copy-page-menu-item" onclick="openInClaude(event)" href="#">
58
+ <div class="icon">
59
+ <svg viewBox="0 0 24 24" fill="currentColor">
60
+ <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z"/>
61
+ </svg>
62
+ </div>
63
+ <div class="content">
64
+ <div class="title">Open in Claude <svg class="external-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"></path></svg></div>
65
+ <div class="description">Copy content and open Claude</div>
66
+ </div>
67
+ </a>
68
+ <!-- Open in Perplexity -->
69
+ <a class="copy-page-menu-item" onclick="openInPerplexity(event)" href="#">
70
+ <div class="icon">
71
+ <svg viewBox="0 0 24 24" fill="currentColor">
72
+ <path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"/>
73
+ </svg>
74
+ </div>
75
+ <div class="content">
76
+ <div class="title">Open in Perplexity <svg class="external-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"></path></svg></div>
77
+ <div class="description">Search with Perplexity AI</div>
78
+ </div>
79
+ </a>
80
+ </div>
81
+ </div>
@@ -0,0 +1,51 @@
1
+ <div class="BPDocFooter">
2
+ {!! editLink !!}
3
+ {!! lastUpdated !!}
4
+ </div>
5
+
6
+ <style>
7
+ .BPDocFooter {
8
+ display: flex;
9
+ flex-wrap: wrap;
10
+ align-items: baseline;
11
+ justify-content: space-between;
12
+ gap: 8px 16px;
13
+ margin-top: 48px;
14
+ padding-top: 20px;
15
+ border-top: 1px solid var(--bp-c-divider);
16
+ font-size: 14px;
17
+ line-height: 1.6;
18
+ }
19
+
20
+ .BPDocFooter-edit {
21
+ display: inline-flex;
22
+ align-items: center;
23
+ gap: 6px;
24
+ color: var(--bp-c-brand-1);
25
+ font-weight: 500;
26
+ text-decoration: none;
27
+ }
28
+
29
+ .BPDocFooter-edit:hover {
30
+ text-decoration: underline;
31
+ text-underline-offset: 2px;
32
+ }
33
+
34
+ .BPDocFooter-edit svg {
35
+ width: 15px;
36
+ height: 15px;
37
+ flex-shrink: 0;
38
+ }
39
+
40
+ .BPDocFooter-edit:focus-visible {
41
+ outline: 2px solid var(--bp-c-brand-1);
42
+ outline-offset: 2px;
43
+ border-radius: 3px;
44
+ }
45
+
46
+ .BPDocFooter-updated {
47
+ color: var(--bp-c-text-3);
48
+ /* Pushed to the trailing edge even when the edit link is absent. */
49
+ margin-left: auto;
50
+ }
51
+ </style>
@@ -0,0 +1,45 @@
1
+ <footer class="BPFooter">
2
+ {!! message !!}
3
+ {!! copyright !!}
4
+ </footer>
5
+
6
+ <style>
7
+ .BPFooter {
8
+ margin-top: 64px;
9
+ padding-top: 24px;
10
+ border-top: 1px solid var(--bp-c-divider);
11
+ font-size: 14px;
12
+ line-height: 1.6;
13
+ color: var(--bp-c-text-2);
14
+ }
15
+
16
+ .BPFooter p {
17
+ margin: 0;
18
+ }
19
+
20
+ .BPFooter p + p {
21
+ margin-top: 4px;
22
+ }
23
+
24
+ .BPFooter a {
25
+ color: var(--bp-c-brand-1);
26
+ text-decoration: underline;
27
+ text-underline-offset: 2px;
28
+ }
29
+
30
+ .BPFooter-copyright {
31
+ color: var(--bp-c-text-3);
32
+ }
33
+
34
+ /* On the home and page layouts the footer is the width of the content, which
35
+ is centred — so it centres too rather than hugging the left edge. */
36
+ .BPHome .BPFooter,
37
+ .BPPage .BPFooter {
38
+ max-width: 1152px;
39
+ margin-left: auto;
40
+ margin-right: auto;
41
+ padding-left: 24px;
42
+ padding-right: 24px;
43
+ padding-bottom: 32px;
44
+ }
45
+ </style>