diff --git a/.gitattributes b/.gitattributes index 04020ff1..db117a3d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -6,7 +6,7 @@ *.sh text eol=lf # lf for the docs as it's auto-generated and will otherwise trigger an uncommited error on windows -doc/cli.markdown text eol=lf +docs/balena-cli.md text eol=lf # crlf for the eol conversion test files tests/test-data/projects/docker-compose/basic/service2/file2-crlf.sh eol=crlf tests/test-data/projects/no-docker-compose/basic/src/windows-crlf.sh eol=crlf diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ed187717..04706c31 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -105,12 +105,12 @@ npm run update balena-sdk ^13.0.0 major ## Editing documentation files (README, INSTALL, Reference website...) -The `doc/cli.markdown` file is automatically generated by running `npm run build:doc` (which also +The `docs/balena-cli.md` file is automatically generated by running `npm run build:doc` (which also runs as part of `npm run build`). That file is then pulled by scripts in the [balena-io/docs](https://github.com/balena-io/docs/) GitHub repo for publishing at the [CLI Documentation page](https://www.balena.io/docs/reference/cli/). -The content sources for the auto generation of `doc/cli.markdown` are: +The content sources for the auto generation of `docs/balena-cli.md` are: * [Selected sections](https://github.com/balena-io/balena-cli/blob/v12.23.0/automation/capitanodoc/capitanodoc.ts#L199-L204) @@ -120,7 +120,7 @@ The content sources for the auto generation of `doc/cli.markdown` are: * `lib/commands/env/add.ts` The README file is manually edited, but subsections are automatically extracted for inclusion in -`doc/cli.markdown` by the `getCapitanoDoc()` function in +`docs/balena-cli.md` by the `getCapitanoDoc()` function in [`automation/capitanodoc/capitanodoc.ts`](https://github.com/balena-io/balena-cli/blob/master/automation/capitanodoc/capitanodoc.ts). The `INSTALL*.md` and `TROUBLESHOOTING.md` files are also manually edited. diff --git a/automation/check-doc.js b/automation/check-doc.js index 75ad7180..19b662d0 100644 --- a/automation/check-doc.js +++ b/automation/check-doc.js @@ -24,15 +24,15 @@ const simplegit = require('simple-git/promise'); const ROOT = path.normalize(path.join(__dirname, '..')); /** - * Compare the timestamp of cli.markdown with the timestamp of staged files, - * issuing an error if cli.markdown is older. - * If cli.markdown does not require updating and the developer cannot run + * Compare the timestamp of balena-cli.md with the timestamp of staged files, + * issuing an error if balena-cli.md is older. + * If balena-cli.md does not require updating and the developer cannot run * `npm run build` on their laptop, the error message suggests a workaround * using `touch`. */ async function checkBuildTimestamps() { const git = simplegit(ROOT); - const docFile = path.join(ROOT, 'doc', 'cli.markdown'); + const docFile = path.join(ROOT, 'docs', 'balena-cli.md'); const [docStat, gitStatus] = await Promise.all([ fs.stat(docFile), git.status(), diff --git a/doc/cli.markdown b/docs/balena-cli.md similarity index 100% rename from doc/cli.markdown rename to docs/balena-cli.md diff --git a/package.json b/package.json index 8a9eef6e..57c20fdb 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "build:src": "npm run lint && npm run build:fast && npm run build:test && npm run build:doc && npm run build:completion", "build:fast": "gulp pages && tsc && npx oclif-dev manifest", "build:test": "tsc -P ./tsconfig.dev.json --noEmit && tsc -P ./tsconfig.js.json --noEmit", - "build:doc": "ts-node --transpile-only automation/capitanodoc/index.ts > doc/cli.markdown", + "build:doc": "ts-node --transpile-only automation/capitanodoc/index.ts > docs/balena-cli.md", "build:completion": "node completion/generate-completion.js", "build:standalone": "ts-node --transpile-only automation/run.ts build:standalone", "build:installer": "ts-node --transpile-only automation/run.ts build:installer",