DocsBlogChangelog

mdxts

Server Only

The primary package for MDXTS that provides a utility for working with a collection of module imports.

data.ts
import { createSource } from 'mdxts'

export const allDocs = createSource('docs/**/*.mdx', {
  baseDirectory: 'docs',
})

API Reference

createSource

View Source

Loads content and metadata related to MDX and TypeScript files.

globPattern *

GlobPattern

options

CreateSourceOptions<Type>= {}

baseDirectory

string

The base directory used when calculating source paths. This is useful in monorepos where source files can be located outside of the workspace.

basePathname

string

The base pathname used when calculating navigation paths. This includes everything after the hostname (e.g. /docs in https://mdxts.com/docs).

sourceDirectory

string

The source directory used to calculate package export paths. This is useful when the source is located in a different workspace than the project rendering it.

outputDirectory

string | string[]

The output directory for built files used to calculate package export paths. This is useful when the source is located in a different workspace than the project rendering it.

sort

(a: ModuleData<Type>, b: ModuleData<Type>) => number

A function to sort data items by.

mergeSources

View Source

Merges multiple sources into a single source.

sources *

Sources

getThemeColors

View Source

Gets the configured VS Code theme colors as an object.

Last updated