Skip to content

Commit 8dd4f7f

Browse files
committed
Added: MkDocs documentation and readthedocs.io configuration
Fixes #853
1 parent a807f94 commit 8dd4f7f

33 files changed

Lines changed: 2149 additions & 1552 deletions

.editorconfig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
[*]
7+
indent_style = space
8+
indent_size = 2
9+
end_of_line = lf
10+
charset = utf-8
11+
trim_trailing_whitespace = true
12+
insert_final_newline = true
13+
14+
[*.md]
15+
indent_size = 4
16+
17+
[Makefile]
18+
indent_style = tab

.github/CONTRIBUTING.md

Lines changed: 38 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,64 @@
1-
Contributing to Goss
2-
====================
1+
# Contributing to Goss
32

4-
Thank you for your interest in contributing to Goss. Goss wouldn't be where it is today if it wasn't for people like you. Some ways you can contribute:
3+
Thank you for your interest in contributing to Goss. Goss wouldn't be where it is today if it wasn't for people like you.
4+
Some ways you can contribute:
55

6-
* Improve the [README](https://github.com/goss-org/goss/blob/master/README.md) and/or [Docs](https://github.com/goss-org/goss/blob/master/docs/manual.md) - This makes it easier for new users to learn goss.
6+
* Improve the [README](https://github.com/goss-org/goss/blob/master/README.md)
7+
and/or [Docs](https://github.com/goss-org/goss/blob/master/docs/).
8+
This makes it easier for new users to learn goss.
79
* Vote on bugs and feature requests by adding a :+1: reaction to the inital post.
810
* Create tutorials, blog posts and example use-cases on how to use Goss.
911
* Help users with [questions](https://github.com/goss-org/goss/labels/question) tracker.
1012
* Fix verified [bugs](https://github.com/goss-org/goss/issues?q=is%3Aopen+is%3Aissue+label%3Aapproved+label%3Abug+sort%3Areactions-%2B1-desc).
1113
* Implement approved [feature requests](https://github.com/goss-org/goss/issues?q=is%3Aopen+is%3Aissue+label%3Aapproved+label%3Aenhancement+sort%3Areactions-%2B1-desc).
1214
* Spread the word.
1315

16+
## Features and bug reports and questions
1417

15-
Features and bug reports and questions
16-
--------------------------------------
18+
Please search the [issues](https://github.com/goss-org/goss/issues) page before opening a feature request or a bug report.
19+
If a feature or a bug report already exists,
20+
please thumbs up the initial post to indicate it's importance to you and raise it's priority.
21+
Please comment and contribute to said issue if you feel it's deficient.
1722

18-
Please search the [issues](https://github.com/goss-org/goss/issues) page before opening a feature request or a bug report. If a feature or a bug report already exists, please thumbs up the initial post to indicate it's importance to you and raise it's priority. Please comment and contribute to said issue if you feel it's deficient.
19-
20-
Bug reports
21-
-----------
23+
## Bug reports
2224

2325
If you think you found a bug in Goss, please submit a [bug report](https://github.com/goss-org/goss/issues).
2426

25-
Feature requests
26-
----------------
27+
## Feature requests
2728

2829
If there's a feature you wish Goss would support, please open a feature request.
2930

3031
Some things to note prior to opening a Goss feature request:
31-
* Goss is intended to be quick and easy to learn.
32-
* Goss is focused on the 20% of the 80/20 rule. In other words, Goss focuses on the 20% of features that cover the core aspects of OS testing and benefit 80% of users.
33-
* Goss is intended to test the local machine it's running on. Tests aren't intended to be used to validate remote systems or endpoints.
34-
* Goss provides a generic [command](https://github.com/goss-org/goss/blob/master/docs/manual.md#command) runner to allow users to cover more nuanced test cases.
3532

36-
If you believe your feature adheres to the goals of Goss, please open a [feature request](https://github.com/goss-org/goss/issues) on GitHub which describes the feature you would like to see, why it is useful, and how it should work.
33+
* Goss is intended to be quick and easy to learn.
34+
* Goss is focused on the 20% of the 80/20 rule.
35+
In other words, Goss focuses on the 20% of features that cover the core aspects of OS testing and benefit 80% of users.
36+
* Goss is intended to test the local machine it's running on.
37+
Tests aren't intended to be used to validate remote systems or endpoints.
38+
* Goss provides a generic [command](https://goss.rocks/gossfile/#command) runner
39+
to allow users to cover more nuanced test cases.
3740

38-
Once a feature is submitted, it will be reviewed. Upon approval, the issue can be worked on and PRs can be submitted that implement this new feature.
41+
If you believe your feature adheres to the goals of Goss,
42+
please open a [feature request](https://github.com/goss-org/goss/issues) on GitHub
43+
which describes the feature you would like to see, why it is useful, and how it should work.
3944

45+
Once a feature is submitted, it will be reviewed.
46+
Upon approval, the issue can be worked on and PRs can be submitted that implement this new feature.
4047

41-
Contributing code and documentation changes
42-
-------------------------------------------
48+
## Contributing code and documentation changes
4349

44-
If you have a bugfix or new feature that you would like to contribute to Goss, please find or open an issue about it first. Talk about what you would like to do. It may be that somebody is already working on it, or that there are particular issues that you should know about before implementing the change.
50+
If you have a bugfix or new feature that you would like to contribute to Goss, please find or open an issue about it first.
51+
Talk about what you would like to do. It may be that somebody is already working on it,
52+
or that there are particular issues that you should know about before implementing the change.
4553

46-
We enjoy working with contributors to get their code accepted. There are many approaches to fixing a problem and it is important to find the best approach before writing too much code.
54+
We enjoy working with contributors to get their code accepted.
55+
There are many approaches to fixing a problem and it is important to find the best approach before writing too much code.
4756

48-
Note that it is unlikely the project will merge refactors for the sake of refactoring or niche features that aren't common use-cases (see the feature request section above). These types of pull requests have a high cost to maintainers but provide little benefit to the community.
57+
Note that it is unlikely the project will merge refactors for the sake of refactoring
58+
or niche features that aren't common use-cases (see the feature request section above).
59+
These types of pull requests have a high cost to maintainers but provide little benefit to the community.
4960

50-
Lastly, in order for a pull request to be merged, it must provide automated tests (unit and/or integration) proving the change works as intended, this also prevents future changes from introducing regressions. It would be quite odd for a testing tool to not have a healthy approach to test automation, after all. :-)
61+
Lastly, in order for a pull request to be merged,
62+
it must provide automated tests (unit and/or integration) proving the change works as intended,
63+
this also prevents future changes from introducing regressions.
64+
It would be quite odd for a testing tool to not have a healthy approach to test automation, after all. :smile:

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ assignees: ''
1111
Some things to note prior to opening a Goss feature request:
1212
* Goss is intended to be quick and easy to learn.
1313
* Goss is focused on the 20% of the 80/20 rule. In other words, Goss focuses on the 20% of features that cover the core aspects of OS testing and benefit 80% of users.
14-
* Goss provides a generic [command](https://github.com/goss-org/goss/blob/master/docs/manual.md#command) runner to allow users to cover more nuanced test cases.
14+
* Goss provides a generic [command](https://goss.rocks/gossfile/#command) runner to allow users to cover more nuanced test cases.
1515
1616
If after reading the above, you believe your feature is valid within the project scope please submit this feature request.
1717

.github/workflows/docs.yaml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
paths:
9+
- mkdocs.yml
10+
- docs/
11+
- README.md
12+
- LICENSE
13+
- extras/**/README.md
14+
- .github/CONTRIBUTING.md
15+
workflow_dispatch:
16+
17+
jobs:
18+
lint:
19+
name: Lint Documentation
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: DavidAnson/markdownlint-cli2-action@v13
24+
with:
25+
globs: |
26+
docs/**/*.md
27+
28+
build:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v4
33+
- uses: actions/setup-python@v4
34+
with:
35+
python-version: "3.11"
36+
cache: 'pip'
37+
- name: Install dependencies
38+
run: |
39+
pip install --upgrade pip
40+
pip install --requirement docs/requirements.pip
41+
- name: Build documentation
42+
run: mkdocs build
43+
# To remove if not using github pages
44+
- name: Upload artifact
45+
uses: actions/upload-pages-artifact@v2
46+
with:
47+
path: site
48+
49+
# To remove if not using github pages
50+
deploy:
51+
if: github.ref_name == 'master'
52+
needs: build
53+
environment:
54+
name: github-pages
55+
url: ${{steps.deployment.outputs.page_url}}
56+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
57+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
58+
concurrency:
59+
group: docs-${{ github.ref_name }}
60+
cancel-in-progress: false
61+
permissions:
62+
contents: read
63+
pages: write # to deploy to Pages
64+
id-token: write # to verify the deployment originates from an appropriate source
65+
runs-on: ubuntu-latest
66+
steps:
67+
- name: Deploy to GitHub Pages
68+
id: deployment
69+
uses: actions/deploy-pages@v2
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Preview documentation
2+
on:
3+
pull_request_target:
4+
types:
5+
- opened
6+
paths:
7+
- mkdocs.yml
8+
- docs/
9+
- README.md
10+
- LICENSE
11+
- extras/**/README.md
12+
- .github/CONTRIBUTING.md
13+
14+
jobs:
15+
pull-request-links:
16+
name: Add preview link to pull-request
17+
runs-on: ubuntu-latest
18+
permissions:
19+
pull-requests: write
20+
steps:
21+
- uses: readthedocs/actions/preview@v1
22+
with:
23+
project-slug: goss

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,9 @@ tmp/
1717

1818
/c.out
1919
/c.out.tmp
20+
21+
# Documentation
22+
## Virtualenv
23+
/.venv
24+
## MkDocs rendered site
25+
/site

.markdownlint.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
# Enable all rules
3+
default: true
4+
5+
# Enforce asterisk for unordered lists
6+
# See: https://github.com/DavidAnson/markdownlint/blob/main/doc/md004.md
7+
MD004:
8+
style: asterisk
9+
10+
# Set list indent level to 4 which Python-Markdown requires
11+
# See:
12+
# - https://github.com/DavidAnson/markdownlint/blob/main/doc/md007.md
13+
# - https://python-markdown.github.io/#differences
14+
MD007:
15+
indent: 4
16+
17+
# Tune `line-length`
18+
# See: https://github.com/DavidAnson/markdownlint/blob/main/doc/md013.md
19+
MD013:
20+
line_length: 120
21+
tables: false
22+
code_blocks: false
23+
24+
# Disable `blanks-around-list` (to stay close from GitHub-flavored markdown)
25+
# See:
26+
# - https://github.com/DavidAnson/markdownlint/blob/main/doc/md032.md
27+
# - https://python-markdown.github.io/#differences
28+
MD032: false
29+
30+
# Disable `no-space-in-code`
31+
# Generate lots of false positive with admonitions and code blocks
32+
MD038: false
33+
34+
# Disable `code-blocks-style`
35+
# Use fenced code blocks everywhere but raise false positives with admonitions
36+
MD046: false
37+
38+
# Disable `link-fragments`
39+
# Only works for github-rendered markdown (which does not have the same rules as MkDocs)
40+
# See: https://github.com/DavidAnson/markdownlint/blob/main/doc/md051.md
41+
MD051: false

.readthedocs.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Read the Docs configuration file for MkDocs projects
2+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3+
4+
# Required
5+
version: 2
6+
7+
# Set the version of Python and other tools you might need
8+
build:
9+
os: ubuntu-22.04
10+
tools:
11+
python: "3.12"
12+
13+
mkdocs:
14+
configuration: mkdocs.yml
15+
16+
# Optionally declare the Python requirements required to build your docs
17+
python:
18+
install:
19+
- requirements: docs/requirements.pip

LICENSE

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright {yyyy} {name of copyright owner}
189+
Copyright 2015 Ahmed Elsabbahy
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.
@@ -199,4 +199,3 @@
199199
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200200
See the License for the specific language governing permissions and
201201
limitations under the License.
202-

Makefile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ pkgs = $(shell ./novendor.sh)
55
cmd = goss
66
GO111MODULE=on
77
GO_FILES = $(shell git ls-files -- '*.go' ':!:*vendor*_test.go')
8+
VENV := $(shell echo $${VIRTUAL_ENV-.venv})
9+
PYTHON := $(VENV)/bin/python
10+
DOCS_DEPS := $(VENV)/.docs.dependencies
811

912
.PHONY: all build install test release bench fmt lint vet test-int-all gen centos7 wheezy trusty alpine3 arch test-int32 centos7-32 wheezy-32 trusty-32 alpine3-32 arch-32
1013

@@ -73,6 +76,8 @@ gen:
7376
clean:
7477
$(info INFO: Starting build $@)
7578
rm -rf ./release
79+
rm -rf ./site
80+
rm -rf ${VENV}
7681

7782
build-images:
7883
$(info INFO: Starting build $@)
@@ -130,3 +135,24 @@ arch: build
130135

131136
dgoss-sha256:
132137
cd extras/dgoss/ && sha256sum dgoss > dgoss.sha256
138+
139+
$(PYTHON):
140+
$(info Creating virtualenv in $(VENV))
141+
@python -m venv $(VENV)
142+
143+
$(DOCS_DEPS): $(PYTHON) docs/requirements.pip
144+
$(info Installing dependencies)
145+
@pip install --upgrade pip
146+
@pip install --requirement docs/requirements.pip
147+
@touch $(DOCS_DEPS)
148+
149+
docs/setup: $(DOCS_DEPS)
150+
151+
docs/serve: docs/setup
152+
$(info Running documentation live development server)
153+
@mkdocs serve --strict
154+
155+
.PHONY: docs
156+
docs: docs/setup
157+
$(info Building documentation)
158+
@mkdocs build --strict

0 commit comments

Comments
 (0)