jasmine / jasmine.github.io

Source for Jasmine's documentation
https://jasmine.github.io
MIT License
567 stars 418 forks source link

Jasmine doc site

Contributing

Prepare your local environment

  1. Fork the repo
  2. Create your feature branch (git checkout -b my-new-docs)
  3. Ensure ruby and bundler (gem install bundler) are installed
  4. Install ruby dependencies (bundle)
    1. You can install them in the local folder, instead of globally for the system with (bundle install --path vendor/bundle)
  5. Install JS dependencies (npm install)

Make your changes

You're ready to make some changes to the documentation!

.
├── _api/                   # Auto-generated API documentation - don't edit by hand!
├── _faq/                   # Various FAQ pages
├── _includes/              # Jekyll snippets (headers, footers, etc.)
├── _layouts/               # Jekyll layouts (overall page structure)
├── _tutorials/             # Tutorials / How-to Articles
│   ├── src/                # Docco source files for "side-by-side" tutorials
│   ├── *.html              # Auto-generated docco tutorials - don't by edit by hand!
│   ├── *.md                # Newer markdown tutorials
├── css/                    # Stylesheets (SCSS)
├── examples/               # Raw javascript examples of jasmine tests (rare)
├── pages/                  # Various documentation pages

Note the auto-generated files _api/** and _tutorials/*.html, don't edit these files as any changes you make to them will be lost the next time the documentation is generated.

Test your changes

First, update the jasmine API docs:

Then, regenerate the tutorials:

Now preview your changes locally:

Publishing API docs for a new version of Jasmine

Submit your changes

Advanced: providing a live demo

If you're making complicated or potentially controversial changes to the documentation, it may make sense to provide a live demo that the reviewer can use to compare side-by-side with the current production site.

Setup

From the terminal in your local fork of jasmine.github.io, create the branch gh-pages:

Next, enable GitHub Pages for your fork:

Demoing your desired branch

Now that you've configured your live demo link to show the gh-pages branch, you can update what is shown at any time by resetting that branch to your newest changes. For example, if you've just pushed up the branch my-complicated-change, update your live demo by entering the following in your terminal:

Wait a few minutes, and you live demo will now be showing your changes in the my-complicated-change branch. You can then include a link to the demo in your pull request.