-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add versioned documentation to the website (#5541)
* add versioned documentation to the website * add changelog for versioned documentation * exclude versioned docs from specific lint rules * use id attribute instead of name for in page anchors and remove redundant anchors * re-create docs for v22.3 with latest changes from master
- Loading branch information
Showing
33 changed files
with
7,842 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
Oops, something went wrong.