Svelte Markdoc screenshot

Svelte Markdoc

Author Avatar Theme by Joshnuss
Updated: 16 May 2022
35 Stars

Markdoc preprocessor for Svelte

Overview

svelte-markdoc is a preprocessor for Svelte that allows users to create pages with the .markdoc extension. It is a more constrained editing system where documentation is treated as data, making it different from MDX.

Features

  • Svelte integration
  • Support for creating pages with .markdoc extension
  • Constrained editing system for documentation

Installation

To use svelte-markdoc, follow these steps:

  1. Create a SvelteKit project.
  2. Install the svelte-markdoc package.
  3. Create a markdoc.config.js file in the root folder to hold your markdoc config.
  4. Configure the preprocessor in svelte.config.js.
  5. Create pages with the .markdoc extension in src/routes.

Here is an example of how to configure the preprocessor in svelte.config.js:

import { svelteMarkdoc } from 'svelte-markdoc';

export default {
  preprocess: [svelteMarkdoc()],
};

Summary

svelte-markdoc is a useful preprocessor for Svelte that allows users to create pages with the .markdoc extension. It provides a more constrained editing system for documentation compared to MDX and integrates well with SvelteKit projects. With svelte-markdoc, users can easily manage and display their documentation as data within their Svelte applications.