Skip to content

Commit

Permalink
Merge pull request #49 from hildjj/html-versions
Browse files Browse the repository at this point in the history
Html versions
  • Loading branch information
hildjj authored Aug 30, 2024
2 parents 1b3cb07 + 9fcf43e commit 1d8293b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ This package supersedes [node-cbor](https://github.com/hildjj/node-cbor/tree/mai
- Complete break of API compatibility, allowing use of newer JavaScript constructs.
- No work-arounds for older environments.

## Start playing with cbor2 now

Visit the web [playground](https://hildjj.github.io/cbor2/playground/) for an
interactive view of how the library works.

## Supported Node.js versions

This project now only supports versions of Node.js that the Node team is
Expand Down
3 changes: 2 additions & 1 deletion web/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,8 @@ <h3>Options</h3>
</li>
</ul>
<div class="power">
Powered by <a href="https://github.com/hildjj/cbor2/">cbor2</a>.
Powered by <a href="https://github.com/hildjj/cbor2/">cbor2<span id="cbor2-version"></span></span></a> and
<a href="https://github.com/hildjj/cbor-edn/">cbor-edn<span id="cbor-edn-version"></span></a>.<br />
<a href="https://github.com/hildjj/cbor2/tree/main/web">Source</a>
</div>
</div>
Expand Down
6 changes: 5 additions & 1 deletion web/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import * as monaco from 'https://cdn.jsdelivr.net/npm/monaco-editor@0.49.0/+esm'
import {
Simple,
Tag,
version as cbor2version,
cdeDecodeOptions,
cdeEncodeOptions,
comment,
Expand All @@ -24,9 +25,9 @@ import {
compressString,
decompressString,
} from './encode.js';
import {version as ednVersion, parseEDN} from 'cbor-edn';
import {sortCoreDeterministic, sortLengthFirstDeterministic} from 'cbor2/sorts';
import {inspect} from 'node-inspect-extracted';
import {parseEDN} from 'cbor-edn';

const proxy = URL.createObjectURL(new Blob([`
self.MonacoEnvironment = {
Expand All @@ -52,6 +53,9 @@ const rejectStringsNotNormalizedAs =
const fontSize = 16;
const theme = 'vs-dark';

document.querySelector('#cbor2-version').innerText = `@${cbor2version}`;
document.querySelector('#cbor-edn-version').innerText = `@${ednVersion}`;

const inEditor = monaco.editor.create(itxt, {
detectIndentation: false,
fontSize,
Expand Down

0 comments on commit 1d8293b

Please sign in to comment.