Skip to content

Commit d95805e

Browse files
author
Tit Petric
committed
Generate some api documentation and put mdox into ci
1 parent 4f48034 commit d95805e

File tree

2 files changed

+33
-3
lines changed

2 files changed

+33
-3
lines changed

Taskfile.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ includes:
66
deps: .taskfiles/deps.yml
77
lint: .taskfiles/lint.yml
88
hooks: .taskfiles/hooks.yml
9+
docs:
10+
taskfile: docs/Taskfile.yml
11+
dir: docs/
912
opentelemetry:
1013
taskfile: ci/tests/tracing/Taskfile.yml
1114
dir: ci/tests/tracing/
@@ -59,11 +62,13 @@ tasks:
5962
yq -i ".dockers[4].extra_files |= [\"$replacement\"]" ci/goreleaser/goreleaser.yml
6063
- echo goreleaser release --clean --snapshot -f ci/goreleaser/goreleaser.yml
6164

62-
codegen:
65+
generate:
6366
deps: [deps]
67+
aliases: [codegen, gen]
6468
desc: "Run code generation steps"
6569
cmds:
6670
- go generate ./...
71+
- task: docs:codegen
6772

6873
# Used in CI
6974
lint:
@@ -84,6 +89,7 @@ tasks:
8489
desc: "Reformat import groups"
8590
cmds:
8691
- task: lint:fmt
92+
- task: docs:fmt
8793

8894
# This reformats imports with goimports-reviser;
8995
#

docs/Taskfile.yml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,36 @@ vars:
88
sh: git rev-parse --show-toplevel
99

1010
tasks:
11+
generate:
12+
desc: "Generate documentation"
13+
aliases: [codegen, gen]
14+
cmds:
15+
- task: generate:internal
16+
- task: generate:plugin
17+
18+
generate:internal:
19+
internal: true
20+
desc: "Generate internal API godocs."
21+
cmds:
22+
- cd '{{.root}}/internal' && go-fsck docs ./... > ../docs/dev/internal.md
23+
24+
generate:plugin:
25+
internal: true
26+
desc: "Generate plugin API godocs."
27+
cmds:
28+
- cd '{{.root}}/ctx' && go-fsck docs ./... > ../docs/dev/plugin-apis.md && cd ..
29+
- cd '{{.root}}/user' && go-fsck docs ./... >> ../docs/dev/plugin-apis.md && cd ..
30+
- cd '{{.root}}/storage' && go-fsck docs ./... >> ../docs/dev/plugin-apis.md && cd ..
31+
- cd '{{.root}}/log' && go-fsck docs ./... >> ../docs/dev/plugin-apis.md && cd ..
32+
1133
fmt:
1234
desc: "Run mdox to format markdowns"
1335
cmds:
14-
- mdox fmt --no-soft-wraps $(find -name '*.md')
36+
- cd '{{.root}}/docs' && mdox fmt --no-soft-wraps $(find -name '*.md') && cd ..
1537

1638
deps:
17-
desc:
39+
desc: "Install dependencies"
40+
status:
41+
- type mdox
1842
cmds:
1943
- go install github.com/bwplotka/mdox@latest

0 commit comments

Comments
 (0)