JSFiddle - React, Tailwind, and code Playground

by aprilorange

HTML

<script src="https://unpkg.com/funbook"></script>
<link rel="stylesheet" href="https://unpkg.com/funbook/dist/funbook.css">
<div id="root"></div>

JavaScript

// In webpack you can 
// import FunBook from 'funbook'
// and `new FunBook()` directly
const book = new FunBook.default({
  title: 'My Awesome Book',
  nav: [{
    title: 'Home',
    path: '/'
  }]
})

// Add homepage
book.page({
  title: 'Home',
  path: '/',
  content: 'Home Page'
})

// Add a chapter
book.chapter({
  title: 'Intro',
  content: '<strong>My first chapter</strong>'
})

// Open book at `#root` element as a single page app (hash router)
book.open('#root', {
  routerMode: 'hash'
})