UNPKG

@ryhrm-gz/xincodo-lib

Version:

Utilities for working with Xincodo body documents.

70 lines (46 loc) 1.12 kB
# Article Metadata Preparation Checklist Use this when composing article-page data from a validated `Body`. ## Before This Step - [ ] Persisted JSON has passed `safeMigrateBody` - [ ] Save or publish pipeline has run `lintBody` - [ ] Blocking policy has handled `report.errors` - [ ] The consuming application has decided how to handle warnings ## Prepare Headings Use: ```ts extractHeadingAnchors(body); ``` Keep: - `anchorId` - `href` - `level` - `text` Do not manually slug heading text. ## Prepare Text Metadata Use: ```ts toPlainText(body); createExcerpt(body, { maxLength: 160, preserveWords: true }); estimateReadingTime(body); ``` Choose excerpt length and word-preservation policy in the application. ## Prepare Resource Metadata Use: ```ts collectImageSources(body); collectLinks(body); ``` Image sources can come from: - image blocks - gallery images - callout image icons Links can come from: - text inline links - page link blocks ## Out of Scope Do not add skill guidance for: - HTML rendering - React components - DB schema or persistence - API request handling - image upload flows