Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add versioned documentation to the website #5541

Merged
merged 5 commits into from
Feb 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ module.exports = {
},
},
{
excludedFiles: 'integration-tests/__tests__/**/*',
excludedFiles: [
'integration-tests/__tests__/**/*',
'website/versioned_docs/**/*.md',
],
files: [
'examples/**/*',
'scripts/**/*',
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
([#5523](https://github.com/facebook/jest/pull/5523))
* `[jest-cli]` Support multiple glob patterns for `collectCoverageFrom`
([#5537](https://github.com/facebook/jest/pull/5537))
* `[docs]` Add versioned documentation to the website
([#5541](https://github.com/facebook/jest/pull/5541))

### Chore & Maintenance

Expand Down
3 changes: 2 additions & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"build": "docusaurus-build",
"gh-pages": "docusaurus-publish",
"examples": "docusaurus-examples",
"crowdin-upload": "crowdin --config ../crowdin.yaml upload sources --auto-update -b master",
"crowdin-upload":
"crowdin --config ../crowdin.yaml upload sources --auto-update -b master",
"crowdin-download": "crowdin --config ../crowdin.yaml download -b master",
"publish-gh-pages": "docusaurus-publish",
"write-translations": "docusaurus-write-translations",
Expand Down
104 changes: 104 additions & 0 deletions website/pages/en/versions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
/**
* Copyright (c) 2017-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

const React = require('react');

const CompLibrary = require('../../core/CompLibrary');
const Container = CompLibrary.Container;

const CWD = process.cwd();

const siteConfig = require(CWD + '/siteConfig.js');
const versions = require(CWD + '/versions.json');

class Versions extends React.Component {
render() {
const latestVersion = versions[0];
return (
<div className="docMainWrapper wrapper">
<Container className="mainContainer versionsContainer">
<div className="post">
<header className="postHeader">
<h2>{siteConfig.title + ' Versions'}</h2>
</header>
<h3 id="latest">Current version (Stable)</h3>
<p>Latest stable version of Jest</p>
<table className="versions">
<tbody>
<tr>
<th>{latestVersion}</th>
<td>
<a
href={`${siteConfig.baseUrl}docs/en/getting-started.html`}
>
Documentation
</a>
</td>
<td>
<a href="https://github.com/facebook/jest/blob/master/CHANGELOG.md">
Release Notes
</a>
</td>
</tr>
</tbody>
</table>
<h3 id="rc">Latest version</h3>
<p>
Here you can find the latest unreleased documentation and code.
</p>
<table className="versions">
<tbody>
<tr>
<th>master</th>
<td>
<a
href={`${
siteConfig.baseUrl
}docs/en/next/getting-started.html`}
>
Documentation
</a>
</td>
<td>
<a href="https://github.com/facebook/jest">Source Code</a>
</td>
</tr>
</tbody>
</table>
<h3 id="archive">Past Versions</h3>
<p>
Here you can find documentation for previous versions of Jest.
</p>
<table className="versions">
<tbody>
{versions.map(
version =>
version !== latestVersion && (
<tr key={version}>
<th>{version}</th>
<td>
<a
href={`${
siteConfig.baseUrl
}docs/en/${version}/getting-started.html`}
>
Documentation
</a>
</td>
</tr>
)
)}
</tbody>
</table>
</div>
</Container>
</div>
);
}
}

module.exports = Versions;
Loading