GithubHelp home page GithubHelp logo

pombredanne / consecutive Goto Github PK

View Code? Open in Web Editor NEW

This project forked from debrouwere/consecutive

0.0 1.0 0.0 116 KB

Rename files so they always start with consecutive chapter numbers, optionally leaving gaps so you can knit in new chapters.

License: ISC License

Python 100.00%

consecutive's Introduction

Consecutive

You're writing a novel, a technical manual, a thesis, and it's organized like so:

1-introduction.md
2-literature.md
3-research.md
4-conclusion.md

But then you decide you need a "methods" chapter in between the literature and the research, and unlike a word processor, your filesystem doesn't automatically update your chapter numbers. So you delete a file here and want to squeeze in another chapter there, and it's terribly annoying to have to rename all of those files to keep them in order.

This little consecutive executable will rename all files you hand it so they have a consecutive numbering. And when you need room for a new chapter, pass on any gaps consecutive should leave in the numbering, and gaps there will be.

Usage

# after you've deleted a chapter, you can redo the entire numbering like this
ls *.md | consecutive

# the same thing works marvelously when you've reached chapter ten
# and need to pad all previous chapter numbers with a zero
ls *.md | consecutive

# to create a new chapter 3 and 4 and bump up all subsequent chapters
ls *.md | consecutive 3 4

Installation

sudo wget https://raw.githubusercontent.com/stdbrouw/consecutive/master/consecutive -O /usr/local/bin/consecutive;
sudo chmod +x /usr/local/bin/consecutive;

consecutive's People

Contributors

debrouwere 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.