Slash forward icon
  • Documentation
  • Plugins
  • API Reference
  • Examples
  • GitHub
    • comarkContent
    • content.get
    • content.list
    • content.navigation
    • content.stat
    • content.getSource
    • content.handler
    • content.watch
    • content.update
    • content.remove
    • content.cache
    • content.manifest
    • content.hooks
    • content.status
    • content.init
    • content.loadSnapshot
    • content.addParser
    • content.addListingFields
    • content.addServeHandler
    • createContentClient
    • content.get
    • content.list
    • content.navigation
    • defineContentPlugin
    • defineContentClientPlugin
    • Content
    • Client
    • Plugins
    • Typegen
    • File parsed
  • Cheat Sheet
  • CLI
Reference

content.addParser()

Register a parser for one or more file extensions.

content.addParser(extensions, parse)

Registers a Parser for one or more file extensions, so those files become documents. Used by the json and yaml plugins.

Parameters:

  • extensions: an array of dotted extensions, e.g. ['.json'].
  • parse: a Parser function.

Returns: void

Usage

usage.ts
content.addParser(['.json'], parseJson)

content.loadSnapshot

Hydrate one source's parsed bodies into the cache from a snapshot.

content.addListingFields

Limit which frontmatter fields listings keep for the given extensions.

On this page

  • content.addParser(extensions, parse)
  • Usage
  • Edit this page on GitHub
  • Star on GitHub
  • Comark docs
© 2026 Vercel, Inc.