teesloane / ootliner

Generated Floating Table of Contents

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Small utility to add a floating table of contents a la Dropbox Paper



To add Ootliner to your page...

If you use a module bundler

install Ootliner with npm:

npm install --save ootliner

Then import the module, below is an example of using ootliner in a gatsby blog.

import ootliner from 'ootliner'

class BlogPostTemplate extends React.Component {
  componentDidMount() {
    ootliner()
  }
  
// ...

Just drop in the script (not using module bundler)

<script src="https://unpkg.com/ootliner@0.0.2/lib/index.js "></script>
<script> ootliner()</script>

Development

git clone https://github.com/teesloane/ootliner.git
cd ootliner
npm install
npm run dev
# Open ./example/index.html to view Ootliner in use.

About

Generated Floating Table of Contents


Languages

Language:JavaScript 61.7%Language:HTML 34.5%Language:CSS 3.8%