Code Monkey home page Code Monkey logo

angular-ui-docs's Introduction

Angular UI Docs

Doc generator of Angular-ui modules.

This generator use Grunt, AngularJS, RequireJS and jQuery.

How to add it !

Add it as a bower component.

bower install git://github.com/angular-ui/angular-ui-docs.git

or add to your bower.json

  "devDependencies": {
    "angular-ui-docs": "angular-ui/angular-ui-docs"
  }

It's working with ssh deploy key ! You can find a quick tuto here.

After you added your deploy key to GitHub and Travis (in .travis.yml). Add a global value with your repo name, like :

env:
  global:
  - REPO="[email protected]:<org>/<repo>.git"
  - secure: ! 'MR37oFN+bprRlI1/YS3...etc...

Then add the scripts and limit the build-able branches.

before_script: out/.travis/before_script.sh
after_success: out/.travis/after_success.sh
branches:
  only:
  - <branch>

Don't forget to create and push an orphan gh-pages branch.

Make your demo !

Travis will automatically run grunt build-doc ! First you need to generate the index.html using grunt-contrib-copy

  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    meta: {
      view : {
        humaName : "UI <repo>",
        repoName : "<the github repo name>",
        demoHTML : grunt.file.read("demo/demo.html"),
        demoJS   : grunt.file.read("demo/demo.js"),
        css : [
          '<any required css files>'
        ],
        js : [
          '<any required script files>'
        ]
      }
    },
    copy: {
      template : {
        options : {processContent : (function(content){
          return grunt.template.process(content);
        })},
        files: [
          {src: ['out/.tmpl/index.tmpl'], dest: 'out/index.html'}
        ]
      }
    }

This will generate index.html using :

  • the description in the package.json,
  • the meta.view.humaName as title of the demo site,
  • the meta.view.repoName in the github links,

See it working locally !

Actually the demo must be built ! We are using bower and grunt for this.

First in you UI project run

npm install && bower install
grunt build-doc

Then run a localhost on bower_components/angular-ui-docs

cd bower_components/angular-ui-docs
python -m SimpleHTTPServer
or
php -S localhost:8000

and you'll have the generated website on http://localhost:8000/

angular-ui-docs's People

Contributors

douglasduteil avatar proloser avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

angular-ui-docs's Issues

The goal

Hi

What's the goal of this repo ?

The description says :

Helper component for building your angular modules as bower components 

But don't see any relation with Bower here...
I mean for me a good repo for bower is a repo with only built files like bower-angular.
So no docs, non travis, etc...

I get it wrong ?

Getting use of the "client" README

Hi

It's strange to have a copy of this repo's README in each repo gh-pages branch which use the doc generator.

I'm thinking of using their README to replace this one and to add content to the generated site.

Forks problem

Like Travis is really sensible to the ssh configuration, forks have to have a deploy key to be built by Travis ๐Ÿ‘Ž (see before_script.sh#L10, before_script.sh#L23).

It would be better to just add an environment variable to track if Travis is authenticated.
Then we only run after_success.sh if it is.

Adding restriction for more flexibility

Unifying buildable branches

Currently the after_success.sh runs only if the build isn't a pull request so we whitelisted branches everywhere :

However testing if we are in the master branch can be done directly in the after_success.sh script by using the Travis environment variable : TRAVIS_BRANCH

So I propose to change the test to

[  "$TRAVIS_PULL_REQUEST" == "true" ] || [  "$TRAVIS_BRANCH" != "master" ] && echo -e "Nothing to do\n" && exit 0

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.