Giter Club home page Giter Club logo

notepadplusplus-pythonscripts's Introduction

NotepadPlusPlus-PythonScripts

This repository contains Python scripts that can be used with the Notepad++ Python Script plugin.


Table of Contents


buildMarkdownTOC.py

This script is used to insert a table of contents into a markdown file. The markdown file is assumed to have

  • one heading level 1 heading (the document title)
  • two horizontal rules (lines containing three or more asterisks (***), dashes (---), or underscores (___) on the line by themselves) The table of contents will be inserted between the two horizontal rules, removing any text that is already there.

How it works

With the cursor positioned anywhere in the file, select menu item
Plugins ➡️ Python Script ➡️ Scripts ➡️ buildMarkdownTOC.
A pop-up will appear, asking you how many heading levels you want. The default is 2 (heading levels 2 and 3). Note that no table of contents lines are created for level 1 headings, as it is assumed that there is just one level 1 heading (i.e., the document title).

Installation instructions

  1. Add the Python Script plugin
    1. Select menu item Plugins ➡️ Plugins Admin...
    2. Search for and install Python Script
  2. Copy the buildMarkdownTOC.py file to (on Windows 10)
    <C:\Users\<USERNAME>\AppData\Roaming\Notepad++\plugins\config\PythonScript\scripts\buildMarkdownTOC.py>

Sample markdown files

The repository contains two sample files:

  • buildMarkdownTOC_sample_before.md: a markdown file with the two horizontal rules required for this script to work.
  • buildMarkdownTOC_sample_after_2Levels.md: the markdown file after the buildMarkdownTOC Python Script has been run, specifying 2 for the number of TOC levels.

notepadplusplus-pythonscripts's People

Contributors

mdunhamwilkie avatar

Watchers

 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.