Skip to content

Commit

Permalink
start: tabs for Windows cmd blocks (Versioning page) (#3273)
Browse files Browse the repository at this point in the history
* start: use `powershell` highligher for tab toggles
per #3215 (comment)

* start: Windows command tabs for Versioning page

* start: use `dvc` highlighter (and `$`) for Windows cmd blocks

per #3273 (review)

* start: Windows code blocks for /tmp location

* Apply suggestions from code review
  • Loading branch information
jorgeorpinel authored Mar 1, 2022
1 parent 0d6d761 commit 0a631f9
Showing 1 changed file with 39 additions and 16 deletions.
55 changes: 39 additions & 16 deletions content/docs/start/data-and-model-versioning.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ The data, meanwhile, is listed in `.gitignore`.
### 💡 Expand to see what happens under the hood.

`dvc add` moved the data to the project's <abbr>cache</abbr>, and
<abbr>linked</abbr> it back to the <abbr>workspace</abbr>.
<abbr>linked</abbr> it back to the <abbr>workspace</abbr>. The `.dvc/cache`
should look like this:

```dvc
$ tree .dvc/cache
../.dvc/cache
```
.dvc/cache
└── a3
   └── 04afb96060aad90176268345e10355
```
Expand Down Expand Up @@ -114,14 +114,27 @@ $ git commit -m "Configure remote storage"

DVC remotes let you store a copy of the data tracked by DVC outside of the local
cache (usually a cloud storage service). For simplicity, let's set up a _local
remote_:
remote_ in a temporary `dvcstore/` directory (create the dir first if needed):

<toggle>
<tab title="Mac/Linux">

```dvc
$ mkdir -p /tmp/dvcstore
$ dvc remote add -d myremote /tmp/dvcstore
$ git commit .dvc/config -m "Configure local remote"
```

</tab>
<tab title="Windows (Cmd)">

```dvc
$ dvc remote add -d myremote %TEMP%\dvcstore
$ git commit .dvc\config -m "Configure local remote"
```

</tab>
</toggle>

> While the term "local remote" may seem contradictory, it doesn't have to be.
> The "local" part refers to the type of location: another directory in the file
> system. "Remote" is what we call storage for <abbr>DVC projects</abbr>. It's
Expand All @@ -141,16 +154,12 @@ files.
### 💡 Expand to see what happens under the hood.

`dvc push` copied the data <abbr>cached</abbr> locally to the remote storage we
set up earlier. You can check that the data has been stored in the DVC remote
with:

```dvc
$ ls -R /tmp/dvcstore
/tmp/dvcstore/:
a3
set up earlier. The remote storage directory should look like this:

/tmp/dvcstore/a3:
04afb96060aad90176268345e10355
```
.../dvcstore
└── a3
   └── 04afb96060aad90176268345e10355
```

</details>
Expand All @@ -177,7 +186,7 @@ $ rm -f data/data.xml
```

</tab>
<tab title="Windows">
<tab title="Windows Cmd">

```dvc
$ rmdir .dvc\cache
Expand Down Expand Up @@ -209,11 +218,25 @@ latest version:
Let's say we obtained more data from some external source. We can pretend this
is the case by doubling the dataset:

<toggle>
<tab title="Mac/Linux">

```dvc
$ cp data/data.xml /tmp/data.xml
$ cat /tmp/data.xml >> data/data.xml
```

</tab>
<tab title="Windows (Cmd)">

```dvc
$ copy data\data.xml %TEMP%\data.xml
$ type %TEMP%/data.xml >> data\data.xml
```

</tab>
</toggle>

</details>

```dvc
Expand Down

0 comments on commit 0a631f9

Please sign in to comment.