docmedown 0.9.3 → 0.9.5

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.
@@ -19,7 +19,7 @@
19
19
  * ▼ Svelte application
20
20
  */
21
21
  import { createElementBridge, registerWebComponent } from "./element-bridge";
22
- import { createReactBridge, type DmdElementClass } from "./react-bridge";
22
+ import { createReactBridge } from "./react-bridge";
23
23
  export type ComponentKind = "svelte" | "react" | "element";
24
24
  export interface DynamicComponent {
25
25
  kind: ComponentKind;
@@ -32,12 +32,4 @@ export interface DynamicComponent {
32
32
  * Detects whether a component or module represents Svelte, React, or a Web Element / Lit.
33
33
  */
34
34
  export declare function detectComponentKind(componentOrSource: unknown, filename?: string): ComponentKind;
35
- /**
36
- * Adapts any component (Svelte, React, or Web Element/Lit) into a registered Custom Element
37
- * that can be natively rendered in Markdown with <Name ... /> tags.
38
- */
39
- export declare function adaptComponent(name: string, component: unknown, kind?: ComponentKind, tag?: string): {
40
- tag: string;
41
- elementClass?: DmdElementClass;
42
- };
43
35
  export { createElementBridge, createReactBridge, registerWebComponent };
@@ -10,9 +10,6 @@
10
10
  * Documentation inside documentation: when an ancestor documentation manifest is
11
11
  * reachable, Home links to the original (outermost) documentation home instead.
12
12
  */
13
- export declare const HOME_CANDIDATE_FILES: readonly ["README.md", "PROJECT.md", "ABOUT.md", "INDEX.md"];
14
- /** How many directory levels upward to probe for an enclosing documentation root. */
15
- export declare const ORIGINAL_HOME_MAX_ANCESTORS = 3;
16
13
  export interface HomeDocumentInput {
17
14
  slug?: string;
18
15
  path?: string;
@@ -27,7 +24,7 @@ export interface ResolvedHome {
27
24
  /** Set when the home was resolved from an enclosing documentation root. */
28
25
  via?: "ancestor";
29
26
  }
30
- export interface MinimalFetchResponse {
27
+ interface MinimalFetchResponse {
31
28
  ok: boolean;
32
29
  json: () => Promise<unknown>;
33
30
  }
@@ -45,3 +42,4 @@ export declare function resolveDocumentationHome(docs: HomeDocumentInput[] | nul
45
42
  export declare function findOriginalDocumentationHome(fetchImpl: MinimalFetch, options?: {
46
43
  levels?: number;
47
44
  }): Promise<ResolvedHome | null>;
45
+ export {};
@@ -1,15 +1,3 @@
1
- export interface CalloutInfo {
2
- type: "note" | "tip" | "important" | "warning" | "caution";
3
- title: string;
4
- content: string;
5
- }
6
- export declare const CALLOUT_ICONS: {
7
- note: string;
8
- tip: string;
9
- important: string;
10
- warning: string;
11
- caution: string;
12
- };
13
1
  /**
14
2
  * Transforms GitHub alert blockquotes into DocMeDown callouts
15
3
  * e.g. > [!NOTE] or > [!WARNING] Title
@@ -12,9 +12,7 @@ import "prismjs/components/prism-markup";
12
12
  import "prismjs/components/prism-python";
13
13
  import { escapeHtml } from "./escape";
14
14
  export { escapeHtml };
15
- export declare function normalizeLanguage(lang: string): string;
16
15
  export declare function registerLanguage(name: string, definition: Record<string, unknown>, color?: string): void;
17
- export declare function highlightCode(code: string, lang?: string): string;
18
16
  export declare function renderCodeBlock(code: string, infoString?: string): string;
19
17
  /**
20
18
  * Parses the `{1,3-5}` line-highlight syntax from a fence info string.
@@ -22,24 +20,3 @@ export declare function renderCodeBlock(code: string, infoString?: string): stri
22
20
  * numbers are simply ignored by the wrapper.
23
21
  */
24
22
  export declare function parseActiveLines(infoString: string): Set<number>;
25
- /**
26
- * Wraps highlighted (or escaped) code into per-line `<span>` blocks for line
27
- * numbers and line highlighting, without breaking Prism's token markup:
28
- * token spans that cross a line break are closed before it and reopened after,
29
- * so every `.dmd-code-line` is a single visual line.
30
- *
31
- * **Key design choice:** the trailing "\\n" of every source line is *not*
32
- * included inside its span. Each `.dmd-code-line` is `display: block` via
33
- * CSS, which provides visual line separation and — critically — lets the
34
- * browser insert `\\n` characters between blocks in `innerText` so manual
35
- * Ctrl+C selections produce clean code. Programmatic copies (copy button)
36
- * reconstruct the text by joining each line's `textContent` with `"\\n"`.
37
- *
38
- * Leading whitespace (spaces and tabs) on *non-continuation* lines is
39
- * converted into small visual indicator spans (`dmd-ws-space` dots,
40
- * `dmd-ws-tab` arrows) so indentation style is visible at a glance.
41
- * Continuation lines (those inside a multi-line Prism token such as a
42
- * triple-quoted string or block comment) are left untouched because their
43
- * whitespace is content, not indentation.
44
- */
45
- export declare function wrapCodeLines(html: string, activeLines?: Set<number>): string;
@@ -6,6 +6,5 @@
6
6
  * pipeline as article headings), while search indexing, document titles, and
7
7
  * accessibility strings need the readable plain-text form produced here.
8
8
  */
9
- export declare function decodeHtmlEntities(value: string): string;
10
9
  /** Reduces a heading's raw Markdown to readable plain text. */
11
10
  export declare function inlineHeadingToPlainText(raw: string): string;
@@ -13,5 +13,4 @@ export declare function extractFrontmatter(rawMarkdown: string): {
13
13
  content: string;
14
14
  };
15
15
  export declare function slugifyHeading(text: string): string;
16
- export declare function calculateReadingTime(text: string): number;
17
16
  export declare function parseMarkdown(rawContent: string, currentSlug?: string): ParsedMarkdown;
@@ -19,7 +19,7 @@ export interface TableData {
19
19
  rows: string[][];
20
20
  aligns: TableAlign[];
21
21
  }
22
- export declare const TABLE_COPY_FORMATS: readonly [{
22
+ declare const TABLE_COPY_FORMATS: readonly [{
23
23
  readonly id: "markdown";
24
24
  readonly label: "Markdown";
25
25
  readonly badge: "MD";
@@ -42,8 +42,6 @@ export declare function renderTableBlock(options: {
42
42
  rows: TableCell[][];
43
43
  caption?: string;
44
44
  }): string;
45
- /** Resolves a `delimiter=` option (`;`, `tab`, `pipe`, …). */
46
- export declare function resolveDelimiter(value: string | undefined, fallback: string): string;
47
45
  /** Picks the most frequent candidate delimiter on the first non-empty line. */
48
46
  export declare function detectDelimiter(text: string): string;
49
47
  /**
@@ -66,3 +64,4 @@ export declare function tableToHtml(data: TableData): string;
66
64
  export declare function formatTable(data: TableData, format: TableCopyFormat): string;
67
65
  /** Reads plain-text table data back out of a rendered `.dmd-table-block`. */
68
66
  export declare function readTableData(table: HTMLTableElement): TableData;
67
+ export {};
@@ -3,9 +3,6 @@
3
3
  * for DocMeDown's <Media /> component and offline distributables.
4
4
  */
5
5
  export type MediaCategory = "image" | "vector" | "video" | "audio" | "unknown";
6
- export declare const MEDIA_MIME_TYPES: Record<string, string>;
7
- /** Extracts extension without dot, query params or hash fragments. */
8
- export declare function extractExtension(urlOrPath: string): string;
9
6
  /** Determines MIME type from file extension or explicit type hint. */
10
7
  export declare function resolveMimeType(urlOrPath: string, explicitType?: string): string;
11
8
  /**
@@ -1,8 +1,7 @@
1
1
  import { type SplashOptions } from "./splash";
2
2
  import type { DocManifest } from "./types";
3
3
  export declare const OFFLINE_FORMAT_VERSION = 2;
4
- export declare const OFFLINE_RUNTIME_SCRIPT_ATTRIBUTE = "data-docmedown-runtime";
5
- export interface OfflineDocumentationData {
4
+ interface OfflineDocumentationData {
6
5
  manifest: DocManifest;
7
6
  docs: Record<string, string>;
8
7
  componentsSource?: string;
@@ -56,3 +55,4 @@ export declare function matchEmbeddedNestedSite(href: string, sites: Record<stri
56
55
  * relative link is ever required.
57
56
  */
58
57
  export declare function openEmbeddedNestedSite(siteKey: string, href?: string): Promise<void>;
58
+ export {};
@@ -33,8 +33,6 @@ export declare const SPLASH_ACTIVE_CLASS = "dmd-splash-active";
33
33
  export declare const SPLASH_START_KEY = "__DOCMEDOWN_SPLASH_START__";
34
34
  /** Minimum brand time before the splash may be dismissed, in milliseconds. */
35
35
  export declare const SPLASH_MIN_DURATION_MS = 950;
36
- /** Must match the `#dmd-splash` transition duration in the stylesheet below. */
37
- export declare const SPLASH_EXIT_MS = 450;
38
36
  export interface SplashOptions {
39
37
  /** Documentation name rendered in the top-bar brand lockup. */
40
38
  name?: string;
@@ -9,6 +9,5 @@ export interface SvelteCompilerEngine {
9
9
  compile: typeof import("svelte/compiler").compile;
10
10
  }
11
11
  export declare function configureCompilerEngine(basePath?: string): void;
12
- export declare function loadExternalCompilerEngine(): Promise<SvelteCompilerEngine>;
13
12
  /** Resolves the Svelte compiler engine once, from the external bundle or a dynamic import. */
14
13
  export declare function loadCompilerEngine(): Promise<SvelteCompilerEngine>;
@@ -1,28 +1,10 @@
1
1
  import { ensureCustomElementTag } from "./svelte-tag";
2
2
  export { ensureCustomElementTag };
3
- export interface CompiledSvelteResult {
4
- js: string;
5
- css?: string;
6
- tag: string;
7
- }
8
3
  /**
9
4
  * Rewrites bare `svelte` and `svelte/internal/client` ESM imports to use the
10
5
  * globally exposed Svelte 5 runtime primitives when evaluated as a Blob module.
11
6
  */
12
7
  export declare function linkSveltePrimitives(jsCode: string): string;
13
- /**
14
- * Compiles a raw `.svelte` source string into client JavaScript with custom element registration.
15
- */
16
- export declare function compileSvelteComponent(source: string, options: {
17
- name: string;
18
- tag?: string;
19
- filename?: string;
20
- }): Promise<CompiledSvelteResult>;
21
- /**
22
- * Evaluates compiled Svelte 5 component JavaScript in the browser as a Blob module.
23
- * The module automatically invokes `customElements.define()` upon execution.
24
- */
25
- export declare function evaluateCompiledSvelte(jsCode: string): Promise<unknown>;
26
8
  /**
27
9
  * Fetches, compiles, and registers a remote or local `.svelte` component on the fly.
28
10
  */
@@ -1,4 +1,3 @@
1
- export declare function toKebab(name: string): string;
2
1
  /** Canonical custom element tag for a component name: "CounterWidget" → "dmd-counter-widget". */
3
2
  export declare function dmdTag(name: string): string;
4
3
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docmedown",
3
- "version": "0.9.3",
3
+ "version": "0.9.5",
4
4
  "description": "The simplest MarkDown documenter yet. CLI, web script, and static-site compiler with AI-native distribution.",
5
5
  "author": "Gabriel M. P. da Silva",
6
6
  "license": "Apache-2.0",
@@ -19,7 +19,7 @@ You can initialize a brand new documentation site with a single command:
19
19
  npx docmedown ./docs
20
20
  ```
21
21
 
22
- This scaffolds your documentation directory, creates starter Markdown guides, and starts a live preview server!
22
+ This scaffolds your documentation directory, automatically links any root `*.md` files (like `README.md`, `CONTRIBUTING.md`, `CHANGELOG.md`) alongside your `./docs/` folder without an artificial subdivision, and starts a live preview server!
23
23
 
24
24
  ---
25
25