Skip to content

Commit

Permalink
add basic usage
Browse files Browse the repository at this point in the history
  • Loading branch information
jackyzha0 committed Feb 11, 2022
1 parent 64608cf commit abc3ccf
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,28 @@ I've been thinking a lot about creating a browsable store of knowledge that prov
in creating more information scales than just a single document level.

## Usage
You can load it directly using a CDN as follows

```html
<script src="https://unpkg.com/telescopic-text/index.js"></script>
<link href="https://unpkg.com/telescopic-text/index.css" rel="stylesheet">
```

or manually include the `index.js` and `index.css` files in your project.

The package exports a function called `createTelescopicText` that returns a HTMLNode with your telescopic text inside.
Basic usage may look something like this:

```html
<div id="text-container"></div>

<script>
const node = createTelescopicText([
{text: "I made tea.", replacements: [
{og: "I", new: "Yawning, I", replacements: []}
]}]
])
const container = document.getElementById("text-container")
container.appendChild(node)
</script>
```

0 comments on commit abc3ccf

Please sign in to comment.