Skip to content

This library provides a comprehensive content model for narrative elements, usable in various contexts. You can install either the ContentLayer integration or the generic version.

Notifications You must be signed in to change notification settings

reedjones/story-elements

Repository files navigation

Story Elements Library

This library provides a comprehensive content model for narrative elements, usable in various contexts. You can install either the ContentLayer integration or the generic version.

todo

  • create type schemas
  • create contentlayer models
  • create react component templates / generator
  • create react components for each entity/type
story-elements

Installation

ContentLayer version

If you're working with ContentLayer:

npm install story-elements/content-layer

Generic version:

For a plain JavaScript/TypeScript project:

npm install story-elements/generic

Usage

ContentLayer Example:

import { Conflict, Theme } from 'story-elements/content-layer';

const Doc = defineDocumentType(() => ({
  name: 'Doc',
  filePathPattern: '**/*.md',
  fields: {
    conflict: { type: 'nested', of: Conflict },
    theme: { type: 'nested', of: Theme },
  },
}));```

Generic Example:
```javascript

import { Conflict, Theme } from 'story-elements/generic';

const exampleContent = {
  conflict: {
    description: 'Main user challenge',
    type: 'internal',
  },
  theme: {
    name: 'Innovation',
    description: 'Focus on cutting-edge technology',
  },
};

About

This library provides a comprehensive content model for narrative elements, usable in various contexts. You can install either the ContentLayer integration or the generic version.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published