Skip to content

Commit

Permalink
README updates
Browse files Browse the repository at this point in the history
  • Loading branch information
rameshvarun committed Aug 13, 2023
1 parent 059cf39 commit 8ca3c22
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<p align="center">[VIEW DEMO]</p>
</a>

Add interactive code cells to any webpage, similar to [Jupyter](https://jupyter.org/) or [ObservableHQ](https://observablehq.com/). Works with static site generators like Jekyll and Hugo.
Add interactive code cells to any webpage, similar to [Jupyter](https://jupyter.org/) or [ObservableHQ](https://observablehq.com/). Works with direct HTML editing, static site generators like Jekyll / Hugo, and much more.

Just drop JS / CSS import tags onto your page start creating code cells using `<script type="text/notebook-cell">` elements. blog-cells will transform these script tags into interactive, runnable code snippets.
Just drop in JS / CSS imports and start creating code cells using `<script type="text/notebook-cell">` elements. <b>blog-cells</b> will transform these script tags into interactive, runnable code snippets.

Try it on [CodePen](https://codepen.io/varunramesh/pen/WNYVNQQ) or [JSFiddle](https://jsfiddle.net/varunramesh/o217xpc5/8/).

Expand All @@ -22,6 +22,10 @@ console.log("Hello World!");
<script type="module" src="https://cdn.jsdelivr.net/gh/rameshvarun/[email protected]/dist/blog-cells.js"></script>
```

## pre.notebook-cell

If you want to fallback properly in noscript cases, instead of script tags, you can use `<pre class="notebook-cell">` elements, however reserved HTML characters should be escaped using [HTML entities](https://developer.mozilla.org/en-US/docs/Glossary/Entity). I recommend setting up your static-site generator to do this (TODO: Examples).

## Alternatives
- https://starboard.gg/
- https://observablehq.com/
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ <h1><a href="https://github.com/rameshvarun/blog-cells">blog-cells</a> demo</h1>
}
</script>

<p>You can query APIs using fetch.</p>
<p>You can query CORS-enabled APIs using fetch.</p>

<script type="text/notebook-cell" data-autorun="true">
const response = await fetch("https://pokeapi.co/api/v2/pokemon/ditto");
Expand Down

0 comments on commit 8ca3c22

Please sign in to comment.