Giter Site home page Giter Site logo

markdown-github-bear-toc's Introduction

Autogenerated Table of Contents for Github Markdown or Bear Notes

Generated by the script ;)

Table of Contents

Overview

I love using Bear Notes for note taking of all sorts. Recently, Bear released a feature that allowed headers to be linked with x-callback-urls. And thus, I created a script to autogenerate a Table of Contents for your notes based on the headers.

Installation

NOTE: This program is only compatible with Python 3.x

PyPi (Preferred)

$ pip3 install markdown-toc --upgrade

Manually

$ git clone https://github.com/alexander-lee/markdown-github-bear-toc.git

$ cd markdown-github-bear-toc
$ python3 setup.py install

Usage

Flags

  • -h or --header-priority is the Limiting Header Priority/Strength (whether you limit your Table of Contents to h3s or h4s)
  • -t or --type is the type of anchor you want to use (Github or Bear x-callback-url)
  • --no-write is a flag on whether you want to disable the feature that automatically injects the ToC into your Markdown file or Bear Note
  • -toc or --table-of-contents-style is the Markdown style for your Table of Contents header

With Bear

  • Add a Table of Contents to a Bear Note with the title "Bear Note Title"
$ markdown-toc -h <default: 3> -t bear [--no-write] "Bear Note Title"

  • Add a Table of Contents to a Bear Note with the UUID 20703126-FA33-400A-B98E-F55F57E3EF48-47683-000143B2335758CA
$ markdown-toc -h <default: 3> -t bear [--no-write] "20703126-FA33-400A-B98E-F55F57E3EF48-47683-000143B2335758CA"

  • Add a Table of Contents to two Bear Notes with titles "Bear Note Title 1" and "Bear Note Title 2"
$ markdown-toc -h <default: 3> -t bear [--no-write] "Bear Note Title 1" "Bear Note Title 2"

  • Add a Table of Contents to all Bear Notes that contain the tag #bear OR tag #beet
$ markdown-toc -h <default: 3> -t bear [--no-write] "#bear" "#beet"

  • This allows you to take input a list of Bear Note titles, tags, or UUIDs and will inject the ToC into your note whether or not you submit the --no-write flag.
  • If you have #tags at the top of your note (cause I use them to categorize my notes), it will inject the ToC right after any tags.
Original Note Note with ToC
Original Note Note with ToC

With Markdown Files

  • Add of a Table of Contents to README.md (Using Github Anchors)
$ markdown-toc -h <default: 3> -t github [--no-write] README.md

  • Add of a Table of Contents to README.md and Folder/README2.md (Using Github Anchors)
$ markdown-toc -h <default: 3> -t github [--no-write] README.md Folder/README2.md

markdown-github-bear-toc's People

Contributors

alexander-lee avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.