koenig/kg-card-factory/README.md
Card definition factory for Ghost's Mobiledoc renderer.
Legacy: this package supports posts that have never been converted from Mobiledoc. New editor work belongs in the Lexical packages.
npm install @tryghost/kg-card-factory
import {CardFactory} from '@tryghost/kg-card-factory';
const factory = new CardFactory({siteUrl: 'https://example.com'});
const card = factory.createCard(cardDefinition);
Options passed to the factory are merged into the render options of every card it creates, with per-render options taking precedence.
This package is part of the Ghost monorepo
and resolves through the pnpm workspace — there is no linking or per-package
install step. Run pnpm setup in the monorepo root, then work in
koenig/kg-card-factory.
See the Koenig README for the shared build, test and release workflow.
pnpm test:unit runs the unit testspnpm test runs the unit and type tests, including coverage thresholdspnpm lint runs the lint checksCopyright (c) 2013-2026 Ghost Foundation - Released under the MIT license.