This is an automated email from the ASF dual-hosted git repository.
aaronmarkham pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git
The following commit(s) were added to refs/heads/master by this push:
new c701be5 Fix website error pages (#13963)
c701be5 is described below
commit c701be5b762094e7467ddac268f26f95fc9ccfca
Author: Aaron Markham <[email protected]>
AuthorDate: Mon Jan 28 10:16:59 2019 -0800
Fix website error pages (#13963)
* fix error redirect
* add error artifacts for local build
---
docs/build_version_doc/artifacts/.htaccess | 3 +-
docs/build_version_doc/artifacts/404.html | 50 +++++++++++++++++++
docs/build_version_doc/artifacts/api.html | 50 +++++++++++++++++++
docs/build_version_doc/artifacts/index.html | 73 ----------------------------
docs/build_version_doc/update_all_version.sh | 24 ---------
docs/conf.py | 2 +-
docs/error/404.md | 3 --
docs/error/api.md | 3 --
docs/mxdoc.py | 18 +++++++
9 files changed, 120 insertions(+), 106 deletions(-)
diff --git a/docs/build_version_doc/artifacts/.htaccess
b/docs/build_version_doc/artifacts/.htaccess
index 798fe92..f334982 100644
--- a/docs/build_version_doc/artifacts/.htaccess
+++ b/docs/build_version_doc/artifacts/.htaccess
@@ -4,7 +4,6 @@ RewriteRule ^get_started/why_mxnet.html$
%{ENV:default_version}/faq/why_mxnet.ht
RewriteRule ^get_started.*$ %{ENV:default_version}/install/ [R=301,L]
RewriteRule ^how_to.*$ %{ENV:default_version}/faq/ [R=301,L]
RewriteRule ^api/python/symbol.html$
%{ENV:default_version}/api/python/symbol/symbol.html [R=301,L]
-RewriteRule ^(?:versions\/[^\/]+\/)?community/index.html$
%{ENV:default_version}/community/contribute.html [R=301,L]
# Navigation bar redirects to latest info
RewriteCond %{ENV:default_version}#\/$1 !^([^#]+)#\1$
@@ -22,4 +21,4 @@ RewriteRule ^versions/1.0.0/api/clojure/.*$
%{ENV:default_version}/error/api.htm
RewriteRule ^versions/1.1.0/api/clojure/.*$
%{ENV:default_version}/error/api.html [R=301,L]
RewriteRule ^versions/1.2.1/api/clojure/.*$
%{ENV:default_version}/error/api.html [R=301,L]
-ErrorDocument 404 https://mxnet.incubator.apache.org/error/404.html
+ErrorDocument 404 /error/404.html
diff --git a/docs/build_version_doc/artifacts/404.html
b/docs/build_version_doc/artifacts/404.html
new file mode 100644
index 0000000..86c91f7
--- /dev/null
+++ b/docs/build_version_doc/artifacts/404.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+<style>
+ { margin: 0; padding: 0; }
+
+ html {
+ background:
url('https://raw.githubusercontent.com/dmlc/web-data/master/mxnet/image/mxnet-background-compressed.jpeg')
no-repeat center center fixed;
+ -webkit-background-size: cover;
+ -moz-background-size: cover;
+ -o-background-size: cover;
+ background-size: cover;
+ }
+
+ h1, p {
+ color: white;
+ font-family: verdana;
+ }
+
+ a:link {
+ color: white;
+ }
+
+ a:visited {
+ color: linen;
+ }
+
+ a:hover {
+ color: powderblue;
+ }
+
+ a:active {
+ color: aqua;
+ }
+
+</style>
+ </head>
+ <body>
+ <div>
+ <a href="/" id="logo" ><img width="200"
src="https://raw.githubusercontent.com/dmlc/web-data/master/mxnet/image/mxnet_logo.png"></a>
+ </div>
+ <div>
+ <span id="page-does-not-exist"></span><h1>Page Does Not Exist</h1>
+ <p>If you’re here that means you requested a page that doesn’t exist.
Sorry about that! Maybe try the search box to find what you’re looking for, or
navigate to the <a href="/">Home Page</a>. Also, make sure you’re looking in
the correct version, as some features may only be available in <a
href="https://github.com/apache/incubator-mxnet/releases">newer versions</a> or
the <a href="/versions/master">master branch</a>.</p>
+ </div>
+ </body>
+</html>
diff --git a/docs/build_version_doc/artifacts/api.html
b/docs/build_version_doc/artifacts/api.html
new file mode 100644
index 0000000..001b771
--- /dev/null
+++ b/docs/build_version_doc/artifacts/api.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+<style>
+ { margin: 0; padding: 0; }
+
+ html {
+ background:
url('https://raw.githubusercontent.com/dmlc/web-data/master/mxnet/image/mxnet-background-compressed.jpeg')
no-repeat center center fixed;
+ -webkit-background-size: cover;
+ -moz-background-size: cover;
+ -o-background-size: cover;
+ background-size: cover;
+ }
+
+ h1, p {
+ color: white;
+ font-family: verdana;
+ }
+
+ a:link {
+ color: white;
+ }
+
+ a:visited {
+ color: linen;
+ }
+
+ a:hover {
+ color: powderblue;
+ }
+
+ a:active {
+ color: aqua;
+ }
+
+</style>
+ </head>
+ <body>
+ <div>
+ <a href="/" id="logo" ><img width="200"
src="https://raw.githubusercontent.com/dmlc/web-data/master/mxnet/image/mxnet_logo.png"></a>
+ </div>
+ <div>
+ <span id="page-does-not-exist"></span><h1>API Not Available</h1>
+ <p>You selected an API that is not available for this version of MXNet.
Try a more recent version of MXNet, or go the <a href="/versions/master">master
branch</a>.</p>
+ </div>
+ </body>
+</html>
diff --git a/docs/build_version_doc/artifacts/index.html
b/docs/build_version_doc/artifacts/index.html
deleted file mode 100644
index 51eced8..0000000
--- a/docs/build_version_doc/artifacts/index.html
+++ /dev/null
@@ -1,73 +0,0 @@
-<div id="splash">
- <div class="container">
- <div class="row">
- <div class="col-lg-12">
- <div id="banner-title" class='col-sm-6 col-xs-12'><span>Apache MXNet
(Incubating)</span>
- <p id="landing-title">A flexible and efficient library for deep
learning.</p>
- <div id='landing-btn-blk'>
- <div id="install_blk">
- <a href="install/index.html" id="install_btn">Install</a>
- </div>
- <div id="why_mxnet">
- <a href="get_started/why_mxnet.html"
id="why_mxnet_btn">Learn More</a>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
-</div>
-<div class="section-tout">
- <div class="container">
- <div class="row">
- <div class="col-lg-4 col-sm-12">
- <h3>MXNet 1.2.0.rc0 Released</h3>
- <p>We're excited to announce the release of MXNet 1.2.0.rc0! Check out
the release notes for latest updates.</p>
- <a
href="https://github.com/apache/incubator-mxnet/releases/tag/1.2.0.rc0">Learn
More</a>
- </div>
- <div class="col-lg-4 col-sm-12">
- <h3>Improved ONNX Support</h3>
- <p>MXNet now supports importing ONNX models natively with the new
ONNX-MXNet API. Try out the super resolution example, or a tutorial on
fine-tuning an ONXX model with Gluon.
- </p>
- <a href="api/python/contrib/onnx.html#onnx-tutorials">Learn More</a>
- </div>
- <div class="col-lg-4 col-sm-12">
- <h3>Introducing the Scala Inference API</h3>
- <p>A model loading and inference API is now available for Scala
developers. Try out the examples for single shot detection and loading models
for image classification.
- </p>
- <a href="api/scala/index.html">Learn More</a>
- </div>
- </div>
- </div>
-</div>
-
-<div class="section-util">
- <div class="container">
- <div class="row">
- <div id="model-zoo-blk" class="col-lg-4 col-sm-12">
- <span class="glyphicon glyphicon-folder-open"></span>
- <h2>Gluon Model Zoo</h2>
- <p>One-click pre-trained models, included in Gluon. Fast
implementations of many state-of-the-art models, for plug-and-play effortless
use.</p>
- <div class='util-btn'>
- <a id="model-zoo-link"
href="api/python/gluon/model_zoo.html">Gluon model zoo</a>
- </div>
- </div>
- <div id="example-blk" class="col-lg-4 col-sm-12">
- <span class="glyphicon glyphicon-list-alt"></span>
- <h2>Examples</h2>
- <p>Explore projects from simple demos, examples, tutorials to
state-of-the-art research.</p>
- <div class='util-btn'>
- <a id="example-link"
href="https://github.com/dmlc/mxnet/tree/master/example">MXNet examples</a>
- </div>
- </div>
- <div id="tutorial-blk" class="col-lg-4 col-sm-12">
- <span class="glyphicon glyphicon-ok-circle"></span>
- <h2>Tutorials</h2>
- <p>These tutorials introduce a few fundamental concepts in deep
learning and how to implement them in MXNet.</p>
- <div class='util-btn'>
- <a id="tutorial-link" href="tutorials/index.html">MXNet
tutorials</a>
- </div>
- </div>
- </div>
- </div>
-</div>
diff --git a/docs/build_version_doc/update_all_version.sh
b/docs/build_version_doc/update_all_version.sh
index 0c91973..d3305d4 100755
--- a/docs/build_version_doc/update_all_version.sh
+++ b/docs/build_version_doc/update_all_version.sh
@@ -78,20 +78,6 @@ for tag in $tag_list; do
echo "$tag" >> "$tag_file"
done
-function update_mxnet_css {
- tag=$1
- echo "Begin update fixes.."
- # All fixes are done on the master branch of mxnet-incubator repository
- # During a nightly build, these fixes will be patched to all the versions in
the asf-site repository including the master folder under versions directory.
- # copy <master folder location> <version folder location>
-
- echo "Copying mxnet.css from artifacts folder..."
- cp "artifacts/mxnet.css" "$built/versions/$tag/_static"
-
- echo "Update fixes complete.."
-}
-
-
# Update the specified tags with the Versions dropdown
# Add various artifacts depending on the version
@@ -101,16 +87,6 @@ for tag in $tag_list; do
python AddVersion.py --root_url "$root_url" --file_path
"$built/versions/$tag" --current_version "$tag" --tag_default "$tag_default" ||
exit 1
- # Patch any fixes to all versions except 0.11.0.
- # Version 0.11.0 has old theme and does not make use of the current
mxnet.css
- # It also has its install page in /getting_started, so we skip updating
that
- if [ $tag != '0.11.0' ]; then
- if [ -d $built/versions/$tag ]; then
- echo "The $tag is going to be updated with new css and install
pages."
- update_mxnet_css $tag
- fi
- fi
-
# Update all the files that are required to go into the root folder or
live version
if [ $tag == $tag_default ]
then
diff --git a/docs/conf.py b/docs/conf.py
index c6c8204..3b5c38d 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -107,7 +107,7 @@ master_doc = 'index'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
-exclude_patterns = ['3rdparty', 'api/python/model.md', 'build_version_doc',
'error', 'README.md', 'tutorial_utils', 'virtualenv']
+exclude_patterns = ['3rdparty', 'api/python/model.md', 'build_version_doc',
'README.md', 'tutorial_utils', 'virtualenv']
# The reST default role (used for this markup: `text`) to use for all
documents.
diff --git a/docs/error/404.md b/docs/error/404.md
deleted file mode 100644
index 63ebdeb..0000000
--- a/docs/error/404.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# Page Does Not Exist
-
-If you're here that means you requested a page that doesn't exist. Sorry about
that! Maybe try the search box to find what you're looking for, or navigate to
the [Home Page](../index.html). Also, make sure you're looking in the correct
version, as some features may only be available in [newer
versions](https://github.com/apache/incubator-mxnet/releases) or the [master
branch](../versions/master).
diff --git a/docs/error/api.md b/docs/error/api.md
deleted file mode 100644
index 37de502..0000000
--- a/docs/error/api.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# API Not Available
-
-You selected an API that is not available for this version of MXNet. Try a
more recent version of MXNet, or go to the [master](../versions/master/)
version.
diff --git a/docs/mxdoc.py b/docs/mxdoc.py
index 52f050e..54cda5f 100644
--- a/docs/mxdoc.py
+++ b/docs/mxdoc.py
@@ -16,6 +16,7 @@
# under the License.
"""A sphnix-doc plugin to build mxnet docs"""
+from __future__ import print_function
import subprocess
import re
import os
@@ -434,6 +435,22 @@ def add_buttons(app, docname, source):
# source[i] = '\n'.join(lines)
+
+def copy_artifacts(app):
+ """Copies artifacts needed for website presentation"""
+ print("Copying artifacts...")
+ dest_path = app.builder.outdir + '/error'
+ _run_cmd('cd ' + app.builder.srcdir)
+ _run_cmd('rm -rf ' + dest_path)
+ _run_cmd('mkdir -p ' + dest_path)
+ _run_cmd('cp build_version_doc/artifacts/404.html ' + dest_path)
+ _run_cmd('cp build_version_doc/artifacts/api.html ' + dest_path)
+ dest_path = app.builder.outdir + '/_static'
+ _run_cmd('rm -rf ' + dest_path)
+ _run_cmd('mkdir -p ' + dest_path)
+ _run_cmd('cp _static/mxnet.css ' + dest_path)
+
+
def setup(app):
# If MXNET_DOCS_BUILD_MXNET is set something different than 1
# Skip the build step
@@ -458,6 +475,7 @@ def setup(app):
if _R_DOCS:
print("Building R Docs!")
app.connect("builder-inited", build_r_docs)
+ app.connect("builder-inited", copy_artifacts)
app.connect('source-read', convert_table)
app.connect('source-read', add_buttons)
app.add_config_value('recommonmark_config', {