mdxts
Server OnlyThe primary package for MDXTS that provides a utility for working with a collection of module imports.
import { createSource } from 'mdxts'
export const allDocs = createSource('docs/**/*.mdx', {
  baseDirectory: 'docs',
})
API Reference
createSource
View SourceLoads content and metadata related to MDX and TypeScript files.
globPattern *
GlobPatternoptions
CreateSourceOptions<Type>= {}baseDirectory
stringThe base directory used when calculating source paths. This is useful in monorepos where source files can be located outside of the workspace.
basePathname
stringThe base pathname used when calculating navigation paths. This includes everything after
the hostname (e.g. /docs in https://mdxts.com/docs).
sourceDirectory
stringThe 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>) => numberA function to sort data items by.
mergeSources
View SourceMerges multiple sources into a single source.
sources *
SourcesgetThemeColors
View SourceGets the configured VS Code theme colors as an object.