Generating editor snippets from SassDoc

I’ve always loved SassDoc, and I’ve always loved editor snippets, but as a Vim and Neosnippets user, (a) other people’s (VSCode) snippets weren’t useful to me, and (b) my (Neosnippet) snippets weren’t useful to anybody else.

At some point it would be great to build a tool that can convert snippets of one format to any other format (IntelliJ? Atom?), but in the meantime I thought, “Where do we get snippets from to begin with?” Authoring them in the first place is a pain.

So after encountering a massive (massive) Sass library last week, one that was thoroughly marked up with comprehensive SassDoc comments, I realized the machine-readability of SassDoc makes it perfect for generating Sass snippets from.

So I made sassdoc-to-snippets, a command-line (or Gulp-compatible) tool for taking a directory or file of SassDoc-commented Sass and turning it into snippets files, for either VSCode or Neosnippet (and with other syntaces easily added).

Please try it out! Test it, bang on it, kick it, see what breaks it or how it could be improved and please let me know in a PR or Issue on GitHub.

Leave a Reply