Coder Social home page Coder Social logo

jsit / sassdoc-to-snippets Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 129 KB

Chew up a file or directory of SassDoc-commented Sass, spit out snippets

Home Page: https://www.npmjs.com/package/sassdoc-to-snippets

JavaScript 100.00%
sassdoc snippets snippets-editor

sassdoc-to-snippets's Introduction

SassDoc to Snippets

Convert SassDoc-commented Sass to snippets files.

Ignores privately-scoped mixins/functions/variables.

Can be used in Gulp et al.

Usage

sassdoc-to-snippets ./scss/ -f vscode -o ./scss.json

(requires trailing slash for directories)

Gulp

const sassdocToSnippets = require('sassdoc-to-snippets');

gulp.task('sassdoc-to-snippets', function() {
  return sassdocToSnippets({
    src: './stylesheets/scss/',
    dest: './snippets/scss.json',
  })
});

Flags

  • -o filename: Output to filename
  • -f format: Render snippets in format format
  • -p prefix: Prefix snippet expansions with prefix (for when you're namespacing with Sass modules)
  • --debug: Output the processed SassDoc data as well as the resulting snippets

Example

Input

/// Add padding around an element
///
/// @param {String} $value
@mixin add-padding($value) {
  padding: $value;
}

Output

{
  "add-padding": {
    "prefix": "add-padding",
    "description": "Add padding around an element",
    "body": [
      "add-padding(${1:$value})"
    ]
  }
}
snippet add-padding
abbr Add padding around an element
  add-padding(${1:$value})

Contributing

Edit in src, run npm run build to compile.

Know of a snippet syntax for some other editor? Please file an Issue or PR!

sassdoc-to-snippets's People

Contributors

jsit avatar

Stargazers

 avatar

Watchers

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