1.0.4 • Published 8 years ago

css-toc v1.0.4

Weekly downloads
3
License
ISC
Repository
github
Last release
8 years ago

CSS Table Of Contents

A NodeJS script used for making table of contents for CSS files.

Usage:

  • Comment your CSS-code using the standard "/ unicorn /"-syntax.
  • Don't add numbers(e.g "/*1. Article*/"), as the script does this for you.
    • I'll fix this later
  • Then run "css-toc args.css name of output.css"

Flags

  • f: The file you want to process
  • o: The file you want to process

  • n: Makes the script count the comments and add numbers to both the comments and the TOC

/*
Table of contents

1. Body
2. Navbar
3. Content
4. Article
5. Footer
*/
  • c: Capitalized the comments
/*
Table of contents

Body
Navbar
Content
Article
Footer
*/
  • l: Adds line numbers to the end of the items in the TOC
/*
Table of contents

body - 0
navbar - 5
content - 18
article - 23
footer - 28
*/

Example

This command 'css-toc -nc -f fileIn.css -o fileOut.css':

  /*navigation*/
  nav {
    ....
  }
  /*article*/
  .rticle {
    ....
  }
  /*footer*/
  footer {
    ....
  }

Results in:

  /*Table of contents*/

  1. Navigation
  2. Article
  3. Footer
  */


  /*1. Navigation */
  nav {
    ....
  }
  /*2. Article */
  article {
    ....
  }
  /*3. Footer */
  footer {
    ....
  }
1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago