resFactory / factory

Resource Factory is a universal approach to originating, refining, and rendering Markdown, HTML, type-safe SQL, or other assets that could comprise static sites or engineering artifacts.
GNU Affero General Public License v3.0
0 stars 3 forks source link

Integrate content models for structured documents #53

Open shah opened 2 years ago

shah commented 2 years ago

ActiveMDX has some great ideas. Like they say in their introduction:

ActiveMDX lets you define a Content Model to represent different markdown / mdx files in your project. The Content Model lets you work with your writing, and the concepts and things you are writing about, as data.

This is a useful idea: perhaps we should allow any frontmatter to specify a Typescript interface or even a JSON Schema for validating Markdown.

We already support *.md.ts which can generate arbitrarily complex Markdown. Perhaps we need to allow the opposite, too: at runtime after Markdown is parsed into HTML, we can validate that the HTML conforms to a specific structured defined by JSON schema, Typescript interface, or another conformance library.

Something like this might work:

content-model: xyz.ts