Skip to content

Commit 9cc1fe6

Browse files
committed
Replace/remove project-specific references from versioned Cobra docs templates
The source content for the template files were from Arduino Lint, and contained references specific to Arduino Lint. These were replaced by placeholders, or in the case of comments, the wording made universal.
1 parent 6bcde83 commit 9cc1fe6

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
version: "3"
22

3+
vars:
4+
PROJECT_NAME: TODO
5+
36
tasks:
47
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/deploy-cobra-mkdocs-versioned-poetry/Taskfile.yml
58
docs:gen:
69
desc: Generate command reference
710
dir: ./docsgen
811
cmds:
9-
# docs will generate examples using os.Args[0] so we need to call
10-
# the generator `arduino-lint`
11-
- go build -o arduino-lint{{exeExt}}
12-
# we invoke `arduino-lint` like this instead of `./arduino-lint` to remove
13-
# the `./` chars from the examples
14-
- PATH=. arduino-lint ../docs/commands
12+
# Command examples use os.Args[0] so the docs generation binary must have the same filename as the project
13+
- go build -o {{.PROJECT_NAME}}{{exeExt}}
14+
# The binary is invoked like this instead of `./{{.PROJECT_NAME}}` to remove the `./` chars from the examples
15+
- PATH=. {{.PROJECT_NAME}} ../docs/commands
1516
- task: docs:format
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
// Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/deploy-cobra-mkdocs-versioned-poetry/docsgen/go.mod
2-
module github.com/arduino/arduino-lint/docsgen
2+
// TODO: replace MODULE_NAME with the project's module name
3+
module MODULE_NAME/docsgen
34

45
go 1.14
56

6-
replace github.com/arduino/arduino-lint => ../
7+
replace MODULE_NAME => ../
78

89
require (
9-
github.com/arduino/arduino-lint v0.0.0
10+
MODULE_NAME v0.0.0
1011
github.com/spf13/cobra v1.1.1
1112
)

workflow-templates/assets/deploy-cobra-mkdocs-versioned-poetry/docsgen/main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
//
33
// Copyright 2020 ARDUINO SA (http://www.arduino.cc/)
44
//
5-
// This software is released under the GNU General Public License version 3,
6-
// which covers the main part of arduino-cli.
5+
// This software is released under the GNU General Public License version 3.
76
// The terms of this license can be found at:
87
// https://www.gnu.org/licenses/gpl-3.0.en.html
98
//
@@ -13,13 +12,14 @@
1312
// Arduino software without disclosing the source code of your own applications.
1413
// To purchase a commercial license, send an email to license@arduino.cc.
1514

16-
// Package main generates Markdown documentation for the Arduino Lint CLI.
15+
// Package main generates Markdown documentation for the project's CLI.
1716
package main
1817

1918
import (
2019
"os"
2120

22-
"github.com/arduino/arduino-lint/internal/cli"
21+
// TODO: Replace CLI_PACKAGE_NAME with the project's Cobra CLI package name
22+
"CLI_PACKAGE_NAME"
2323
"github.com/spf13/cobra/doc"
2424
)
2525

0 commit comments

Comments
 (0)