Skip to content
This repository has been archived by the owner on Nov 17, 2021. It is now read-only.

Commit

Permalink
feat(Stencila components addon): Addon for adding Stencila Web Compon…
Browse files Browse the repository at this point in the history
…ents for document nodes
  • Loading branch information
nokome committed Feb 19, 2020
1 parent 9c3a52e commit 65d84a9
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/addons/addons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
export const addons: {
mathjax: Promise<unknown>
prism: Promise<unknown>
stencilaComponents: Promise<unknown>
} = {
mathjax: import('./mathjax'),
prism: import('./prism')
prism: import('./prism'),
stencilaComponents: import('./stencilaComponents')
}
16 changes: 16 additions & 0 deletions src/addons/stencilaComponents/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Stencila Web Components addon

Adds Stencila's [Web Components](https://github.com/stencila/designa/tree/master/packages/components) to provide interactivity to certain types of document nodes.

Currently the following node types have Web Components:

| Node type | Custom element |
| ---------------- | ---------------------------- |
| `CodeChunk` | `<stencila-code-chunk>` |
| `CodeExpression` | `<stencila-code-expression>` |

## Notes

- We anticipate that more components will be added over time, for other document nodes, to provide greater interactivity in documents.

- Theme authors should be able to override the styles of the web components as part of their theme.
1 change: 1 addition & 0 deletions src/addons/stencilaComponents/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import '@stencila/components/dist/stencila-components/stencila-components'
1 change: 1 addition & 0 deletions src/addons/stencilaComponents/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import '@stencila/components/dist/stencila-components/stencila-components.css';

0 comments on commit 65d84a9

Please sign in to comment.