thinksanky closed pull request #10241: Css and install fix
URL: https://github.com/apache/incubator-mxnet/pull/10241
 
 
   

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/.htaccess b/docs/.htaccess
new file mode 100644
index 00000000000..76d0893a528
--- /dev/null
+++ b/docs/.htaccess
@@ -0,0 +1,5 @@
+RewriteEngine on
+RewriteRule ^get_started/why_mxnet.html$ /faq/why_mxnet.html [R=301,L]
+RewriteRule ^get_started.*$ /install/ [R=301,L]
+RewriteRule ^how_to.*$ /faq/ [R=301,L]
+RewriteRule ^api/python/symbol.html$ /api/python/symbol/symbol.html [R=301,L]
diff --git a/docs/_static/mxnet.css b/docs/_static/mxnet.css
index 6e116dbb745..a62ceb59890 100644
--- a/docs/_static/mxnet.css
+++ b/docs/_static/mxnet.css
@@ -131,9 +131,7 @@ img {
 
 .navbar .container {
     position: relative;
-    left: 20px;
     width: 100%;
-    align-content: center;
 }
 
 @media screen and (max-width: 510px) {
@@ -393,7 +391,7 @@ div .burgerIcon a {
 }
 
 #plusMenu .dropdown-submenu>.dropdown-menu {
-    left: 138px;
+    left: 127px;
     top: 0;
     background: #fff;
 }
diff --git a/docs/build_version_doc/AddVersion.py 
b/docs/build_version_doc/AddVersion.py
index c4d088a4b0f..f4b8304006f 100755
--- a/docs/build_version_doc/AddVersion.py
+++ b/docs/build_version_doc/AddVersion.py
@@ -36,7 +36,6 @@
     with open('tag_list.txt', 'r') as tag_file:
         for line in tag_file:
             tag_list.append(line.lstrip().rstrip())
-        tag_list.append('master')
 
     version_str = '<span id="dropdown-menu-position-anchor-version" ' \
                   'style="position: relative">' \
@@ -57,9 +56,6 @@
         for name in files:
             if not name.endswith('.html'):
                 continue
-            if 'install' in path:
-                print("Skipping this path: {}".format(path))
-                continue
             with open(os.path.join(path, name), 'r') as html_file:
                 content = bs(html_file, 'html.parser')
             navbar = content.find(id="main-nav")
@@ -86,25 +82,26 @@
                 outstr = outstr.replace('http://mxnet.io', 
'https://mxnet.incubator.apache.org/'
                                                                'versions/%s' % 
(args.current_version))
 
-            # Fix git clone and pip installation to specific tag
-            pip_pattern = ['', '-cu80', '-cu75', '-cu80mkl', '-cu75mkl', 
'-mkl']
-            if args.current_version == 'master':
-                outstr = outstr.replace('git clone --recursive 
https://github.com/dmlc/mxnet',
-                                        'git clone --recursive 
https://github.com/apache/incubator-mxnet.git mxnet')
-                for trail in pip_pattern:
-                    outstr = outstr.replace('pip install mxnet%s<' % (trail),
-                                            'pip install mxnet%s --pre<' % 
(trail))
-                    outstr = outstr.replace('pip install mxnet%s\n<' % (trail),
-                                            'pip install mxnet%s --pre\n<' % 
(trail))
-            else:
-                outstr = outstr.replace('git clone --recursive 
https://github.com/dmlc/mxnet',
-                                        'git clone --recursive 
https://github.com/apache/incubator-mxnet.git mxnet '
-                                        '--branch %s' % (args.current_version))
-                for trail in pip_pattern:
-                    outstr = outstr.replace('pip install mxnet%s<' % (trail),
-                                            'pip install mxnet%s==%s<' % 
(trail, args.current_version))
-                    outstr = outstr.replace('pip install mxnet%s\n<' % (trail),
-                                            'pip install mxnet%s==%s\n<' % 
(trail, args.current_version))
+            if 'install' in path:
+                # Fix git clone and pip installation to specific tag
+                pip_pattern = ['', '-cu80', '-cu75', '-cu80mkl', '-cu75mkl', 
'-mkl']
+                if args.current_version == 'master':
+                    outstr = outstr.replace('git clone --recursive 
https://github.com/dmlc/mxnet',
+                                            'git clone --recursive 
https://github.com/apache/incubator-mxnet.git mxnet')
+                    for trail in pip_pattern:
+                        outstr = outstr.replace('pip install mxnet%s<' % 
(trail),
+                                                'pip install mxnet%s --pre<' % 
(trail))
+                        outstr = outstr.replace('pip install mxnet%s\n<' % 
(trail),
+                                                'pip install mxnet%s --pre\n<' 
% (trail))
+                else:
+                    outstr = outstr.replace('git clone --recursive 
https://github.com/dmlc/mxnet',
+                                            'git clone --recursive 
https://github.com/apache/incubator-mxnet.git mxnet '
+                                            '--branch %s' % 
(args.current_version))
+                    for trail in pip_pattern:
+                        outstr = outstr.replace('pip install mxnet%s<' % 
(trail),
+                                                'pip install mxnet%s==%s<' % 
(trail, args.current_version))
+                        outstr = outstr.replace('pip install mxnet%s\n<' % 
(trail),
+                                                'pip install mxnet%s==%s\n<' % 
(trail, args.current_version))
 
             # Add tag for example link
             outstr = 
outstr.replace('https://github.com/apache/incubator-mxnet/tree/master/example',
diff --git a/docs/build_version_doc/update_all_version.sh 
b/docs/build_version_doc/update_all_version.sh
index e79b97117c5..0a446d504af 100755
--- a/docs/build_version_doc/update_all_version.sh
+++ b/docs/build_version_doc/update_all_version.sh
@@ -33,6 +33,11 @@
 set -e
 set -x
 
+MASTER_SOURCE_DIR="../../docs"
+STATIC_FILES_DIR="_static"
+MXNET_THEME_DIR="_static/mxnet-theme"
+BUILD_HTML_DIR="_build/html"
+
 if [ -z "$1" ]
   then    
     echo "Please provide a list of version tags you wish to run. Ex : \"1.1.0 
1.0.0 master\""
@@ -68,26 +73,54 @@ fi
 # Write all version numbers into $tag_file for AddVersion.py to use later
 # Master is added by that script by default
 for tag in $tag_list; do
-    if [ $tag != 'master' ]
-    then
-        echo "$tag" >> "$tag_file"
-    fi
+    echo "$tag" >> "$tag_file"
 done
 
+function update_fixes {
+  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>
+  
+  #SIM: https://sim.amazon.com/issues/AWSDBUX-19727
+  echo "Copying mxnet.css from master branch to all versions...."
+  cp "$MASTER_SOURCE_DIR/$STATIC_FILES_DIR/mxnet.css"  
"$built/versions/$tag/_static"
+
+  echo "Update fixes complete.."
+}
+
 # Update the specified tags with the Versions dropdown
 for tag in $tag_list; do
     # This Python script is expecting the tag_list.txt and it will use that as 
the entries to populate
+
+  #SIM: https://sim.amazon.com/issues/AWSDBUX-19727
+  if [[ $tag == '1.1.0' || $tag == 'master' ]]
+  then
+     echo "Copying install/index.html from master branch file to all 
versions...."
+     cp "$MASTER_SOURCE_DIR/$BUILD_HTML_DIR/install/index.html"  
"$built/versions/$tag/install"
+  fi
+
     python AddVersion.py --root_url "$root_url" --file_path 
"$built/versions/$tag" --current_version "$tag" || exit 1
 
-    if [ $tag != 'master' ]
+    if [ $tag == 'master' ]
     then 
         python AddPackageLink.py --file_path 
"$built/versions/master/install/index.html" \
                                                    --current_version "$tag" || 
exit 1
     fi
 
+    # Patch any fixes to all versions
+    if [ $tag != '0.11.0' ] 
+    then
+       update_fixes $tag
+    fi
+    
     if [ $tag == $tag_default ]
     then
         cp -a "$built/versions/$tag/." "$built"
+
+        echo "Copying .htaccess from default branch to root folder...."
+        cp "$MASTER_SOURCE_DIR/.htaccess"  "$built"
     else
         file_loc="$built/versions/$tag"
         #rm -rf "$file_loc"
diff --git a/docs/install/index.md b/docs/install/index.md
index e4767618e65..8c9eca1a6de 100644
--- a/docs/install/index.md
+++ b/docs/install/index.md
@@ -826,12 +826,9 @@ $ bash install-mxnet-osx-python.sh
 <!-- START - Mac OS Python GPU Installation Instructions -->
 <div class="gpu">
 <div class="pip virtualenv docker">
-</br>
 
 Try the **Build from Source** option for now.
 
-</div>
-
 <div class="build-from-source">
 
 **Step 1**  Install prerequisites - Homebrew, python development tools.
@@ -994,11 +991,11 @@ Refer to 
[#8671](https://github.com/apache/incubator-mxnet/issues/8671) for stat
 <br/>
 To build and install MXNet yourself, you need the following dependencies. 
Install the required dependencies:
 
-1. If [Microsoft Visual Studio 2015](https://www.visualstudio.com/downloads/) 
is not already installed, download and install it. You can download and install 
the free community edition.
+1. If [Microsoft Visual Studio 
2015](https://www.visualstudio.com/vs/older-downloads/) is not already 
installed, download and install it. You can download and install the free 
community edition.
 2. Download and install [CMake](https://cmake.org/) if it is not already 
installed.
 3. Download and install 
[OpenCV](http://sourceforge.net/projects/opencvlibrary/files/opencv-win/3.0.0/opencv-3.0.0.exe/download).
 4. Unzip the OpenCV package.
-5. Set the environment variable ```OpenCV_DIR``` to point to the ```OpenCV 
build directory```.
+5. Set the environment variable ```OpenCV_DIR``` to point to the ```OpenCV 
build directory``` (```C:\opencv\build\x64\vc14``` for example). Also, you need 
to add the OpenCV bin directory (```C:\opencv\build\x64\vc14\bin``` for 
example) to the ``PATH`` variable.
 6. If you don't have the Intel Math Kernel Library (MKL) installed, download 
and install [OpenBlas](http://sourceforge.net/projects/openblas/files/v0.2.14/).
 7. Set the environment variable ```OpenBLAS_HOME``` to point to the 
```OpenBLAS``` directory that contains the ```include``` and ```lib``` 
directories. Typically, you can find the directory in ```C:\Program files 
(x86)\OpenBLAS\```.
 8. Download and install 
[CUDA](https://developer.nvidia.com/cuda-downloads?target_os=Windows&target_arch=x86_64)
 and [cuDNN](https://developer.nvidia.com/cudnn). To get access to the download 
link, register as an NVIDIA community user.
@@ -1213,7 +1210,7 @@ Edit the Makefile to install the MXNet with CUDA bindings 
to leverage the GPU on
     echo "USE_CUDNN=1" >> config.mk
 ```
 
-Edit the Mshadow Makefile to ensure MXNet builds with Pascal's hardware level 
low precision acceleration by editing mshadow/make/mshadow.mk and adding the 
following after line 122:
+Edit the Mshadow Makefile to ensure MXNet builds with Pascal's hardware level 
low precision acceleration by editing 3rdparty/mshadow/make/mshadow.mk and 
adding the following after line 122:
 ```bash
 MSHADOW_CFLAGS += -DMSHADOW_USE_PASCAL=1
 ```


 

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to