Merge pull request #1408 from PeterDaveHello/doctoc

[Docs] [Tests] Introduce doctoc for "Table of Contents" autogeneration
Jordan Harband 2017-03-01 00:57:05 -08:00 committed by GitHub
commit 286090b607
3 changed files with 36 additions and 24 deletions

View File

@ -13,6 +13,7 @@ addons:
- ksh - ksh
cache: cache:
directories: directories:
- $HOME/.npm
- $HOME/.ghc - $HOME/.ghc
- $HOME/.cabal - $HOME/.cabal
- $TRAVIS_BUILD_DIR/.cache - $TRAVIS_BUILD_DIR/.cache
@ -21,14 +22,16 @@ before_install:
- curl --version - curl --version
- wget --version - wget --version
- if [ -n "${SHELLCHECK-}" ]; then cabal update && cabal install transformers-0.4.3.0 ShellCheck && shellcheck --version ; fi - if [ -n "${SHELLCHECK-}" ]; then cabal update && cabal install transformers-0.4.3.0 ShellCheck && shellcheck --version ; fi
- if [ -n "${DOCTOCCHECK-}" ]; then nvm install node && npm install -g doctoc && type doctoc ; fi
install: install:
- (mkdir /tmp/urchin && cd /tmp/urchin && curl -s "$(curl -s https://registry.npmjs.com/urchin | grep -Eo '"tarball":\s*"[^"]+"' | tail -n 1 | awk -F\" '{ print $4 }')" -O && tar -x -f urchin*) - (mkdir /tmp/urchin && cd /tmp/urchin && curl -s "$(curl -s https://registry.npmjs.com/urchin | grep -Eo '"tarball":\s*"[^"]+"' | tail -n 1 | awk -F\" '{ print $4 }')" -O && tar -x -f urchin*)
- chmod +x /tmp/urchin/package/urchin - chmod +x /tmp/urchin/package/urchin
- '[ -z "$WITHOUT_CURL" ] || sudo apt-get remove curl -y' - '[ -z "$WITHOUT_CURL" ] || sudo apt-get remove curl -y'
script: script:
- if [ -n "${DOCTOCCHECK-}" ]; then cp README.markdown README.markdown.orig && npm run doctoc && diff -q README.markdown README.markdown.orig ; fi
- if [ -n "${SHELLCHECK-}" ]; then shellcheck -s bash nvm.sh && shellcheck -s sh nvm.sh && shellcheck -s dash nvm.sh && shellcheck -s ksh nvm.sh ; fi - if [ -n "${SHELLCHECK-}" ]; then shellcheck -s bash nvm.sh && shellcheck -s sh nvm.sh && shellcheck -s dash nvm.sh && shellcheck -s ksh nvm.sh ; fi
- if [ -n "${SHELLCHECK-}" ]; then shellcheck -s bash install.sh bash_completion nvm-exec ; fi - if [ -n "${SHELLCHECK-}" ]; then shellcheck -s bash install.sh bash_completion nvm-exec ; fi
- if [ -z "${SHELLCHECK-}" ]; then make TEST_SUITE=$TEST_SUITE URCHIN=/tmp/urchin/package/urchin test-$SHELL ; fi - if [ -n "${SHELL-}" ] && [ -n "${TEST_SUITE}" ]; then make TEST_SUITE=$TEST_SUITE URCHIN=/tmp/urchin/package/urchin test-$SHELL ; fi
env: env:
global: global:
- CXX=g++-4.8 - CXX=g++-4.8
@ -36,6 +39,7 @@ env:
- PATH="~/.cabal/bin/:$(echo $PATH | sed 's/::/:/')" - PATH="~/.cabal/bin/:$(echo $PATH | sed 's/::/:/')"
- NVM_DIR="${TRAVIS_BUILD_DIR}" - NVM_DIR="${TRAVIS_BUILD_DIR}"
matrix: matrix:
- DOCTOCCHECK=true
- SHELLCHECK=true - SHELLCHECK=true
- SHELL=bash TEST_SUITE=install_script - SHELL=bash TEST_SUITE=install_script
- SHELL=sh TEST_SUITE=fast - SHELL=sh TEST_SUITE=fast

View File

@ -1,27 +1,33 @@
# Node Version Manager [![Build Status](https://travis-ci.org/creationix/nvm.svg?branch=master)][3] [![nvm version](https://img.shields.io/badge/version-v0.33.1-yellow.svg)][4] [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/684/badge)](https://bestpractices.coreinfrastructure.org/projects/684) # Node Version Manager [![Build Status](https://travis-ci.org/creationix/nvm.svg?branch=master)][3] [![nvm version](https://img.shields.io/badge/version-v0.33.1-yellow.svg)][4] [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/684/badge)](https://bestpractices.coreinfrastructure.org/projects/684)
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
## Table of Contents ## Table of Contents
- [Installation](#installation) - [Installation](#installation)
- [Install script](#install-script) - [Install script](#install-script)
- [Verify installation](#verify-installation) - [Verify installation](#verify-installation)
- [Manual install](#manual-install) - [Manual install](#manual-install)
- [Manual upgrade](#manual-upgrade) - [Manual upgrade](#manual-upgrade)
- [Usage](#usage) - [Usage](#usage)
- [Long-term support](#long-term-support) - [Long-term support](#long-term-support)
- [Migrating global packages while installing](#migrating-global-packages-while-installing) - [Migrating global packages while installing](#migrating-global-packages-while-installing)
- [io.js](#iojs) - [io.js](#iojs)
- [System version of node](#system-version-of-node) - [System version of node](#system-version-of-node)
- [Listing versions](#listing-versions) - [Listing versions](#listing-versions)
- [.nvmrc](#nvmrc) - [.nvmrc](#nvmrc)
- [Deeper Shell Integration](#deeper-shell-integration) - [Deeper Shell Integration](#deeper-shell-integration)
- [License](#license) - [zsh](#zsh)
- [Running tests](#running-tests) - [Calling `nvm use` automatically in a directory with a `.nvmrc` file](#calling-nvm-use-automatically-in-a-directory-with-a-nvmrc-file)
- [Bash completion](#bash-completion) - [License](#license)
- [Usage](#usage-1) - [Running tests](#running-tests)
- [Compatibility Issues](#compatibility-issues) - [Bash completion](#bash-completion)
- [Installing nvm on Alpine Linux](#installing-nvm-on-alpine-linux) - [Usage](#usage-1)
- [Problems](#problems) - [Compatibility Issues](#compatibility-issues)
- [Installing nvm on Alpine Linux](#installing-nvm-on-alpine-linux)
- [Problems](#problems)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
## Installation ## Installation
@ -305,7 +311,7 @@ You can use [`avn`](https://github.com/wbyoung/avn) to deeply integrate into you
If you prefer a lighter-weight solution, the recipes below have been contributed by `nvm` users. They are **not** supported by the `nvm` development team. We are, however, accepting pull requests for more examples. If you prefer a lighter-weight solution, the recipes below have been contributed by `nvm` users. They are **not** supported by the `nvm` development team. We are, however, accepting pull requests for more examples.
#### Zsh #### zsh
##### Calling `nvm use` automatically in a directory with a `.nvmrc` file ##### Calling `nvm use` automatically in a directory with a `.nvmrc` file

View File

@ -13,7 +13,8 @@
"test/installation": "npm run --silent test/installation/node && npm run --silent test/installation/iojs", "test/installation": "npm run --silent test/installation/node && npm run --silent test/installation/iojs",
"test/installation/node": "shell=$(basename -- $(ps -o comm= $(ps -o ppid= -p $PPID)) | sed 's/^-//'); make TEST_SUITE=installation_node test-$shell", "test/installation/node": "shell=$(basename -- $(ps -o comm= $(ps -o ppid= -p $PPID)) | sed 's/^-//'); make TEST_SUITE=installation_node test-$shell",
"test/installation/iojs": "shell=$(basename -- $(ps -o comm= $(ps -o ppid= -p $PPID)) | sed 's/^-//'); make TEST_SUITE=installation_iojs test-$shell", "test/installation/iojs": "shell=$(basename -- $(ps -o comm= $(ps -o ppid= -p $PPID)) | sed 's/^-//'); make TEST_SUITE=installation_iojs test-$shell",
"test/sourcing": "shell=$(basename -- $(ps -o comm= $(ps -o ppid= -p $PPID)) | sed 's/^-//'); make TEST_SUITE=sourcing test-$shell" "test/sourcing": "shell=$(basename -- $(ps -o comm= $(ps -o ppid= -p $PPID)) | sed 's/^-//'); make TEST_SUITE=sourcing test-$shell",
"doctoc": "doctoc --title='## Table of Contents' --github README.markdown"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@ -35,6 +36,7 @@
"devDependencies": { "devDependencies": {
"replace": "^0.3.0", "replace": "^0.3.0",
"semver": "^5.0.1", "semver": "^5.0.1",
"urchin": "^0.0.5" "urchin": "^0.0.5",
"doctoc": "^1.2.0"
} }
} }