jmirc / end-user-documentation

End-user documentation sources and generator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Atomist 'end-user-documentation'

Build Status

This repository contains the markdown sources for the documentation for Atomist. You can find the current version of the Atomist documentation at https://docs.atomist.com/.

The documentation is generated from markdown using MkDocs.

Editing

Much of the documentation is hand-generated, so you can feel free to edit. We try to adhere to the Google Developer Documentation Style Guide. See [below][build-serve] for instructions on how to test your changes locally.

Content Reuse

Sometimes it's desirable to have certain content repeated in a page or duplicated across pages. This project uses a markdown-include plugin to include content from files in the docs/common directory prior to conversion to HTML. It uses the {!filename!} syntax, with all filenames relative to the docs/common directory.

e.g. to include the content from docs/common/handlers.md into user-guide/rug/commands.md, we simply add {!handlers.md!} to the desired location in user-guide/rug/commands.md.

Styles

We use the Admonition extension. Here are the available admonition styles:

  • summary tldr
  • hint important tip
  • check done success
  • attention caution warning
  • fail failure missing
  • danger error
  • bug
  • default (i.e., none of the above)

Items on the same line create a visually equivalent admonition.

Releasing

When a push is made to the master branch of this repository, the entire documentation is built again via a Travis job and published to http://atomist.github.io/end-user-documentation/ .

If the build is triggered by a tag of the form M.N.P, the site will be pushed to the docs.atomist.com S3 bucket hosting https://docs.atomist.com .

Build and serve the documentation locally

Before you push changes to this repository, you should test your changes locally.

Install dependencies

The project uses MkDocs to generate the static site and HTMLProofer to validate the generated HTML. Below are instructions to install them in a non-obtrusive way.

MkDocs

First install Python using Homebrew on Mac OS X.

$ brew install python3

or on GNU/Linux

$ sudo apt-get install python3
$ curl -O https://bootstrap.pypa.io/get-pip.py
$ sudo python3.5 get-pip.py

Then create a virtual environment to host the dependencies:

$ pip3 install virtualenv
$ mkdir ~/.venvs
$ echo "export PIP_REQUIRE_VIRTUALENV=true" >> ~/.bashrc
$ source ~/.bashrc
$ virtualenv -p `which python3` ~/.venvs/userdocs

With the virtual environment created, activate it in the current terminal:

$ . ~/.venvs/userdocs/bin/activate

and install the dependencies into it:

$ pip install -r requirements.txt

HTMLProofer

Install HTMLProofer using rbenv. First install rbenv.

$ brew install rbenv
$ eval "$(rbenv init -)"

Install a recent version of Ruby using rbenv and then set that as the version to be used in this project.

$ rbenv install 2.4.1
$ rbenv local 2.4.1

Install the bundler gem.

$ gem install bundler

Finally, install HTMLProofer.

$ bundle install

Testing and Serving

Every time you want to work on this repository, you need to activate the Python virtualenv in your working terminal:

$ . ~/.venvs/userdocs/bin/activate

After making changes, you can test them by building the documentation in strict mode and running HTMLProofer on the resulting site.

$ mkdocs build --strict && \
    bundle exec htmlproofer ./site --alt-ignore '/.*\/atomist-logo-horiz-reversed.svg$/' \
        --url-ignore https://api.github.com

To review your changes in a browser, you can serve the documentation locally by running:

$ mkdocs serve

and browse the documentation at http://127.0.0.1:8000 . To stop the server, press Ctrl-C in the terminal.

Updating Dependencies

The requirements.txt file sets specific versions for the packages. To update to new versions, you can use the following command:

$ ( cut -d = -f 1 requirements.txt > req.txt && \
      cat req.txt | xargs -n 1 pip install -U && \
      pip freeze -r req.txt > requirements.txt ) ; \
    rm req.txt

Shortcut

The activate_and_serve.sh script activates the virtual environment and builds, proofs, and serves the docs with a single command.

./activate_and_serve.sh

Conditions of use

This documentation build process is provided to the public purely for the purpose of testing documentation changes before submitting pull requests to the appropriate Atomist repository.

The documents produced by this build process may be published only on https://docs.atomist.com/ . They may not be published in any other form or on any other website without explicit permission.

About

End-user documentation sources and generator

License:GNU General Public License v3.0


Languages

Language:Shell 69.3%Language:Ruby 30.7%