You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/06/08 02:39:34 UTC

[GitHub] kpmurali closed pull request #11190: [MXNET-529] Add version select in the API pages

kpmurali closed pull request #11190: [MXNET-529] Add version select in the API pages
URL: https://github.com/apache/incubator-mxnet/pull/11190
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/docs/_static/js/versions_drop_down.js b/docs/_static/js/versions_drop_down.js
new file mode 100644
index 00000000000..4ab2abf2afa
--- /dev/null
+++ b/docs/_static/js/versions_drop_down.js
@@ -0,0 +1,15 @@
+$(document).ready(function () {
+      function loadVersionURL() {
+          let el = $(this);
+          console.log("loadVersionURL");
+          let versionString = '';
+          if ($(this).text().includes("master")) {
+              versionString = $(this).text();
+          } else {
+              //Remove the character v at the beginning
+              versionString = $(this).text().substr(1);
+          }
+          window.location.pathname = '/versions/' + versionString + window.location.pathname ;
+      }
+      $('.opt-group').on('click', '.versions', loadVersionURL);
+});
diff --git a/docs/_static/mxnet-theme/layout.html b/docs/_static/mxnet-theme/layout.html
index 3028342abd5..d72582cc1c7 100644
--- a/docs/_static/mxnet-theme/layout.html
+++ b/docs/_static/mxnet-theme/layout.html
@@ -102,11 +102,17 @@
        must come *after* these tags. #}
     {{ metatags }}
     {%- block htmltitle %}
-    {%- if pagename != 'index' and 'no title' not in title%}
+    <meta property="og:title"              content="{{ title }}" />
+    <meta property="og:image"              content="https://raw.githubusercontent.com/dmlc/web-data/master/mxnet/image/og-logo.png" />
+    <meta property="og:image:secure_url"              content="https://raw.githubusercontent.com/dmlc/web-data/master/mxnet/image/og-logo.png" />
+    {%- if pagename != 'index' and 'no title' not in title %}
+    <meta property="og:description"        content="{{ title }}" />
     <title>{{ title|striptags|e }}{{ titlesuffix }}</title>
     {%- elif pagename == 'index' %}
+    <meta property="og:description"        content="A flexible and efficient library for deep learning." />
     <title>MXNet: A Scalable Deep Learning Framework</title>
     {%- else %}
+    <meta property="og:description"        content="A flexible and efficient library for deep learning." />
     <title>{{ pagename.split('/')[0]|capitalize }}{{ titlesuffix }}</title>
     {%- endif %}
     {%- endblock %}
diff --git a/docs/api/c++/index.md b/docs/api/c++/index.md
index 9a68cdafda6..ff7877ba89f 100644
--- a/docs/api/c++/index.md
+++ b/docs/api/c++/index.md
@@ -1,4 +1,18 @@
 # MXNet - C++ API
+<script type="text/javascript" src='../../_static/js/versions_drop_down.js'></script>
+  <div class="dropdown">
+    <button class="btn current-version btn-primary dropdown-toggle" type="button" data-toggle="dropdown">v1.2.0
+    <span class="caret"></span></button>
+    <ul class="dropdown-menu opt-group">
+      <li class="opt active versions"><a href="#">v1.2.0</a></li>
+      <li class="opt versions"><a href="#">v1.1.0</a></li>
+      <li class="opt versions"><a href="#">v1.0.0</a></li>
+      <li class="opt versions"><a href="#">v0.12.1</a></li>
+      <li class="opt versions"><a href="#">v0.11.0</a></li>
+      <li class="opt versions"><a href="#">master</a></li>
+    </ul>
+  </div>
+
 
 For namespaces, classes, and code files for the MXNet C++ package, see the  following:
 
diff --git a/docs/api/julia/index.md b/docs/api/julia/index.md
index f4dc0e5b749..9a9be91f769 100644
--- a/docs/api/julia/index.md
+++ b/docs/api/julia/index.md
@@ -1,4 +1,18 @@
 # MXNet - Julia API
+<script type="text/javascript" src='../../_static/js/versions_drop_down.js'></script>
+  <div class="dropdown">
+    <button class="btn current-version btn-primary dropdown-toggle" type="button" data-toggle="dropdown">v1.2.0
+    <span class="caret"></span></button>
+    <ul class="dropdown-menu opt-group">
+      <li class="opt active versions"><a href="#">v1.2.0</a></li>
+      <li class="opt versions"><a href="#">v1.1.0</a></li>
+      <li class="opt versions"><a href="#">v1.0.0</a></li>
+      <li class="opt versions"><a href="#">v0.12.1</a></li>
+      <li class="opt versions"><a href="#">v0.11.0</a></li>
+      <li class="opt versions"><a href="#">master</a></li>
+    </ul>
+  </div>
+
 
 See the [MXNet Julia Reference Manual](https://media.readthedocs.org/pdf/mxnet-test/latest/mxnet-test.pdf).
 
diff --git a/docs/api/perl/index.md b/docs/api/perl/index.md
index 6408b525f00..27e39db1e16 100644
--- a/docs/api/perl/index.md
+++ b/docs/api/perl/index.md
@@ -1,4 +1,18 @@
 # MXNet - Perl API
+<script type="text/javascript" src='../../_static/js/versions_drop_down.js'></script>
+  <div class="dropdown">
+    <button class="btn current-version btn-primary dropdown-toggle" type="button" data-toggle="dropdown">v1.2.0
+    <span class="caret"></span></button>
+    <ul class="dropdown-menu opt-group">
+      <li class="opt active versions"><a href="#">v1.2.0</a></li>
+      <li class="opt versions"><a href="#">v1.1.0</a></li>
+      <li class="opt versions"><a href="#">v1.0.0</a></li>
+      <li class="opt versions"><a href="#">v0.12.1</a></li>
+      <li class="opt versions"><a href="#">v0.11.0</a></li>
+      <li class="opt versions"><a href="#">master</a></li>
+    </ul>
+  </div>
+
 
 MXNet supports the Perl programming language. The MXNet Perl package brings flexible and efficient GPU
 computing and state-of-art deep learning to Perl. It enables you to write seamless tensor/matrix computation with multiple GPUs in Perl.
diff --git a/docs/api/python/index.md b/docs/api/python/index.md
index 420f4c9b72f..7e8891f9988 100644
--- a/docs/api/python/index.md
+++ b/docs/api/python/index.md
@@ -1,5 +1,20 @@
 # MXNet - Python API
 
+<script type="text/javascript" src='../../_static/js/versions_drop_down.js'></script>
+
+  <div class="dropdown">
+    <button class="btn current-version btn-primary dropdown-toggle" type="button" data-toggle="dropdown">v1.2.0
+    <span class="caret"></span></button>
+    <ul class="dropdown-menu opt-group">
+      <li class="opt active versions"><a href="#">v1.2.0</a></li>
+      <li class="opt versions"><a href="#">v1.1.0</a></li>
+      <li class="opt versions"><a href="#">v1.0.0</a></li>
+      <li class="opt versions"><a href="#">v0.12.1</a></li>
+      <li class="opt versions"><a href="#">v0.11.0</a></li>
+      <li class="opt versions"><a href="#">master</a></li>
+    </ul>
+  </div>
+
 MXNet provides a comprehensive and flexible Python API to serve a broad community of developers with different levels of experience and wide ranging requirements. In this section, we provide an in-depth discussion of the functionality provided by various MXNet Python packages.
 
 MXNet's Python API has two primary high-level packages*: the Gluon API and Module API. We recommend that new users start with the Gluon API as it's more flexible and easier to debug. Underlying these high-level packages are the core packages of NDArray and Symbol.
diff --git a/docs/api/r/index.md b/docs/api/r/index.md
index 822c59dbe3c..0bedc5dab82 100644
--- a/docs/api/r/index.md
+++ b/docs/api/r/index.md
@@ -1,4 +1,18 @@
 # MXNet - R API
+<script type="text/javascript" src='../../_static/js/versions_drop_down.js'></script>
+  <div class="dropdown">
+    <button class="btn current-version btn-primary dropdown-toggle" type="button" data-toggle="dropdown">v1.2.0
+    <span class="caret"></span></button>
+    <ul class="dropdown-menu opt-group">
+      <li class="opt active versions"><a href="#">v1.2.0</a></li>
+      <li class="opt versions"><a href="#">v1.1.0</a></li>
+      <li class="opt versions"><a href="#">v1.0.0</a></li>
+      <li class="opt versions"><a href="#">v0.12.1</a></li>
+      <li class="opt versions"><a href="#">v0.11.0</a></li>
+      <li class="opt versions"><a href="#">master</a></li>
+    </ul>
+  </div>
+
 
 See the [MXNet R Reference Manual](https://s3.amazonaws.com/mxnet-prod/docs/R/mxnet-r-reference-manual.pdf).
 
diff --git a/docs/api/scala/index.md b/docs/api/scala/index.md
index e96892b5800..3c8e640a573 100644
--- a/docs/api/scala/index.md
+++ b/docs/api/scala/index.md
@@ -1,4 +1,18 @@
 # MXNet - Scala API
+<script type="text/javascript" src='../../_static/js/versions_drop_down.js'></script>
+  <div class="dropdown">
+    <button class="btn current-version btn-primary dropdown-toggle" type="button" data-toggle="dropdown">v1.2.0
+    <span class="caret"></span></button>
+    <ul class="dropdown-menu opt-group">
+      <li class="opt active versions"><a href="#">v1.2.0</a></li>
+      <li class="opt versions"><a href="#">v1.1.0</a></li>
+      <li class="opt versions"><a href="#">v1.0.0</a></li>
+      <li class="opt versions"><a href="#">v0.12.1</a></li>
+      <li class="opt versions"><a href="#">v0.11.0</a></li>
+      <li class="opt versions"><a href="#">master</a></li>
+    </ul>
+  </div>
+
 MXNet supports the Scala programming language. The MXNet Scala package brings flexible and efficient GPU
 computing and state-of-art deep learning to Scala. It enables you to write seamless tensor/matrix computation with multiple GPUs in Scala. It also lets you construct and customize the state-of-art deep learning models in Scala, and apply them to tasks, such as image classification and data science challenges.
 


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services