From a3b076cca8dedf6aaa6e688cd74b94c524253849 Mon Sep 17 00:00:00 2001 From: Tymoteusz Jankowski Date: Mon, 2 Dec 2019 20:56:25 +0100 Subject: [PATCH 01/20] Add docs about pager in the pipeline command --- static/docs/command-reference/pipeline/show.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/static/docs/command-reference/pipeline/show.md b/static/docs/command-reference/pipeline/show.md index cf6b661c04..79cf61d7f9 100644 --- a/static/docs/command-reference/pipeline/show.md +++ b/static/docs/command-reference/pipeline/show.md @@ -4,6 +4,12 @@ Show [stages](/doc/command-reference/run) in a pipeline that lead to the specified stage. By default it lists [DVC-files](/doc/user-guide/dvc-file-format). +This command's output is automatically pushed to `less` command line tool if +`less` is installed +If `less` cannot be found, the ouput is simply printed out. +You can also override default `less` via `DVC_PAGER` environemnt variable. + + ## Synopsis ```usage From 623c38c62186a575146c10c725bf52c83bda2064 Mon Sep 17 00:00:00 2001 From: Tymoteusz Jankowski Date: Sun, 8 Dec 2019 14:14:43 +0100 Subject: [PATCH 02/20] Add a section how to install pager on Windows --- .../docs/user-guide/running-dvc-on-windows.md | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/static/docs/user-guide/running-dvc-on-windows.md b/static/docs/user-guide/running-dvc-on-windows.md index e7eb6eaca0..b1033dd874 100644 --- a/static/docs/user-guide/running-dvc-on-windows.md +++ b/static/docs/user-guide/running-dvc-on-windows.md @@ -47,3 +47,24 @@ The performance of NTFS degrades while handling large volumes of files in a directory. [Here](https://stackoverflow.com/questions/197162/ntfs-performance-and-large-volumes-of-files-and-directories) is the resource for reference. + +## Enabling paging with `less` + +By default DVC uses `less` to page output for some commands. +Although, many operating systems have `less` preinstalled, there are still +platforms where `less` is not installed. This usually happens for Microsoft +Windows. Fortunately, there is a easy way of installing `less` via +[Chocolatey](https://chocolatey.org/). + +``` +choco install less +``` + +If you do not want to use [Chocolatey](https://chocolatey.org/) for some +reason, you can still provide `less` by your own way. However, you must +make `less` to be runnable from `cmd`/`Powershell`. +This usually means to add the `less` installation directory to the `PATH` +environement vairable. + + + From acaaf0521484213d9117279c608524e6e08fe424 Mon Sep 17 00:00:00 2001 From: Tymoteusz Jankowski Date: Sun, 8 Dec 2019 14:15:37 +0100 Subject: [PATCH 03/20] Wrap the pager content in `pipeline show` with a sub-section --- .../docs/command-reference/pipeline/show.md | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/static/docs/command-reference/pipeline/show.md b/static/docs/command-reference/pipeline/show.md index 79cf61d7f9..eed19db39a 100644 --- a/static/docs/command-reference/pipeline/show.md +++ b/static/docs/command-reference/pipeline/show.md @@ -4,10 +4,26 @@ Show [stages](/doc/command-reference/run) in a pipeline that lead to the specified stage. By default it lists [DVC-files](/doc/user-guide/dvc-file-format). +## Paging the output + This command's output is automatically pushed to `less` command line tool if -`less` is installed -If `less` cannot be found, the ouput is simply printed out. -You can also override default `less` via `DVC_PAGER` environemnt variable. +`less` is runnable (installed and can be executed in your shell). + +If `less` is not runnable (usually Microsoft Windows), the ouput is simply printed out. + +> Note Microsoft Windows users may also want to read +> [this how-to](/doc/user-guide/running-dvc-on-windows.md#enabling-paging-with-less). + +### Providing a custom pager + +You can also override the default pager via `DVC_PAGER` environemnt variable. + +For example + +``` +# one-time change in Bash +DVC_PAGER=more dvc pipeline show --ascii my-pipeline.dvc +``` ## Synopsis @@ -41,8 +57,7 @@ instead of stages. option is specified) of stage outputs instead of paths to DVC-files. - `--ascii` - visualize pipeline. It will print a graph (ASCII) instead of a - list of path to DVC-files. (To navigate, use arrows or `W`, `A`, `S`, `D` - keys. To exit, press `Q`.) + list of path to DVC-files. (To navigate, use arrows keys. To exit, press `Q`.) - `--dot` - show contents of `.dot` files with a DVC pipeline graph. It can be passed to third party visualization utilities. From 54f4b5a740e1a87a00169cedbe820f89a4fb93d4 Mon Sep 17 00:00:00 2001 From: Tymoteusz Jankowski Date: Sun, 8 Dec 2019 14:21:41 +0100 Subject: [PATCH 04/20] Add info about less tool arguments in `pipeline show` --- static/docs/command-reference/pipeline/show.md | 1 + 1 file changed, 1 insertion(+) diff --git a/static/docs/command-reference/pipeline/show.md b/static/docs/command-reference/pipeline/show.md index eed19db39a..bf5f2461b2 100644 --- a/static/docs/command-reference/pipeline/show.md +++ b/static/docs/command-reference/pipeline/show.md @@ -8,6 +8,7 @@ specified stage. By default it lists This command's output is automatically pushed to `less` command line tool if `less` is runnable (installed and can be executed in your shell). +To be exact, the actuall command is `less --chop-long-lines --clear-screen`. If `less` is not runnable (usually Microsoft Windows), the ouput is simply printed out. From 382b9d94792fa84e9f2b8eb84fb39b49aa91aff7 Mon Sep 17 00:00:00 2001 From: Tymoteusz Jankowski Date: Sun, 8 Dec 2019 14:23:02 +0100 Subject: [PATCH 05/20] Move the Paging the output section before the examples --- .../docs/command-reference/pipeline/show.md | 45 +++++++++---------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/static/docs/command-reference/pipeline/show.md b/static/docs/command-reference/pipeline/show.md index bf5f2461b2..5797c033d3 100644 --- a/static/docs/command-reference/pipeline/show.md +++ b/static/docs/command-reference/pipeline/show.md @@ -4,29 +4,6 @@ Show [stages](/doc/command-reference/run) in a pipeline that lead to the specified stage. By default it lists [DVC-files](/doc/user-guide/dvc-file-format). -## Paging the output - -This command's output is automatically pushed to `less` command line tool if -`less` is runnable (installed and can be executed in your shell). -To be exact, the actuall command is `less --chop-long-lines --clear-screen`. - -If `less` is not runnable (usually Microsoft Windows), the ouput is simply printed out. - -> Note Microsoft Windows users may also want to read -> [this how-to](/doc/user-guide/running-dvc-on-windows.md#enabling-paging-with-less). - -### Providing a custom pager - -You can also override the default pager via `DVC_PAGER` environemnt variable. - -For example - -``` -# one-time change in Bash -DVC_PAGER=more dvc pipeline show --ascii my-pipeline.dvc -``` - - ## Synopsis ```usage @@ -74,6 +51,28 @@ instead of stages. - `-v`, `--verbose` - displays detailed tracing information. +## Paging the output + +This command's output is automatically pushed to `less` command line tool if +`less` is runnable (installed and can be executed in your shell). +To be exact, the actual command is `less --chop-long-lines --clear-screen`. + +If `less` is not runnable (usually Microsoft Windows), the ouput is simply printed out. + +> Note Microsoft Windows users may also want to read +> [this how-to](/doc/user-guide/running-dvc-on-windows.md#enabling-paging-with-less). + +### Providing a custom pager + +You can also override the default pager via `DVC_PAGER` environemnt variable. + +For example + +``` +# one-time change in Bash +DVC_PAGER=more dvc pipeline show --ascii my-pipeline.dvc +``` + ## Examples Default mode: show stage files that `output.dvc` recursively depends on: From 138a362c68a0244822a3c04a2ea27649ee35a766 Mon Sep 17 00:00:00 2001 From: Tymoteusz Jankowski Date: Sun, 8 Dec 2019 14:46:00 +0100 Subject: [PATCH 06/20] Run `yarn prettier --write ..` for changed files --- .../docs/command-reference/pipeline/show.md | 7 ++++--- .../docs/user-guide/running-dvc-on-windows.md | 20 ++++++++----------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/static/docs/command-reference/pipeline/show.md b/static/docs/command-reference/pipeline/show.md index 5797c033d3..eb17af69e7 100644 --- a/static/docs/command-reference/pipeline/show.md +++ b/static/docs/command-reference/pipeline/show.md @@ -54,10 +54,11 @@ instead of stages. ## Paging the output This command's output is automatically pushed to `less` command line tool if -`less` is runnable (installed and can be executed in your shell). -To be exact, the actual command is `less --chop-long-lines --clear-screen`. +`less` is runnable (installed and can be executed in your shell). To be exact, +the actual command is `less --chop-long-lines --clear-screen`. -If `less` is not runnable (usually Microsoft Windows), the ouput is simply printed out. +If `less` is not runnable (usually Microsoft Windows), the ouput is simply +printed out. > Note Microsoft Windows users may also want to read > [this how-to](/doc/user-guide/running-dvc-on-windows.md#enabling-paging-with-less). diff --git a/static/docs/user-guide/running-dvc-on-windows.md b/static/docs/user-guide/running-dvc-on-windows.md index b1033dd874..ece187ac9f 100644 --- a/static/docs/user-guide/running-dvc-on-windows.md +++ b/static/docs/user-guide/running-dvc-on-windows.md @@ -50,21 +50,17 @@ is the resource for reference. ## Enabling paging with `less` -By default DVC uses `less` to page output for some commands. -Although, many operating systems have `less` preinstalled, there are still -platforms where `less` is not installed. This usually happens for Microsoft -Windows. Fortunately, there is a easy way of installing `less` via +By default DVC uses `less` to page output for some commands. Although, many +operating systems have `less` preinstalled, there are still platforms where +`less` is not installed. This usually happens for Microsoft Windows. +Fortunately, there is a easy way of installing `less` via [Chocolatey](https://chocolatey.org/). ``` choco install less ``` -If you do not want to use [Chocolatey](https://chocolatey.org/) for some -reason, you can still provide `less` by your own way. However, you must -make `less` to be runnable from `cmd`/`Powershell`. -This usually means to add the `less` installation directory to the `PATH` -environement vairable. - - - +If you do not want to use [Chocolatey](https://chocolatey.org/) for some reason, +you can still provide `less` by your own way. However, you must make `less` to +be runnable from `cmd`/`Powershell`. This usually means to add the `less` +installation directory to the `PATH` environement vairable. From 4ef90d125ccb91451046bf863437a1c1626becb8 Mon Sep 17 00:00:00 2001 From: Tymoteusz Jankowski Date: Sun, 8 Dec 2019 14:51:57 +0100 Subject: [PATCH 07/20] Fix the enabling pager link in `pipeline show` --- static/docs/command-reference/pipeline/show.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/docs/command-reference/pipeline/show.md b/static/docs/command-reference/pipeline/show.md index eb17af69e7..9ab3c87216 100644 --- a/static/docs/command-reference/pipeline/show.md +++ b/static/docs/command-reference/pipeline/show.md @@ -61,7 +61,7 @@ If `less` is not runnable (usually Microsoft Windows), the ouput is simply printed out. > Note Microsoft Windows users may also want to read -> [this how-to](/doc/user-guide/running-dvc-on-windows.md#enabling-paging-with-less). +> [this how-to](/doc/user-guide/running-dvc-on-windows#enabling-paging-with-less). ### Providing a custom pager From 93409dee9aef64a3a07f020dd52b0aab451f2cc3 Mon Sep 17 00:00:00 2001 From: Tymoteusz Jankowski Date: Mon, 9 Dec 2019 20:57:41 +0100 Subject: [PATCH 08/20] Small updates 1. add dvc or bash to code blocks 2. remove a reference of WASD 3. replace a code comment with a paragraph --- static/docs/command-reference/pipeline/show.md | 10 +++++----- static/docs/user-guide/running-dvc-on-windows.md | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/static/docs/command-reference/pipeline/show.md b/static/docs/command-reference/pipeline/show.md index 9ab3c87216..29844766c8 100644 --- a/static/docs/command-reference/pipeline/show.md +++ b/static/docs/command-reference/pipeline/show.md @@ -67,10 +67,11 @@ printed out. You can also override the default pager via `DVC_PAGER` environemnt variable. -For example +For example: -``` -# one-time change in Bash +Following command will replace the default pager with `more` for a single call + +```bash DVC_PAGER=more dvc pipeline show --ascii my-pipeline.dvc ``` @@ -94,8 +95,7 @@ cleanup.py raw data process.py data output ``` -Visualize DVC pipeline (To navigate, use arrows or `W`, `A`, `S`, `D` keys. To -exit, press `Q`.): +Visualize DVC pipeline (To navigate, use arrows. To exit, press `Q`.): ```dvc $ dvc pipeline show eval.txt.dvc --ascii diff --git a/static/docs/user-guide/running-dvc-on-windows.md b/static/docs/user-guide/running-dvc-on-windows.md index ece187ac9f..7bf41f1fab 100644 --- a/static/docs/user-guide/running-dvc-on-windows.md +++ b/static/docs/user-guide/running-dvc-on-windows.md @@ -56,7 +56,7 @@ operating systems have `less` preinstalled, there are still platforms where Fortunately, there is a easy way of installing `less` via [Chocolatey](https://chocolatey.org/). -``` +```dvc choco install less ``` From 1c2a6a0f870bf2030c10b454c0a7f9b4e71da54a Mon Sep 17 00:00:00 2001 From: Tymoteusz Jankowski Date: Mon, 9 Dec 2019 21:11:45 +0100 Subject: [PATCH 09/20] Link the paging the output section in options and example --- static/docs/command-reference/pipeline/show.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/static/docs/command-reference/pipeline/show.md b/static/docs/command-reference/pipeline/show.md index 29844766c8..10db54d6dd 100644 --- a/static/docs/command-reference/pipeline/show.md +++ b/static/docs/command-reference/pipeline/show.md @@ -35,7 +35,9 @@ instead of stages. option is specified) of stage outputs instead of paths to DVC-files. - `--ascii` - visualize pipeline. It will print a graph (ASCII) instead of a - list of path to DVC-files. (To navigate, use arrows keys. To exit, press `Q`.) + list of path to DVC-files (`less` pager may be used, see + [this section](/doc/command-reference/pipeline/show#paging-the-output) for + details). - `--dot` - show contents of `.dot` files with a DVC pipeline graph. It can be passed to third party visualization utilities. @@ -95,7 +97,9 @@ cleanup.py raw data process.py data output ``` -Visualize DVC pipeline (To navigate, use arrows. To exit, press `Q`.): +Visualize DVC pipeline (`less` pager may be used, see +[this section](/doc/command-reference/pipeline/show#paging-the-output) for +details). ```dvc $ dvc pipeline show eval.txt.dvc --ascii From 4ab3b3ca656a52fdb62c1d79a020650301218742 Mon Sep 17 00:00:00 2001 From: Tymoteusz Jankowski Date: Mon, 9 Dec 2019 21:21:51 +0100 Subject: [PATCH 10/20] Add `$` to code snippets --- static/docs/command-reference/pipeline/show.md | 2 +- static/docs/user-guide/running-dvc-on-windows.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/static/docs/command-reference/pipeline/show.md b/static/docs/command-reference/pipeline/show.md index 10db54d6dd..cf935075d6 100644 --- a/static/docs/command-reference/pipeline/show.md +++ b/static/docs/command-reference/pipeline/show.md @@ -74,7 +74,7 @@ For example: Following command will replace the default pager with `more` for a single call ```bash -DVC_PAGER=more dvc pipeline show --ascii my-pipeline.dvc +$ DVC_PAGER=more dvc pipeline show --ascii my-pipeline.dvc ``` ## Examples diff --git a/static/docs/user-guide/running-dvc-on-windows.md b/static/docs/user-guide/running-dvc-on-windows.md index 7bf41f1fab..7bbd72d0b4 100644 --- a/static/docs/user-guide/running-dvc-on-windows.md +++ b/static/docs/user-guide/running-dvc-on-windows.md @@ -57,7 +57,7 @@ Fortunately, there is a easy way of installing `less` via [Chocolatey](https://chocolatey.org/). ```dvc -choco install less +$ choco install less ``` If you do not want to use [Chocolatey](https://chocolatey.org/) for some reason, From 3e27e1bcfd10d300c783d8402b8aa57a4b3dfbfa Mon Sep 17 00:00:00 2001 From: Tymoteusz Jankowski Date: Mon, 9 Dec 2019 21:28:43 +0100 Subject: [PATCH 11/20] Add a sub-section about custom pager on Windows page --- static/docs/user-guide/running-dvc-on-windows.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/static/docs/user-guide/running-dvc-on-windows.md b/static/docs/user-guide/running-dvc-on-windows.md index 7bbd72d0b4..2d454ff75c 100644 --- a/static/docs/user-guide/running-dvc-on-windows.md +++ b/static/docs/user-guide/running-dvc-on-windows.md @@ -64,3 +64,9 @@ If you do not want to use [Chocolatey](https://chocolatey.org/) for some reason, you can still provide `less` by your own way. However, you must make `less` to be runnable from `cmd`/`Powershell`. This usually means to add the `less` installation directory to the `PATH` environement vairable. + +### Providing a custom pager + +See [this +section](/doc/command-reference/pipeline/show#providing-a-custom-pager) for +details. From 33f8db6d723f34fc2f02f10fc8dd37c336de282e Mon Sep 17 00:00:00 2001 From: Tymoteusz Jankowski Date: Mon, 9 Dec 2019 22:10:21 +0100 Subject: [PATCH 12/20] Improve the custom pager example --- static/docs/command-reference/pipeline/show.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/static/docs/command-reference/pipeline/show.md b/static/docs/command-reference/pipeline/show.md index cf935075d6..5c6f5a2ad8 100644 --- a/static/docs/command-reference/pipeline/show.md +++ b/static/docs/command-reference/pipeline/show.md @@ -71,12 +71,22 @@ You can also override the default pager via `DVC_PAGER` environemnt variable. For example: -Following command will replace the default pager with `more` for a single call +Following command will replace the default pager with +[`more`](https://en.wikipedia.org/wiki/More_(command)) for a single call ```bash $ DVC_PAGER=more dvc pipeline show --ascii my-pipeline.dvc ``` +To make it persistent, you need to add it to a shell depending file. + +For `Bash` it means adding this line +```bash +export DVC_PAGER=more +``` +to `~/.bashrc`. + + ## Examples Default mode: show stage files that `output.dvc` recursively depends on: From d3b9f4942e967aee626fc8373e555d5a786ad877 Mon Sep 17 00:00:00 2001 From: Tymoteusz Jankowski Date: Mon, 9 Dec 2019 22:11:35 +0100 Subject: [PATCH 13/20] Run `yarn prettier` --- static/docs/command-reference/pipeline/show.md | 5 +++-- static/docs/user-guide/running-dvc-on-windows.md | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/static/docs/command-reference/pipeline/show.md b/static/docs/command-reference/pipeline/show.md index 5c6f5a2ad8..b9413d995b 100644 --- a/static/docs/command-reference/pipeline/show.md +++ b/static/docs/command-reference/pipeline/show.md @@ -72,7 +72,7 @@ You can also override the default pager via `DVC_PAGER` environemnt variable. For example: Following command will replace the default pager with -[`more`](https://en.wikipedia.org/wiki/More_(command)) for a single call +[`more`]() for a single call ```bash $ DVC_PAGER=more dvc pipeline show --ascii my-pipeline.dvc @@ -81,11 +81,12 @@ $ DVC_PAGER=more dvc pipeline show --ascii my-pipeline.dvc To make it persistent, you need to add it to a shell depending file. For `Bash` it means adding this line + ```bash export DVC_PAGER=more ``` -to `~/.bashrc`. +to `~/.bashrc`. ## Examples diff --git a/static/docs/user-guide/running-dvc-on-windows.md b/static/docs/user-guide/running-dvc-on-windows.md index 2d454ff75c..df936294b9 100644 --- a/static/docs/user-guide/running-dvc-on-windows.md +++ b/static/docs/user-guide/running-dvc-on-windows.md @@ -67,6 +67,6 @@ installation directory to the `PATH` environement vairable. ### Providing a custom pager -See [this -section](/doc/command-reference/pipeline/show#providing-a-custom-pager) for -details. +See +[this section](/doc/command-reference/pipeline/show#providing-a-custom-pager) +for details. From 3ca73a429d6660e5d68c8fde6f33fec05f4b00e8 Mon Sep 17 00:00:00 2001 From: Alexey Ivanov Date: Tue, 10 Dec 2019 21:38:14 +0900 Subject: [PATCH 14/20] Disable SSR fro links in markdown --- src/Documentation/Markdown/Markdown.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/Documentation/Markdown/Markdown.js b/src/Documentation/Markdown/Markdown.js index e0068f2371..41ee4112e8 100644 --- a/src/Documentation/Markdown/Markdown.js +++ b/src/Documentation/Markdown/Markdown.js @@ -126,14 +126,10 @@ const Link = ({ children, href, ...props }) => { ) } - const nextProps = href.match(/^\/doc/) - ? { href: PAGE_DOC, as: href } - : { href } - return ( - - {children} - + + {children} + ) } From f70e0a73cf6ba0fc4d4dfd6a923ffcf22e6cd2e2 Mon Sep 17 00:00:00 2001 From: Alexey Ivanov Date: Tue, 10 Dec 2019 23:50:14 +0900 Subject: [PATCH 15/20] Fix bug with hashes in urls --- pages/doc.js | 2 +- src/Documentation/Markdown/Markdown.js | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pages/doc.js b/pages/doc.js index 4784850956..f5bc81da25 100644 --- a/pages/doc.js +++ b/pages/doc.js @@ -130,7 +130,7 @@ export default function Documentation({ item, headings, markdown, errorCode }) { } Documentation.getInitialProps = async ({ asPath, req }) => { - const item = getItemByPath(asPath) + const item = getItemByPath(asPath.split('#')[0]) if (!item) { return { diff --git a/src/Documentation/Markdown/Markdown.js b/src/Documentation/Markdown/Markdown.js index 41ee4112e8..e0068f2371 100644 --- a/src/Documentation/Markdown/Markdown.js +++ b/src/Documentation/Markdown/Markdown.js @@ -126,10 +126,14 @@ const Link = ({ children, href, ...props }) => { ) } + const nextProps = href.match(/^\/doc/) + ? { href: PAGE_DOC, as: href } + : { href } + return ( - - {children} - + + {children} + ) } From 79ae400a4d6f371c90538dc87924131f7ea67820 Mon Sep 17 00:00:00 2001 From: Tymoteusz Jankowski Date: Wed, 11 Dec 2019 20:43:07 +0100 Subject: [PATCH 16/20] Apply code review comments --- .../docs/command-reference/pipeline/show.md | 34 +++++++------------ .../docs/user-guide/running-dvc-on-windows.md | 8 ++--- 2 files changed, 17 insertions(+), 25 deletions(-) diff --git a/static/docs/command-reference/pipeline/show.md b/static/docs/command-reference/pipeline/show.md index b9413d995b..cfc78c7da9 100644 --- a/static/docs/command-reference/pipeline/show.md +++ b/static/docs/command-reference/pipeline/show.md @@ -35,7 +35,7 @@ instead of stages. option is specified) of stage outputs instead of paths to DVC-files. - `--ascii` - visualize pipeline. It will print a graph (ASCII) instead of a - list of path to DVC-files (`less` pager may be used, see + list of path to DVC-files. (`less` pager may be used, see [this section](/doc/command-reference/pipeline/show#paging-the-output) for details). @@ -55,32 +55,26 @@ instead of stages. ## Paging the output -This command's output is automatically pushed to `less` command line tool if -`less` is runnable (installed and can be executed in your shell). To be exact, -the actual command is `less --chop-long-lines --clear-screen`. +This command's output is automatically piped to +[`less`](), if available in the +terminal. (The exact command used is `less --chop-long-lines --clear-screen`.) +If less is not available (e.g. on Windows), the output is simply printed out. -If `less` is not runnable (usually Microsoft Windows), the ouput is simply -printed out. - -> Note Microsoft Windows users may also want to read -> [this how-to](/doc/user-guide/running-dvc-on-windows#enabling-paging-with-less). +> It's also possible to +> [enable Less paging on Windows](/doc/user-guide/running-dvc-on-windows#enabling-paging-with-less). ### Providing a custom pager -You can also override the default pager via `DVC_PAGER` environemnt variable. - -For example: - -Following command will replace the default pager with -[`more`]() for a single call +It's possible to override the default pager via the `DVC_PAGER` environment +variable. For example, the following command will replace the default pager with +[`more`](), for a single run: ```bash $ DVC_PAGER=more dvc pipeline show --ascii my-pipeline.dvc ``` -To make it persistent, you need to add it to a shell depending file. - -For `Bash` it means adding this line +For a persistent change, define `DVC_PAGER` in the shell configuration. For +example in Bash, we could add the following line to `~/.bashrc`: ```bash export DVC_PAGER=more @@ -108,9 +102,7 @@ cleanup.py raw data process.py data output ``` -Visualize DVC pipeline (`less` pager may be used, see -[this section](/doc/command-reference/pipeline/show#paging-the-output) for -details). +Visualize DVC pipeline: ```dvc $ dvc pipeline show eval.txt.dvc --ascii diff --git a/static/docs/user-guide/running-dvc-on-windows.md b/static/docs/user-guide/running-dvc-on-windows.md index df936294b9..a7bab9f92a 100644 --- a/static/docs/user-guide/running-dvc-on-windows.md +++ b/static/docs/user-guide/running-dvc-on-windows.md @@ -50,11 +50,11 @@ is the resource for reference. ## Enabling paging with `less` -By default DVC uses `less` to page output for some commands. Although, many -operating systems have `less` preinstalled, there are still platforms where -`less` is not installed. This usually happens for Microsoft Windows. +By default, DVC tries to use +[`Less`]() as pager for the output of +`dvc pipeline show`. Windows doesn't have the less command available however. Fortunately, there is a easy way of installing `less` via -[Chocolatey](https://chocolatey.org/). +[Chocolatey](https://chocolatey.org/) (please install the tool first): ```dvc $ choco install less From 7fc8127baea6709bbdceed16e52038222283f9dc Mon Sep 17 00:00:00 2001 From: Tymoteusz Jankowski Date: Wed, 11 Dec 2019 20:54:49 +0100 Subject: [PATCH 17/20] Fix typos --- static/docs/user-guide/running-dvc-on-windows.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/docs/user-guide/running-dvc-on-windows.md b/static/docs/user-guide/running-dvc-on-windows.md index a7bab9f92a..225e008672 100644 --- a/static/docs/user-guide/running-dvc-on-windows.md +++ b/static/docs/user-guide/running-dvc-on-windows.md @@ -63,7 +63,7 @@ $ choco install less If you do not want to use [Chocolatey](https://chocolatey.org/) for some reason, you can still provide `less` by your own way. However, you must make `less` to be runnable from `cmd`/`Powershell`. This usually means to add the `less` -installation directory to the `PATH` environement vairable. +installation directory to the `PATH` environment variable. ### Providing a custom pager From 40e78880668b57c332b451e1ef74d568b4634e70 Mon Sep 17 00:00:00 2001 From: Tymoteusz Jankowski Date: Wed, 11 Dec 2019 21:29:03 +0100 Subject: [PATCH 18/20] Remove custom pager section and 2 redundant lines --- static/docs/command-reference/pipeline/show.md | 2 -- static/docs/user-guide/running-dvc-on-windows.md | 6 ------ 2 files changed, 8 deletions(-) diff --git a/static/docs/command-reference/pipeline/show.md b/static/docs/command-reference/pipeline/show.md index cfc78c7da9..ffb928f0d8 100644 --- a/static/docs/command-reference/pipeline/show.md +++ b/static/docs/command-reference/pipeline/show.md @@ -80,8 +80,6 @@ example in Bash, we could add the following line to `~/.bashrc`: export DVC_PAGER=more ``` -to `~/.bashrc`. - ## Examples Default mode: show stage files that `output.dvc` recursively depends on: diff --git a/static/docs/user-guide/running-dvc-on-windows.md b/static/docs/user-guide/running-dvc-on-windows.md index 225e008672..9813d0f8f9 100644 --- a/static/docs/user-guide/running-dvc-on-windows.md +++ b/static/docs/user-guide/running-dvc-on-windows.md @@ -64,9 +64,3 @@ If you do not want to use [Chocolatey](https://chocolatey.org/) for some reason, you can still provide `less` by your own way. However, you must make `less` to be runnable from `cmd`/`Powershell`. This usually means to add the `less` installation directory to the `PATH` environment variable. - -### Providing a custom pager - -See -[this section](/doc/command-reference/pipeline/show#providing-a-custom-pager) -for details. From 53e4c8d41ec85925b25bbbc6b900b2854ff1fc35 Mon Sep 17 00:00:00 2001 From: Tymoteusz Jankowski Date: Wed, 11 Dec 2019 21:39:19 +0100 Subject: [PATCH 19/20] Update the link in --ascii option in pipline command --- static/docs/command-reference/pipeline/show.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/static/docs/command-reference/pipeline/show.md b/static/docs/command-reference/pipeline/show.md index ffb928f0d8..d6970e2d8e 100644 --- a/static/docs/command-reference/pipeline/show.md +++ b/static/docs/command-reference/pipeline/show.md @@ -36,8 +36,7 @@ instead of stages. - `--ascii` - visualize pipeline. It will print a graph (ASCII) instead of a list of path to DVC-files. (`less` pager may be used, see - [this section](/doc/command-reference/pipeline/show#paging-the-output) for - details). + [Paging the output](#paging-the-output) below for details). - `--dot` - show contents of `.dot` files with a DVC pipeline graph. It can be passed to third party visualization utilities. From 3441f79ba2261af41b38aedd5727b19382226c53 Mon Sep 17 00:00:00 2001 From: Tymoteusz Jankowski Date: Wed, 11 Dec 2019 21:58:20 +0100 Subject: [PATCH 20/20] More review updates --- static/docs/command-reference/pipeline/show.md | 4 ++-- static/docs/user-guide/running-dvc-on-windows.md | 16 +++++++--------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/static/docs/command-reference/pipeline/show.md b/static/docs/command-reference/pipeline/show.md index d6970e2d8e..c6afb09ce1 100644 --- a/static/docs/command-reference/pipeline/show.md +++ b/static/docs/command-reference/pipeline/show.md @@ -55,9 +55,9 @@ instead of stages. ## Paging the output This command's output is automatically piped to -[`less`](), if available in the +[Less](), if available in the terminal. (The exact command used is `less --chop-long-lines --clear-screen`.) -If less is not available (e.g. on Windows), the output is simply printed out. +If `less` is not available (e.g. on Windows), the output is simply printed out. > It's also possible to > [enable Less paging on Windows](/doc/user-guide/running-dvc-on-windows#enabling-paging-with-less). diff --git a/static/docs/user-guide/running-dvc-on-windows.md b/static/docs/user-guide/running-dvc-on-windows.md index 9813d0f8f9..a896dd7019 100644 --- a/static/docs/user-guide/running-dvc-on-windows.md +++ b/static/docs/user-guide/running-dvc-on-windows.md @@ -50,17 +50,15 @@ is the resource for reference. ## Enabling paging with `less` -By default, DVC tries to use -[`Less`]() as pager for the output of -`dvc pipeline show`. Windows doesn't have the less command available however. -Fortunately, there is a easy way of installing `less` via -[Chocolatey](https://chocolatey.org/) (please install the tool first): +By default, DVC tries to use [Less]() +as pager for the output of `dvc pipeline show`. Windows doesn't have the less +command available however. Fortunately, there is a easy way of installing `less` +via [Chocolatey](https://chocolatey.org/) (please install the tool first): ```dvc $ choco install less ``` -If you do not want to use [Chocolatey](https://chocolatey.org/) for some reason, -you can still provide `less` by your own way. However, you must make `less` to -be runnable from `cmd`/`Powershell`. This usually means to add the `less` -installation directory to the `PATH` environment variable. +`less` can be installed in other ways, just make sure it's available in +`cmd`/Powershell, where you run dvc. (This usually means adding the directory +where `less` is installed to the `PATH` environment variable.)