Skip to content

Commit

Permalink
Merge branch 'master' into update_redirected_links
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgeorpinel committed Nov 12, 2019
2 parents eb7ad73 + 9c781f0 commit ab20b19
Show file tree
Hide file tree
Showing 41 changed files with 539 additions and 226 deletions.
4 changes: 4 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
}
},
"rules": {
"max-len": [
"error",
{ "code": 80, "ignoreTemplateLiterals": true, "ignoreUrls": true }
],
"no-tabs": "error"
}
}
66 changes: 34 additions & 32 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,22 @@ app.prepare().then(() => {
(req.headers['x-forwarded-proto'] !== 'https' && !dev) ||
req.headers.host.match(/^www/) !== null
) {
// Enforce https protocol and remove www from host/
// Enforce https protocol and remove www from host.
res.writeHead(301, {
Location:
'https://' + req.headers['host'].replace(/^www\./, '') + req.url
Location: 'https://' + req.headers.host.replace(/^www\./, '') + req.url
})
res.end()
} else if (req.headers.host === 'man.dvc.org') {
// man.dvc.org/{cmd} -> dvc.org/doc/command-reference/{cmd}
let normalized_pathname =
['/get-url', '/import-url'].indexOf(pathname) > 0
? pathname.replace(/-/i, '/')
: pathname
const doc_pathname = '/doc/command-reference' + normalized_pathname
res.writeHead(301, { Location: 'https://dvc.org' + doc_pathname })
// man.dvc.org/{cmd} -> dvc.org/doc/command-reference/{cmd},
// replace - for / in {cmd} except for /get-url, /import-url
res.writeHead(301, {
'Cache-Control': 'no-cache',
Location:
'https://dvc.org/doc/command-reference' +
(['/get-url', '/import-url'].indexOf(pathname) < 0
? pathname.replace('-', '/')
: pathname)
})
res.end()
} else if (/^(code|data|remote)\.dvc\.org$/.test(req.headers.host)) {
// {code/data/remote}.dvc.org -> corresponding S3 bucket
Expand All @@ -49,12 +51,30 @@ app.prepare().then(() => {
pathname
})
res.end()
} else if (/^\/(deb|rpm)\/.*/i.test(pathname)) {
// path /(deb|rpm) -> corresponding S3 bucket
res.writeHead(301, {
Location:
'https://s3-us-east-2.amazonaws.com/dvc-s3-repo/' +
pathname.substring(1)
})
res.end()
} else if (/^\/(help|chat)\/?$/i.test(pathname)) {
// path /(help|chat) -> Discord chat invite
res.writeHead(301, { Location: 'https://discordapp.com/invite/dvwXA2N' })
res.end()
} else if (/^\/doc\/commands-reference(\/.*)?/.test(pathname)) {
// TMP: path /doc/commands-reference/* -> /doc/command-reference/*
// path /doc/commands-reference... -> /doc/command-reference...
res.writeHead(301, {
Location: req.url.replace('commands-reference', 'command-reference')
})
res.end()
} else if (/^\/doc\/tutorial\/(.*)?/.test(pathname)) {
// path /doc/tutorial/... -> /doc/tutorials/deep/...
res.writeHead(301, {
Location: req.url.replace('/doc/tutorial/', '/doc/tutorials/deep/')
})
res.end()
} else if (pathname === '/doc/tutorial' || pathname === '/doc/tutorial/') {
// path /doc/tutorial -> /doc/tutorials
res.writeHead(301, {
Expand All @@ -65,23 +85,17 @@ app.prepare().then(() => {
pathname === '/doc/use-cases/data-and-model-files-versioning' ||
pathname === '/doc/use-cases/data-and-model-files-versioning/'
) {
// path /doc/use-cases/data-and-model-files-versioning ->
// /doc/use-cases/versioning-data-and-model-files
// path /doc/use-cases/data-and-model-files-versioning
// -> /doc/use-cases/versioning-data-and-model-files
res.writeHead(301, {
Location: req.url.replace(
'data-and-model-files-versioning',
'versioning-data-and-model-files'
)
})
res.end()
} else if (/^\/doc\/tutorial\/(.*)?/.test(pathname)) {
// path /doc/tutorial/* -> /doc/tutorials/deep/*
res.writeHead(301, {
Location: req.url.replace('/doc/tutorial/', '/doc/tutorials/deep/')
})
res.end()
} else if (/^\/doc.*/i.test(pathname)) {
// path /doc* -> /doc
// path /doc*/... -> /doc/...
let normalized_pathname = pathname.replace(/^\/doc[^?\/]*/i, '/doc')
if (normalized_pathname !== pathname) {
res.writeHead(301, {
Expand All @@ -94,18 +108,6 @@ app.prepare().then(() => {
} else {
app.render(req, res, '/doc', query)
}
} else if (/^\/(deb|rpm)\/.*/i.test(pathname)) {
// dvc.org/(deb|rpm) -> corresponding S3 bucket
res.writeHead(301, {
Location:
'https://s3-us-east-2.amazonaws.com/dvc-s3-repo/' +
pathname.substring(1)
})
res.end()
} else if (/^\/(help|chat)\/?$/i.test(pathname)) {
// dvc.org/(help|chat) -> Discord Chat
res.writeHead(301, { Location: 'https://discordapp.com/invite/dvwXA2N' })
res.end()
} else {
handle(req, res, parsedUrl)
}
Expand Down
1 change: 1 addition & 0 deletions src/Documentation/Markdown/Markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const HeadingRenderer = ({ level, children }) => {
>
<path
fillRule="evenodd"
// eslint-disable-next-line max-len
d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"
></path>
</svg>
Expand Down
2 changes: 1 addition & 1 deletion src/Documentation/RightPanel/RightPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export default class RightPanel extends React.PureComponent {
<span role="img" aria-label="bug">
🐛
</span>{' '}
Found an issue? Let us know or fix it:
Found an issue? Let us know! Or fix it:
</Description>

<GithubButton href={githubLink} target="_blank">
Expand Down
1 change: 1 addition & 0 deletions src/Documentation/SidebarMenu/helper.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ describe('SidebarMenu/helper', () => {
)
})

// eslint-disable-next-line max-len
it("Throws error if item has source: false and doesn't have children", () => {
const rawData = [{ slug: 'item-name', source: false }]

Expand Down
45 changes: 29 additions & 16 deletions src/Documentation/glossary.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,20 @@ form part of your expanded workspace, technically.
name: 'DVC Project',
match: ['DVC project', 'project', 'projects'],
desc: `
Initialized by running \`dvc init\` in the **workspace**. It will contain the
Initialized by running \`dvc init\` in the **workspace** (typically in a Git
repository). It will contain the
[\`.dvc/\` directory](/doc/user-guide/dvc-files-and-directories) and
[DVC-files](/doc/user-guide/dvc-file-format) created with commands such as
\`dvc add\` or \`dvc run\`. It's typically also a Git repository.
\`dvc add\` or \`dvc run\`. It may also be a Git repository.
`
},
{
name: 'DVC Repository',
match: ['DVC repository', 'DVC repositories'],
desc: `
**DVC project** initialized using \`dvc init\` in a Git repository. It will
contain \`.git/\` and [\`.dvc/\`](/doc/user-guide/dvc-files-and-directories)
directories, as well as any DVC-files created by DVC.
`
},
{
Expand All @@ -33,8 +43,17 @@ Initialized by running \`dvc init\` in the **workspace**. It will contain the
desc: `
The DVC cache is a hidden storage (by default located in the \`.dvc/cache\`
directory) for files that are under DVC control, and their different versions.
For more details, please refer to this
[document](/doc/user-guide/dvc-files-and-directories#structure-of-cache-directory).
For more details, please refer to this [document]
(/doc/user-guide/dvc-files-and-directories#structure-of-cache-directory).
`
},
{
name: 'Output',
match: ['output', 'outputs'],
desc: `
A file or a directory that is under DVC control, recorded in the \`outs\`
section of a DVC-file. See \`dvc add\` \`dvc run\`, \`dvc import\`,
\`dvc import-url\` commands. A.k.a. **data artifact*.
`
},
{
Expand All @@ -43,8 +62,9 @@ For more details, please refer to this
desc: `
Any data file or directory, as well as intermediate or final result (such as
extracted features or a ML model file) that is under DVC control. Refer to
[Versioning Data and Model Files](/doc/use-cases/versioning-data-and-model-files)
for more details.
[Versioning Data and Model Files]
(/doc/use-cases/versioning-data-and-model-files) for more details. A.k.a
**output*.
`
},
{
Expand All @@ -55,21 +75,14 @@ Stage (DVC-file) created with the \`dvc import\` or \`dvc import-url\`
commands. They represent files or directories from external sources.
`
},
{
name: 'Output',
match: ['output', 'outputs'],
desc: `
A file or a directory that is under DVC control. See \`dvc add\` \`dvc run\`,
\`dvc import\`, \`dvc import-url\` commands.
`
},
{
name: 'External Dependency',
match: ['external dependency', 'external dependencies'],
desc: `
A DVC-file dependency with origin in an external source, for example HTTP, SSH,
Amazon S3, Google Cloud Storage remote locations, or even other DVC repositories.
See [External Dependencies](/doc/user-guide/external-dependencies).
Amazon S3, Google Cloud Storage remote locations, or even other DVC
repositories. See [External Dependencies]
(/doc/user-guide/external-dependencies).
`
}
]
Expand Down
3 changes: 2 additions & 1 deletion src/Documentation/sidebar.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@
"label": "Sharing Data & Model Files",
"slug": "sharing-data-and-model-files"
},
"shared-development-server"
"shared-development-server",
"data-registry"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/DownloadButton/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import styled, { css } from 'styled-components'
import isClient from '../utils/isClient'
import { logEvent } from '../utils/ga'

const VERSION = `0.66.0`
const VERSION = `0.66.11`
const OSX = `osx`
const WINDOWS = `win`
const LINUX = `linux`
Expand Down
5 changes: 4 additions & 1 deletion src/SubscribeForm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ export default function SubscribeForm() {
required
/>

{/*real people should not fill this in and expect good things - do not remove this or risk form bot signups*/}
{/*
real people should not fill this in and expect good things -
do not remove this or risk form bot signups
*/}
<div style={{ position: 'absolute', left: '-5000px' }} aria-hidden="true">
<input
type="text"
Expand Down
2 changes: 1 addition & 1 deletion static/docs/changelog/0.18.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ really excited to share the progress with you:

Please use the discussion forum [discuss.dvc.org](discuss.dvc.org) and
[issue tracker]() and don't hesitate to [](https://github.com/iterative/dvc)
our [DVC repository](https://github.com/iterative/dvc) if you haven't yet. We
the [DVC repository](https://github.com/iterative/dvc) if you haven't yet. We
are waiting for your feedback!
2 changes: 1 addition & 1 deletion static/docs/changelog/0.35.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,5 @@ There are new [integrations and plugins](/doc/install/plugins) available:
(PyCharm, IntelliJ, etc).

Don't hesitate to
[like\star DVC repository](https://github.com/iterative/dvc/stargazers) if you
[star the DVC repository](https://github.com/iterative/dvc/stargazers) if you
haven't yet. We are waiting for your feedback!
14 changes: 6 additions & 8 deletions static/docs/command-reference/add.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,7 @@ $ file .dvc/cache/d8/acabbfd4ee51c95da5d7628c7ef74b
```

Note that tracking compressed files (e.g. ZIP or TAR archives) is not
recommended, as `dvc add` supports tracking directories. (Details below.) For
more context, refer to
[Data Registry](/doc/use-cases/data-registry#problem-1-compressed-data-files)
recommended, as `dvc add` supports tracking directories. (Details below.)

## Example: Directory

Expand All @@ -176,14 +174,14 @@ pictures. You may then have hundreds or thousands of pictures of these animals
in a directory, and this is your training dataset:

```dvc
$ tree pics
$ tree pics --filelimit 3
pics
├── train
│   ├── cats <-- A lot of images of cats
│   └── dogs <-- A lot of images of dogs
│   ├── cats [many image files]
│   └── dogs [many image files]
└── validation
├── cats <-- More images of cats
└── dogs <-- More images of dogs
├── cats [more image files]
└── dogs [more image files]
```

Taking a directory under DVC control as simple as with a single file:
Expand Down
6 changes: 3 additions & 3 deletions static/docs/command-reference/cache/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ including the default cache directory.

The cache is where your data files, models, etc (anything you want to version
with DVC) are actually stored. The corresponding files you see in the
<abbr>workspace</abbr> simply link to the ones in cache. (See
`dvc config cache`, `type` config option, for more information on file links on
different platforms.)
<abbr>workspace</abbr> can simply link to the ones in cache. (Refer to
[File link types](/doc/user-guide/large-dataset-optimization#file-link-types-for-the-dvc-cache)
for more information on file links on different platforms.)

> For more cache-related configuration options refer to `dvc config cache`.
Expand Down
4 changes: 2 additions & 2 deletions static/docs/command-reference/destroy.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ usage: dvc destroy [-h] [-q | -v] [-f]
be removed as well, unless it's set to an external location with
`dvc cache dir`. (By default a local cache is located in the `.dvc/cache`
directory.) If you were using
[symlinks for linking data](/doc/user-guide/large-dataset-optimization) from the
[symlinks for linking](/doc/user-guide/large-dataset-optimization) data from the
cache, DVC will replace them with copies, so that your data is intact after the
DVC repository destruction.
project's destruction.

## Options

Expand Down
8 changes: 3 additions & 5 deletions static/docs/command-reference/fetch.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# fetch

Get files that are under DVC control from
[remote](/doc/command-reference/remote#description) storage into the
<abbr>cache</abbr>.
[remote storage](/doc/command-reference/remote) into the <abbr>cache</abbr>.

## Synopsis

Expand Down Expand Up @@ -74,7 +73,7 @@ specified in DVC-files currently in the project are considered by `dvc fetch`
## Options

- `-r REMOTE`, `--remote REMOTE` - name of the
[remote storage](/doc/command-reference/remote#description) to fetch from (see
[remote storage](/doc/command-reference/remote) to fetch from (see
`dvc remote list`). If not specified, the default remote is used (see
`dvc config core.remote`). The argument `REMOTE` is a remote name defined
using the `dvc remote` command.
Expand Down Expand Up @@ -117,8 +116,7 @@ specified in DVC-files currently in the project are considered by `dvc fetch`
## Examples

Let's employ a simple <abbr>workspace</abbr> with some data, code, ML models,
pipeline stages, as well as a few Git tags, such as the <abbr>DVC project</abbr>
created in our
pipeline stages, as well as a few Git tags, such as our
[get started example repo](https://github.com/iterative/example-get-started).
Then we can see what happens with `dvc fetch` as we switch from tag to tag.

Expand Down
4 changes: 2 additions & 2 deletions static/docs/command-reference/get-url.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ be placed inside of it.
Note that this command doesn't require an existing DVC project to run in. It's a
single-purpose command that can be used out of the box after installing DVC.

> See `dvc get` to download data or model files or directories from other DVC
> repositories (e.g. GitHub URLs).
> See `dvc get` to download data or model files or directories from other
> <abbr>DVC repository</abbr> (e.g. GitHub URLs).
DVC supports several types of (local or) remote locations (protocols):

Expand Down
8 changes: 5 additions & 3 deletions static/docs/command-reference/get.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# get

Download or copy file or directory from any <abbr>DVC project</abbr> in a Git
repository (e.g. hosted on GitHub) into the current working directory.
Download or copy file or directory from the
[remote storage](/doc/command-reference/remote) of any <abbr>DVC project</abbr>
in a Git repository (e.g. hosted on GitHub) into the current working directory.

> Unlike `dvc import`, this command does not track the downloaded data files
> (does not create a DVC-file).
Expand All @@ -20,7 +21,8 @@ positional arguments:

Provides an easy way to download datasets, intermediate results, ML models, or
other files and directories (any <abbr>data artifact</abbr>) tracked in another
DVC repository, by downloading them into the current working directory.
<abbr>DVC repository</abbr>, by downloading them into the current working
directory. (It works like `wget`, but for DVC repositories.)

Note that this command doesn't require an existing DVC project to run in. It's a
single-purpose command that can be used out of the box after installing DVC.
Expand Down
2 changes: 1 addition & 1 deletion static/docs/command-reference/import-url.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ desired for the downloaded data. If an existing directory is specified, then the
output will be placed inside of it.

> See `dvc import` to download and tack data or model files or directories from
> other DVC repositories (e.g. GitHub URLs).
> other <abbr>DVC repositories</abbr> (e.g. GitHub URLs).
DVC supports [DVC-files](/doc/user-guide/dvc-file-format) that refer to data in
external locations, see
Expand Down
Loading

0 comments on commit ab20b19

Please sign in to comment.