-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Docs] Warn latest is unstable (#101)
* docs * docs * docs
- Loading branch information
1 parent
11c55c2
commit 2a337e8
Showing
2 changed files
with
32 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
*/ | ||
|
||
function warnOnLatestVersion() { | ||
if (!window.READTHEDOCS_DATA || window.READTHEDOCS_DATA.version !== "latest") { | ||
return; // not on ReadTheDocs and not latest. | ||
} | ||
|
||
var note = document.createElement('div'); | ||
note.setAttribute('class', 'admonition note'); | ||
note.innerHTML = "<p class='first admonition-title'>Note</p> " + | ||
"<p> " + | ||
"This documentation is for an <b>unreleased development version</b>. " + | ||
"Click <a href='/en/stable'><b>here</b></a> to access the documentation of the current stable release." + | ||
"</p>"; | ||
|
||
var parent = document.querySelector('#benchmarl'); | ||
if (parent) | ||
parent.insertBefore(note, parent.querySelector('h1')); | ||
} | ||
|
||
document.addEventListener('DOMContentLoaded', warnOnLatestVersion); |
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