Skip to content

Commit

Permalink
Add disclaimer and download link (apache#7402)
Browse files Browse the repository at this point in the history
* Add disclaimer and download link

* Fix
  • Loading branch information
kevinthesun authored and lxn2 committed Aug 10, 2017
1 parent c55fc57 commit aed297a
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/_static/mxnet-theme/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,10 @@ <h2>Model Zoo</h2>
</div>
</div>
</div>

<div class="section-disclaimer">
<img src="https://raw.githubusercontent.com/dmlc/web-data/master/mxnet/image/apache_incubator_logo.png" height=60>
<p>
Apache MXNet is an effort undergoing incubation at The Apache Software Foundation (ASF), <strong>sponsored by the <i>Apache Incubator</i></strong>. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.
</p>
</div>
14 changes: 14 additions & 0 deletions docs/_static/mxnet.css
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,14 @@ li.dropdown-submenu ul.dropdown-menu a {
filter: grayscale(0%);
}

.section-disclaimer {
padding: 3em 3em 3em;
}

.section-disclaimer p {
padding-top: 2em;
}

.footer{
padding-top: 40px;
}
Expand Down Expand Up @@ -1244,3 +1252,9 @@ div.download_btn a:hover {
padding-bottom: 3px;
font-style: italic;
}

/*------------Download source-----------------*/
#download-source-package {
display: none;
padding-top: 40px;
}
58 changes: 58 additions & 0 deletions docs/build_version_doc/AddPackageLink.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

import os
import argparse
from bs4 import BeautifulSoup as bs

parser = argparse.ArgumentParser(description="Add download package link.",
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('--file_path', type=str, default='docs/_build/html/get_started/install.html',
help='file to be modified')
parser.add_argument('--current_version', type=str, default='master',
help='Current version')

if __name__ == '__main__':
args = parser.parse_args()
tag = args.current_version

src_url = "http://www.apache.org/dyn/closer.cgi/incubator/" \
"mxnet/%s-incubating/apache-mxnet-src-%s-incubating.tar.gz" % (tag, tag)
pgp_url = "http://www.apache.org/dyn/closer.cgi/incubator/" \
"mxnet/%s-incubating/apache-mxnet-src-%s-incubating.tar.gz.asc" % (tag, tag)
sha_url = "http://www.apache.org/dyn/closer.cgi/incubator/" \
"mxnet/%s-incubating/apache-mxnet-src-%s-incubating.tar.gz.sha" % (tag, tag)
md5_url = "http://www.apache.org/dyn/closer.cgi/incubator/" \
"mxnet/%s-incubating/apache-mxnet-src-%s-incubating.tar.gz.md5" % (tag, tag)

download_str = "<div class='btn-group' role='group'>"
download_str += "<div class='download_btn'><a href=%s>" \
"<span class='glyphicon glyphicon-download-alt'></span>" \
" Source for %s</a></div>" % (src_url, tag)
download_str += "<div class='download_btn'><a href=%s>PGP</a></div>" % (pgp_url)
download_str += "<div class='download_btn'><a href=%s>SHA-256</a></div>" % (sha_url)
download_str += "<div class='download_btn'><a href=%s>MD5</a></div>" % (md5_url)
download_str += "</div>"

with open(args.file_path, 'r') as html_file:
content = bs(html_file, 'html.parser')
download_div = content.find(id="download-source-package")
download_div['style'] = "display:block"
download_div.append(download_str)
outstr = str(content).replace('&lt;', '<').replace('&gt;', '>')
with open(args.file_path, 'w') as outf:
outf.write(outstr)
2 changes: 2 additions & 0 deletions docs/build_version_doc/build_doc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ then
cat $tag_list_file
tests/ci_build/ci_build.sh doc python docs/build_version_doc/AddVersion.py --file_path "docs/_build/html/" \
--current_version "$latest_tag" --root_url "http://mxnet.incubator.apache.org/"
tests/ci_build/ci_build.sh doc python docs/build_version_doc/AddPackageLink.py \
--file_path "docs/_build/html/get_started/install.html" --current_version "$latest_tag"
cp -a "docs/_build/html/." "$local_build"
cp $tag_list_file "$local_build/tag.txt"
rm -rf "$web_folder/.git"
Expand Down
2 changes: 2 additions & 0 deletions docs/get_started/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -1462,3 +1462,5 @@ Will be available soon.

</div>
</div>

# Download Source Package

0 comments on commit aed297a

Please sign in to comment.