Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/reedjones/story-elements
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.
https://github.com/reedjones/story-elements
content content-model content-modelling contentlayer contentlayer-nextjs data-model data-modeling narrative storytelling typescript
Last synced: 5 days ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/reedjones/story-elements
- Owner: reedjones
- Created: 2024-10-16T18:52:40.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-10-16T19:31:34.000Z (3 months ago)
- Last Synced: 2024-11-07T17:07:01.048Z (about 2 months ago)
- Topics: content, content-model, content-modelling, contentlayer, contentlayer-nextjs, data-model, data-modeling, narrative, storytelling, typescript
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/story-elements
- Size: 335 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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
- [x] create type schemas
- [x] create contentlayer models
- [ ] create react component templates / generator
- [ ] create react components for each entity/type
## Installation
### ContentLayer version
If you're working with ContentLayer:
```bash
npm install story-elements/content-layer
```Generic version:
For a plain JavaScript/TypeScript project:
```bash
npm install story-elements/generic
```Usage
ContentLayer Example:
```javascript
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:
```javascriptimport { Conflict, Theme } from 'story-elements/generic';
const exampleContent = {
conflict: {
description: 'Main user challenge',
type: 'internal',
},
theme: {
name: 'Innovation',
description: 'Focus on cutting-edge technology',
},
};
```