library_helpers.ts

Library documentation URL helpers.

Runtime UI helpers for building URLs in the library documentation system. These depend on fuz_ui's documentation paths and SvelteKit's runtime state.

For generic package/repository URL helpers, see package_helpers.ts.

Declarations
#

5 declarations

view source

url_api_declaration
#

library_helpers.ts view source

(declaration_name: string): string

Build project-relative API documentation URL with hash anchor.

declaration_name

Name of the declaration to link to

type string

returns

string

URL path like '/docs/api#declaration_name'

url_api_declaration_full
#

url_api_module
#

library_helpers.ts view source

(module_path: string): string

Build project-relative module documentation URL.

module_path

Module path (e.g., 'helpers.ts')

type string

returns

string

URL path like '/docs/api/helpers.ts'

url_package_logo
#

url_to_root_relative
#

library_helpers.ts view source

(url: string, origin?: string): string

Convert a full URL to root-relative format by removing the origin.

Uses SvelteKit's page state for the current origin by default.

url

Full URL to convert

type string

origin

Origin to strip (defaults to current page origin)

type string
default page.url.origin

returns

string

Root-relative URL starting with '/'

examples

// Assuming page.url.origin is 'https://example.com' url_to_root_relative('https://example.com/docs/api') // => '/docs/api'

Depends on
#

Imported by
#