Skip to content

Commit 78f15dc

Browse files
committed
docs: super-charge docs
1 parent c98cd78 commit 78f15dc

9 files changed

+111
-35
lines changed

docs/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@
1212

1313
## Install
1414

15-
```sh
15+
```bash
1616
npm install -g @commitlint/cli @commitlint/config-angular
1717
```
1818

1919
## Configure
2020

21-
```
21+
```bash
2222
echo "module.exports = {extends: [@commitlint/config-angular']}" > .commitlint.config.js
2323
```
2424

2525
## Test
2626

27-
```
27+
```bash
2828
# Lint from stdin
2929
echo 'foo: bar' | commitlint
3030
⧗ input: foo: bar

docs/_navbar.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<a href="https://github.com/marionebl/commitlint" title="Contribute on GitHub" target="_blank" rel="nofollow">
2+
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 512 499.36"><path d="M256,6.32c-141.36,0-256,114.61-256,256,0,113.09,73.34,209,175.08,242.9,12.8,2.35,17.47-5.56,17.47-12.34,0-6.08-.22-22.18-.35-43.54C121,464.83,106,415,106,415c-11.64-29.57-28.42-37.45-28.42-37.45C54.31,361.71,79.31,362,79.31,362c25.69,1.81,39.21,26.38,39.21,26.38,22.84,39.12,59.92,27.82,74.5,21.27,2.33-16.54,8.94-27.82,16.25-34.22C152.43,369,92.67,347,92.67,248.94c0-27.95,10-50.8,26.35-68.69-2.63-6.48-11.42-32.5,2.51-67.75,0,0,21.49-6.88,70.4,26.24a242.65,242.65,0,0,1,128.18,0c48.87-33.13,70.33-26.24,70.33-26.24,14,35.25,5.18,61.27,2.55,67.75,16.41,17.9,26.31,40.75,26.31,68.69,0,98.35-59.85,120-116.88,126.32,9.19,7.9,17.38,23.53,17.38,47.41,0,34.22-.31,61.83-.31,70.23,0,6.85,4.61,14.81,17.6,12.31C438.72,471.29,512,375.4,512,262.34,512,120.94,397.37,6.32,256,6.32Z" transform="translate(0 -6.32)" fill-rule="evenodd"></path></svg>
3+
</a>
4+
<a href="https://gitter.im/commitlint/Lobby" title="Reach us on Gitter" target="_blank" rel="nofollow">
5+
<svg version="1.1" width="30" height="30" viewBox="0 0 177.25 177.25" enable-background="new 0 0 177.25 177.25" xml:space="preserve">
6+
<g>
7+
<rect x="61" y="41.5" width="8.25" height="61"/>
8+
<rect x="110.75" y="55.5" width="8.25" height="47"/>
9+
<rect x="77.5" y="55.5" width="8.25" height="80.25"/>
10+
<rect x="94.25" y="55.5" width="8.25" height="80.25"/>
11+
</g>
12+
</svg>
13+
</a>

docs/concepts-shareable-config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = {
1212

1313
This causes `commitlint` to pick up `commitlint-config-example`. Make it available by installing it.
1414

15-
```
15+
```bash
1616
npm install --save-dev commitlint-config-example
1717
```
1818

docs/guides-ci-setup.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Enforce commit conventions with confidence by linting on your CI servers with `c
66

77
## Install
88

9-
```sh
9+
```bash
1010
# Create a git repository if needed
1111
git init
1212

@@ -22,7 +22,7 @@ echo "module.exports = {extends: ['@commitlint/config-angular']};"
2222

2323
Add a `.travis.yml` to your project root
2424

25-
```yml
25+
```yaml
2626
# .travis.yml
2727
language: node_js
2828
before_install: git fetch --unshallow
@@ -34,14 +34,14 @@ script:
3434
Make sure Travis is connected to your git repository.
3535
Trigger a build by pushing to your repository.
3636
37-
```
37+
```bash
3838
git add .
3939
git commit -m "add travis stuff"
4040
```
4141

4242
We expect this build to fail:
4343

44-
```
44+
```yaml
4545
...
4646
./node_modules/.bin/commitlint --from=HEAD~1
4747
⧗ input: add travis stuff
@@ -57,7 +57,7 @@ Let's change that by using environment information provided by TravisCI.
5757

5858
Every build exposes the commit that triggered the build via `TRAVIS_COMMIT`.
5959

60-
```yml
60+
```yaml
6161
# .travis.yml
6262
language: node_js
6363
before_install: git fetch --unshallow
@@ -68,7 +68,7 @@ script:
6868
6969
That's a bit better, but we are not handling branches at all yet. Travis provides the branch we are on via `TRAVIS_BRANCH`.
7070

71-
```yml
71+
```yaml
7272
# .travis.yml
7373
language: node_js
7474
before_install: git fetch --unshallow
@@ -84,7 +84,7 @@ Nice. This handles direct commits and PR originating from the same repository. L
8484

8585
We'll have to differentiate between forks and same-repo PRs on our own and move the linting to a dedicated script.
8686

87-
```yml
87+
```yaml
8888
# .travis.yml
8989
language: node_js
9090
before_install: git fetch --unshallow
@@ -94,7 +94,7 @@ script:
9494
- npm test
9595
```
9696

97-
```sh
97+
```bash
9898
# lint-commits.sh
9999
#!/bin/bash
100100
set -e

docs/guides-local-setup.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This guide demonstrates how to achieve this via git hooks.
99
Install `commitlint` and a `commitlint-config-*` of your choice as devDependency and
1010
configure `commitlint` to use it.
1111

12-
```sh
12+
```bash
1313
# Create a package.json if needed
1414
npm init
1515

@@ -22,7 +22,7 @@ echo "module.exports = {extends: ['@commitlint/config-angular']};"
2222

2323
Install `husky` as devDependency, a handy git hook helper available on npm.
2424

25-
```sh
25+
```bash
2626
npm install --save-dev husky
2727
```
2828

@@ -42,7 +42,7 @@ Using `commitmsg` gives us exactly what we want: It is executed everytime a new
4242

4343
You can test the hook by simple commiting. You should see something like this if everything works.
4444

45-
```
45+
```bash
4646
git commit -m "foo: this will fail"
4747
husky > npm run -s commitmsg
4848

docs/guides-upgrade.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Version 1 to 2
44

5-
```sh
5+
```bash
66
npm install --save-dev conventional-changelog-lint@latest
77
```
88

@@ -22,7 +22,7 @@ npm install --save-dev conventional-changelog-lint@latest
2222

2323
## Version 2 to 3
2424

25-
```sh
25+
```bash
2626
npm remove --save-dev conventional-changelog-lint
2727
npm install --save commitlint
2828
mv .conventional-changelog-lintrc .commitlintrc

docs/guides-use-prompt.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## Install
66

7-
```sh
7+
```bash
88
# Create a git repository if needed
99
git init
1010

@@ -30,7 +30,7 @@ To make prompt-cli easy to use, add a npm run-script to your `package.json`
3030

3131
Test the prompt by executing
3232

33-
```sh
33+
```bash
3434
git add .
3535
npm run commit
3636
```

docs/index.html

Lines changed: 77 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,84 @@
11
<!DOCTYPE html>
22
<html lang="en">
3+
34
<head>
4-
<meta charset="UTF-8">
5-
<title>commitlint - Lint commit messages</title>
6-
<meta name="description" content="Lint commit messages">
7-
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
8-
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/vue.css">
5+
<meta charset="UTF-8">
6+
<title>commitlint - Lint commit messages</title>
7+
<meta name="description" content="Lint commit messages">
8+
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
9+
<link rel="stylesheet" href="https://unpkg.com/docsify/lib/themes/dark.css">
10+
<style>
11+
.app-nav.app-nav {
12+
display: flex;
13+
justify-content: flex-end;
14+
align-items: center;
15+
position: fixed;
16+
margin: 0;
17+
padding: 0 15px;
18+
height: 60px;
19+
background: #3f3f3f;
20+
}
21+
svg {
22+
pointer-events: none;
23+
}
24+
a svg {
25+
cursor: pointer;
26+
fill: #c8c8c8;
27+
}
28+
a:hover svg {
29+
fill: #ea6f5a;
30+
fill: var(--theme-color,#ea6f5a);
31+
}
32+
.search.search {
33+
border: none;
34+
padding: 0;
35+
}
36+
.search.search input {
37+
background: transparent;
38+
line-height: 40px;
39+
padding: 6px;
40+
background: rgba(255, 255, 255, 0.05);
41+
border-bottom: 1px solid transparent;
42+
}
43+
.search.search input:focus {
44+
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
45+
}
46+
.search.search .results-panel {
47+
background: #3f3f3f;
48+
}
49+
.search.search .matching-post {
50+
padding: 6px;
51+
margin: 6px;
52+
background: rgba(255, 255, 255, 0.025);
53+
border: 1px solid rgba(255, 255, 255, 0.1);
54+
}
55+
.search.search .matching-post:last-child {
56+
border: 1px solid rgba(255, 255, 255, 0.1);
57+
}
58+
</style>
959
</head>
60+
1061
<body>
11-
<div id="app"></div>
62+
<div id="app"></div>
63+
<script>
64+
window.$docsify = {
65+
name: 'commitlint',
66+
repo: '',
67+
loadNavbar: true,
68+
loadSidebar: true,
69+
subMaxLevel: 2,
70+
search: {
71+
paths: 'auto',
72+
placeholder: 'Search'
73+
}
74+
}
75+
</script>
76+
<script src="https://unpkg.com/docsify/lib/docsify.min.js"></script>
77+
<script src="https://unpkg.com/docsify/lib/plugins/search.min.js"></script>
78+
<script src="https://unpkg.com/prismjs/components/prism-typescript.min.js"></script>
79+
<script src="https://unpkg.com/prismjs/components/prism-json.min.js"></script>
80+
<script src="https://unpkg.com/prismjs/components/prism-yaml.min.js"></script>
81+
<script src="https://unpkg.com/prismjs/components/prism-bash.min.js"></script>
1282
</body>
13-
<script>
14-
window.$docsify = {
15-
name: 'commitlint',
16-
repo: '',
17-
loadSidebar: true
18-
}
19-
</script>
20-
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
83+
2184
</html>

docs/reference-cli.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
## Installation
44

5-
```shell
5+
```bash
66
npm install --save-dev @commitlint/cli
77
```
88

99
## Usage
1010

11-
```shell
11+
```bash
1212
❯ commitlint --help
1313
commitlint - Lint commit messages
1414

0 commit comments

Comments
 (0)