@docpensieve/shared
v0.4.1
Published
Utilities, constants and errors shared by the DocPensieve packages
Maintainers
Readme
@docpensieve/shared
Shared constants, errors and slugs
Part of DocPensieve, a static documentation site generator: Markdown and MDX in, static HTML out, one version per orphan branch, JSON-LD structured data from the frontmatter.
Installation
npm install @docpensieve/sharedUsage
This package depends on nothing: it is the leaf of DocPensieve's dependency graph. Anything two or more packages need lives here.
import { slugify, filePathToSlug, DocPensieveError } from '@docpensieve/shared';
slugify('Crème Brûlée Recipes'); // 'creme-brulee-recipes'
filePathToSlug('guide/01-install.md'); // 'guide/install'Accents are stripped from slugs, which keeps URLs readable instead of percent-encoded.
Documentation
See the repository.
License
MIT