• Blogs (9)
    • 📱 236 - 992 - 3846

      đź“§ jxjwilliam@gmail.com

    • Version: ‍🚀 1.1.0
  • some summery about grunt, jsdoc, git

    Blogs20142014-07-10


    1. git

    Besides `git` status, reflog, diff, stash, rebase, reset HEAD~1, here are some useful:

    //sync branch issue3 with remote:
    $ git fetch origin issue3
    $ git reset --hard origin/issue3
    $ git clean -f -d
    
    // Your branch is ahead of 'xxxx' by N commits.
    $ git reset --hard HEAD~N
    $ git pull
    
    // -p, --prune
    // After fetching, remove any remote-tracking branches which no longer
    // exist on the remote.
    $ git fetch --prune

    2. grunt-init

    I want to generate a empty `Gruntfile.js` with a grunt-style testing env structure, the following are the steps:

    $ npm install grunt-init -g
    $ git clone https://github.com/gruntjs/grunt-init-jquery.git
        ~/.grunt-init/jquery
    $ mkdir jquery-template && cd -
    $ grunt-init jquery
    $ npm install
    $ grunt qunit
    
    // or install a empty project with an initial Gruntfile.js:
    $ git clone https://github.com/gruntjs/grunt-init-gruntfile.git
        ~/.grunt-init/gruntfile
    $ mkdir gruntfile-template && cd -
    $ grunt-init gruntfile

    3. JSDoc and Grunt-JSDoc

    JSDOC (http://usejsdoc.org/), grunt-jsdoc seems useful for documentation and README.md management.

    $ npm install grunt-jsdoc --save-dev
    // to add jsdoc section in Gruntfile.js -> grunt.initConfig.
    $ grunt jsdoc

    `grunt jsdoc` generate a doc folder with html documentation to reflect JSDOC comments in js file. There also has a grunt-jsdoc-to-markdown which converts `JSDoc` to `.md` file. Not good enough, but it make sense.