Skip to content

Commit 8276e44

Browse files
committed
align Makefile with other VSHN docs projects
1 parent 31c54cd commit 8276e44

File tree

5 files changed

+27
-42
lines changed

5 files changed

+27
-42
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ jobs:
1010
strategy:
1111
matrix:
1212
command:
13-
- lint_yaml
14-
- docs-vale
13+
- check
1514
steps:
1615
- uses: actions/checkout@v2
1716
- name: Run ${{ matrix.command }}
@@ -23,7 +22,7 @@ jobs:
2322
- uses: actions/checkout@v2
2423
- uses: snow-actions/eclint@v1.0.1
2524
with:
26-
args: 'check'
25+
args: "check"
2726

2827
docs:
2928
runs-on: ubuntu-latest

Makefile

Lines changed: 17 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,24 @@
1-
MAKEFLAGS += --warn-undefined-variables
2-
SHELL := bash
3-
.SHELLFLAGS := -eu -o pipefail -c
4-
.DEFAULT_GOAL := all
5-
.DELETE_ON_ERROR:
6-
.SUFFIXES:
1+
pages := $(shell find . -type f -name '*.adoc')
2+
out_dir := ./_public
73

8-
ANTORA_PREVIEW_CMD ?= $(DOCKER_CMD) run --rm --publish 35729:35729 --publish 2020:2020 --volume "${PWD}":/preview/antora vshn/antora-preview:3.0.1.1 --style=syn --antora=docs
4+
docker_cmd ?= docker
5+
docker_opts ?= --rm --tty --user "$$(id -u)"
96

10-
DOCKER_CMD ?= docker
11-
DOCKER_ARGS ?= run --rm --user "$$(id -u)" --volume "$${PWD}:/src" --workdir /src
12-
13-
YAML_FILES ?= $(shell find . -type f -name '*.yaml' -or -name '*.yml')
14-
YAMLLINT_ARGS ?= --no-warnings
15-
YAMLLINT_CONFIG ?= .yamllint.yml
16-
YAMLLINT_IMAGE ?= docker.io/cytopia/yamllint:latest
17-
YAMLLINT_DOCKER ?= $(DOCKER_CMD) $(DOCKER_ARGS) $(YAMLLINT_IMAGE)
18-
19-
VALE_CMD ?= $(DOCKER_CMD) $(DOCKER_ARGS) --volume "$${PWD}"/docs/modules:/pages vshn/vale:2.1.1
20-
VALE_ARGS ?= --minAlertLevel=error --config=/pages/ROOT/pages/.vale.ini /pages
7+
vale_cmd ?= $(docker_cmd) run $(docker_opts) --volume "$${PWD}"/docs/modules/ROOT/pages:/pages --workdir /pages docker.io/vshn/vale:2.10.5.1 --minAlertLevel=error /pages
8+
preview_cmd ?= $(docker_cmd) run --rm --publish 35729:35729 --publish 2020:2020 --volume "${PWD}":/preview/antora docker.io/vshn/antora-preview:3.1.1.1 --antora=docs --style=syn
219

2210
.PHONY: all
23-
all: lint docs open
24-
25-
.PHONY: lint
26-
lint: lint_yaml docs-vale
11+
all: html
2712

28-
.PHONY: lint_yaml
29-
lint_yaml: $(YAML_FILES)
30-
$(YAMLLINT_DOCKER) -f parsable -c $(YAMLLINT_CONFIG) $(YAMLLINT_ARGS) -- $?
13+
# This will clean the Antora Artifacts, not the npm artifacts
14+
.PHONY: clean
15+
clean:
16+
rm -rf $(out_dir) '?' .cache
3117

32-
.PHONY: docs-serve
33-
docs-serve:
34-
$(ANTORA_PREVIEW_CMD)
18+
.PHONY: check
19+
check:
20+
$(vale_cmd)
3521

36-
.PHONY: docs-vale
37-
docs-vale:
38-
$(VALE_CMD) $(VALE_ARGS)
22+
.PHONY: preview
23+
preview:
24+
$(preview_cmd)

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# Project Syn Documentation
22

3-
This is the umbrella documentation for project syn.
4-
It is written using [Asciidoc][asciidoc] and [Antora][antora] and located in the [docs/](docs) folder.
3+
This is the umbrella documentation for Project Syn.
4+
5+
It is written using [AsciiDoc][asciidoc] and [Antora][antora]. The source is located in the [docs/](docs) folder.
56
The [Divio documentation structure](https://documentation.divio.com/) is used to organize its content.
67

7-
Run the `make docs-serve` command in the root of the project, and then browse to http://localhost:2020 to see a preview of the documentation.
8+
Run the `make preview` command in the root of the project, and then browse to http://localhost:2020 to see a preview of the documentation.
89

9-
After writing the documentation, please use the `make docs-vale` command and correct any warnings raised by the tool.
10+
After writing the documentation, please use the `make check` command and correct any warnings raised by the tool.
1011

1112
## Contributing and license
1213

docs/modules/ROOT/pages/.vale.ini

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ MinAlertLevel = warning # suggestion, warning or error
33

44
# Only check Asciidoc files
55
[*.adoc]
6-
7-
# Using the Microsoft style
86
BasedOnStyles = Microsoft
9-
Microsoft.GenderBias = warning
7+
Microsoft.GenderBias = suggestion
8+
Openly.GenderBias = suggestion

docs/modules/ROOT/pages/references/style-guide.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ animal.newAnimal("Finnegan",
390390
==== File structure
391391

392392
* Jsonnet files which are intended to be materialized should end with the `.jsonnet` suffix.
393-
* Jsonnet files which aren't intended to be materialized -- usually libraries -- should end with the `.libjsonnet` suffix.
393+
* Jsonnet files which aren't intended to be materialized (usually libraries) should end with the `.libjsonnet` suffix.
394394
* Files in `lib` always are libraries which should never be materialized and must be named accordingly.
395395
Those files are considered part of a public API.
396396
Treat functions in libraries accordingly and look out for breaking changes.

0 commit comments

Comments
 (0)