renderPublishingGuide
functionRenders a caller-approved selection into a self-contained HTML guide and a plain-text README. The HTML uses local relative file links and an inline script permitted by its exact CSP hash.
renderPublishingGuide(
guide: IPublishingGuide,
copy?: ReadonlyMap<string, string>,
options?: IPublishingGuideOptions,
): IPublishingGuideResultParameters
guideIPublishingGuideThe title, selected files and optional channel steps.
copy?ReadonlyMap<string, string>Reviewed literal text keyed by selected local filename.
Defaults to
....options?IPublishingGuideOptionsThe guide interface locale.
Defaults to
{}.
Returns
IPublishingGuideResultThe HTML and plain-text documents.
Throws
INVALID_PUBLISHING_GUIDEThe publishing guide input is invalid.
import { renderPublishingGuide } from 'jg-publishing-guides';
const { html, readme } = renderPublishingGuide(
{
title: 'Reviewed caption',
summary: 'Selected copy for manual publication.',
files: [{ path: 'caption.txt', label: 'Caption', details: 'Reviewed text.', kind: 'file' }],
},
new Map([['caption.txt', 'Copy for the published post.']]),
);
// write html to start-here.html and readme to readme.txt beside caption.txt
void [html, readme];