From 288dea06b5bc0254223a527a5d3c3fd3b3e9f3e3 Mon Sep 17 00:00:00 2001 From: paul-dingemans Date: Sun, 17 Sep 2023 10:43:35 +0200 Subject: [PATCH] Add quick start documentation Closes #2256 --- README.md | 19 +++++++++++++++++++ .../release-latest/docs/quick-start.md | 16 ++++++++++++++++ documentation/release-latest/mkdocs.yml | 4 +++- documentation/snapshot/docs/quick-start.md | 16 ++++++++++++++++ documentation/snapshot/mkdocs.yml | 4 +++- 5 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 documentation/release-latest/docs/quick-start.md create mode 100644 documentation/snapshot/docs/quick-start.md diff --git a/README.md b/README.md index 65bed089c5..e4ea415d4c 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,25 @@ - Executable jar - Allows extension with custom rule sets and reporters +## Quick start + +Follow steps below for a quick start with latest ktlint release. + +* Step 1: Install with brew + ```shell + brew install ktlint + ``` + See [download and verification from GitHub](https://pinterest.github.io/ktlint/latest/install/cli/#download-and-verification) or [other package managers](https://pinterest.github.io/ktlint/latest/install/cli/#package-managers) for alternative ways of installing ktlint. Or, use one of the [integrations like maven and gradle plugins](https://pinterest.github.io/ktlint/latest/install/integrations/). + +* Step 2: Lint and format your code + All files with extension `.kt` and `.kts` in the current directory and below will be scanned. Problems will be fixed automatically when possible. + ```shell title="Autocorrect style violations" + ktlint --format + # or + ktlint -F + ``` + See [cli usage](https://pinterest.github.io/ktlint/latest/install/cli/#command-line-usage) for a more extensive description on using ktlint. + ## Documentation User guide diff --git a/documentation/release-latest/docs/quick-start.md b/documentation/release-latest/docs/quick-start.md new file mode 100644 index 0000000000..b5d797b76c --- /dev/null +++ b/documentation/release-latest/docs/quick-start.md @@ -0,0 +1,16 @@ +Follow steps below for a quick start with latest ktlint release. + +## Step 1: Install with brew +```shell +brew install ktlint +``` +See [download and verification from GitHub](../install/cli/#download-and-verification) or [other package managers](../install/cli/#package-managers) for alternative ways of installing ktlint. Or, use one of the [integrations like maven and gradle plugins](../install/integrations/). + +## Step 2: Lint and format your code +All files with extension `.kt` and `.kts` in the current directory and below will be scanned. Problems will be fixed automatically when possible. +```shell title="Autocorrect style violations" +ktlint --format +# or +ktlint -F +``` +See [cli usage](../install/cli/#command-line-usage) for a more extensive description on using ktlint. diff --git a/documentation/release-latest/mkdocs.yml b/documentation/release-latest/mkdocs.yml index fffb13066a..e905ad655d 100644 --- a/documentation/release-latest/mkdocs.yml +++ b/documentation/release-latest/mkdocs.yml @@ -38,7 +38,9 @@ theme: - search.share nav: - - Home: index.md + - Home: + - Features: index.md + - Quick start: quick-start.md - Installation: - Command line: install/cli.md - Integrations: install/integrations.md diff --git a/documentation/snapshot/docs/quick-start.md b/documentation/snapshot/docs/quick-start.md new file mode 100644 index 0000000000..b5d797b76c --- /dev/null +++ b/documentation/snapshot/docs/quick-start.md @@ -0,0 +1,16 @@ +Follow steps below for a quick start with latest ktlint release. + +## Step 1: Install with brew +```shell +brew install ktlint +``` +See [download and verification from GitHub](../install/cli/#download-and-verification) or [other package managers](../install/cli/#package-managers) for alternative ways of installing ktlint. Or, use one of the [integrations like maven and gradle plugins](../install/integrations/). + +## Step 2: Lint and format your code +All files with extension `.kt` and `.kts` in the current directory and below will be scanned. Problems will be fixed automatically when possible. +```shell title="Autocorrect style violations" +ktlint --format +# or +ktlint -F +``` +See [cli usage](../install/cli/#command-line-usage) for a more extensive description on using ktlint. diff --git a/documentation/snapshot/mkdocs.yml b/documentation/snapshot/mkdocs.yml index fffb13066a..9fa87f313e 100644 --- a/documentation/snapshot/mkdocs.yml +++ b/documentation/snapshot/mkdocs.yml @@ -38,7 +38,9 @@ theme: - search.share nav: - - Home: index.md + - Home: + - Features: index.md + - Quick start: quick-start.md - Installation: - Command line: install/cli.md - Integrations: install/integrations.md