From c220974f3de322d88dafb66eadd3f26ba3e07232 Mon Sep 17 00:00:00 2001 From: Aaron Markham Date: Wed, 15 Aug 2018 09:49:01 -0700 Subject: [PATCH] [MXNET-744] Docs build tools update (#11990) [MXNET-744] Docs build tools update (#11990) --- ci/docker/runtime_functions.sh | 11 +- docs/Jenkinsfile | 2 +- docs/Makefile | 2 + docs/build_version_doc/artifacts/mxnet.css | 1479 ++++++++++++++++++ docs/build_version_doc/build_all_version.sh | 116 +- docs/build_version_doc/update_all_version.sh | 31 +- docs/conf.py | 8 +- docs/mxdoc.py | 45 +- docs/settings.ini | 38 + 9 files changed, 1673 insertions(+), 59 deletions(-) create mode 100644 docs/build_version_doc/artifacts/mxnet.css create mode 100644 docs/settings.ini diff --git a/ci/docker/runtime_functions.sh b/ci/docker/runtime_functions.sh index 24f844fdfc5a..e4aac8b18bdd 100755 --- a/ci/docker/runtime_functions.sh +++ b/ci/docker/runtime_functions.sh @@ -837,11 +837,14 @@ build_docs() { pushd . cd /work/mxnet/docs/build_version_doc # Parameters are set in the Jenkins pipeline: restricted-website-build - # $1 is the list of branches to build; $2 is the list of tags to display + # $1: the list of branches/tags to build + # $2: the list of tags to display # So you can build from the 1.2.0 branch, but display 1.2.1 on the site - ./build_all_version.sh $1 $2 - # $3 is the default version tag for the website; $4 is the base URL - ./update_all_version.sh $2 $3 $4 + # $3: the fork URL + ./build_all_version.sh $1 $2 $3 + # $4: the default version tag for the website + # $5: the base URL + ./update_all_version.sh $2 $4 $5 cd VersionedWeb tar -zcvf ../artifacts.tgz . popd diff --git a/docs/Jenkinsfile b/docs/Jenkinsfile index 0e1dce2dbbe5..9c7b857615b5 100644 --- a/docs/Jenkinsfile +++ b/docs/Jenkinsfile @@ -37,7 +37,7 @@ core_logic: { ws('workspace/docs') { utils.init_git() timeout(time: max_time, unit: 'MINUTES') { - sh "ci/build.py -p ubuntu_cpu --docker-registry ${env.DOCKER_CACHE_REGISTRY} --docker-build-retries 3 /work/runtime_functions.sh build_docs ${params.tags_to_build} ${params.tag_list} ${params.tag_default} ${params.domain}" + sh "ci/build.py -p ubuntu_cpu --docker-registry ${env.DOCKER_CACHE_REGISTRY} --docker-build-retries 3 /work/runtime_functions.sh build_docs ${params.tags_to_build} ${params.tag_list} ${params.fork} ${params.tag_default} ${params.domain}" archiveArtifacts 'docs/build_version_doc/artifacts.tgz' build 'restricted-website-publish' } diff --git a/docs/Makefile b/docs/Makefile index 4673d0ed1b5d..90603b0875fc 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -72,6 +72,8 @@ livehtml: sphinx-autobuild --ignore "web-data/*" -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html html: + export BUILD_VER=$(BUILD_VER) + @echo "Env var set for BUILD_VER: $(BUILD_VER)" $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." diff --git a/docs/build_version_doc/artifacts/mxnet.css b/docs/build_version_doc/artifacts/mxnet.css new file mode 100644 index 000000000000..cb771967b622 --- /dev/null +++ b/docs/build_version_doc/artifacts/mxnet.css @@ -0,0 +1,1479 @@ +/*-------------------- AmazonEmber font -----------------------------------*/ +@font-face { + font-family: AmazonEmber; + src: url(https://raw.githubusercontent.com/dmlc/web-data/master/mxnet/font/AmazonEmber_Rg.ttf); + font-weight: normal; +} + +@font-face { + font-family: AmazonEmber; + src: url(https://raw.githubusercontent.com/dmlc/web-data/master/mxnet/font/AmazonEmber_Bd.ttf); + font-weight: bold; +} + +@font-face { + font-family: AmazonEmber; + src: url(https://raw.githubusercontent.com/dmlc/web-data/master/mxnet/font/AmazonEmber_Th.ttf); + font-weight: 300; +} + + +/*-------------------- basic html elements and classes --------------------*/ +html, body { + margin: 0; + padding: 0; + background-color: #ffffff; +} + +body { + display: block; + visibility: hidden; + background-size: cover; + background-attachment: fixed; +} + +body, div { + font-family: AmazonEmber; + font-size: 16px; + color: #000; +} + +p { + font-family: AmazonEmber; + color: #000; + font-size: 16px; + line-height: 1.5em; +} + +#language-filter { + float: right; + margin-top: 5px; +} + +li, dt a, dt span { + font-size: 16px; + line-height: 1.5em; +} + +.footer { + z-index: 10; + position: relative; + bottom: 0; + width: 100%; +} + +/* /\*Content paragraph space*\/ */ +/* div.content p { */ +/* margin-top: 20px; */ +/* } */ + +/*------------------ Headings -------------------*/ +h1, h2, h3, h4 { + font-family: AmazonEmber; + margin-top: 18px; + color: #444; +} + +h1 { + margin-top: 5px; + margin-bottom: 25px; + font-size: 28px; + font-weight: bold; +} + +h2 { + font-size: 24px; + font-weight: bold; + margin-bottom: 15px; +} + +h3 { + font-size: 20px; + font-weight: bold; + margin-bottom: 10px; +} + +h4 { + font-size: 16px; + font-weight: bold; + margin-bottom: 10px; +} + +img { + border-style: hidden; + border-width: 0px 0px 0px 0px; + border-color: #ffffff; + /* white */ + padding: 0px 0px 0px 0px; + margin: 0px 0px 0px 0px; +} + +.topictitle { + font-size: 24px; + font-weight: bold; + color: #e47911; + padding: 0 0 14px 0; +} + +.section:before { + content: " "; + display: block; + height: 60px; /* fixed header height*/ + margin: -60px 0 0; /* negative fixed header height */ +} + +/*-----------------------nav bar-----------------------*/ +.navbar { + opacity: 0.9; + border: 0px; + height: 60px; + margin-bottom: 0px; + border-bottom: 0.01em solid #fff; + background-image: url("https://raw.githubusercontent.com/dmlc/web-data/master/mxnet/image/mxnet-navbar.png"); + background-size: cover; + background-attachment: scroll; +} + +.navbar .container { + position: relative; + width: 100%; +} + +@media screen and (max-width: 510px) { + .navbar { + height: 60px; + } +} + +#header-inner { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: box; + display: flex; + -webkit-box-orient: horizontal; + -moz-box-orient: horizontal; + -webkit-box-lines: single; + -moz-box-lines: single; + -webkit-flex-flow: row nowrap; + -ms-flex-flow: row nowrap; + flex-flow: row; + -webkit-box-align: center; + -ms-flex-align: center; + -webkit-align-items: center; + align-items: center; + padding-left: 10px; +} + +@media screen and(max-width: 768 px) { + #header-inner { + -webkit-box-pack: center; + -ms-flex-pack: center; + -webkit-justify-content: center; + justify-content: center + } +} + +#logo-wrap { + -webkit-box-flex: 1; + padding-top: 0; + margin-top: 0; + width: 125px; + padding-left: 25px; + padding-right: 200px; +} + +#logo { + color: #fff; + width: 150px; + display: block; + float: left; + height: 60px; + padding: 15px 0 0 0; + text-decoration: none; +} + +#logo > img { + display: block; + width: 110px; +} + +.nav-bar { + display: block; + -webkit-box-flex: 1; + flex: 1 auto; + position: relative; + top: -12px; + white-space: nowrap; +} + +.main-nav-link { + color: #fff; + text-decoration: none; + line-height: 50px; + font-family: AmazonEmber; + display: inline-block; + padding: 0 15px; + font-weight: 500; +} + +.main-nav-link:hover { + opacity: 1; + color: #fff; + text-decoration: none; +} + +#dropdown-menu-position-anchor, +#dropdown-menu-position-anchor-docs, +#dropdown-menu-position-anchor-community, +#dropdown-menu-position-anchor-version, +#dropdown-menu-position-anchor-version-mobile { + position: relative; +} + +.navbar-menu { + top: 36px; + border-radius: 4px; + padding: 0; +} + +.navbar-menu > li > a { + color: #0079b2; + padding: 6px 16px; + +} + +#search-input-wrap { + display: block; + position: absolute; + top: 15px; + right: 20px; + width: 200px; + -webkit-transition: width 0.5s; + transition: width 0.5s; +} + +#search-input-wrap ul { + list-style-type: none; +} + +#searchIcon { + display: none; + position: fixed; + top: 20px; + right: 35px; + color: white; +} + +.searchBox { + position: absolute; + top: 0; + left: 0; + width: 200px; + background: transparent; + border-radius: 5px; + -webkit-transition: width 0.5s; + transition: width 0.5s; +} + +.searchBox input { + background: transparent; +} + +.searchBox input::placeholder { + font-weight: 200; +} + +.searchBoxNorm input::placeholder { + color: white; +} + +.searchBoxExp input::placeholder { + color: dimgray; +} + +.searchBtn { + display: none; + position: absolute; + top: 0; + right: 0; + width: 40px; +} + +@media screen and (max-width: 510px) { + #search-input-wrap { + width: 120px; + margin-right: 10px; + } + + .searchBox { + width: 120px; + } +} + +#lang-select-wrap { + display: block; + position: fixed; + right: 120px; + top: 5px +} + +#lang-select-label { + color: #fff; + opacity: .7; + font-family: AmazonEmber; + line-height: 50px +} + +#lang-select-label span { + padding-left: 8px +} + +#lang-select-label i { + opacity: .7 +} + +#lang-select { + opacity: 0; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + -webkit-appearance: menulist-button; + font-size: inherit +} + +.github-btn { border: 0; overflow: hidden } + +.boxed { + border: 1px solid rgb(57, 144, 211); + background: #0079b2; + color: white; + font-weight: bold +} + +.boxed-bordered { + border: 3px solid rgba(0,0,0,.05); + background: #0079b2; + font-weight: bold; + color: white; +} + +/*burger icon*/ +div .burgerIcon { + font-size: 25px; + position: fixed; + right: 155px; + top: 11px; + display: none; + width: 30px; +} + +div .burgerIcon a { + color: white; +} + +/*burger menu*/ +#burgerMenu, #plusMenu { + list-style-type: none; + margin-top: 10px; + padding: 0; + background-color: white; + list-style-position: inside; + min-width: 100px; +} + +#burgerMenu a, #plusMenu a { + display: table-cell; + font-size: 15px; + color: #0079b2; + vertical-align: middle; + height: 30px; + padding-left: 5px; + width: 108px; + max-width: 250px; +} + +#plusMenu .dropdown-submenu>.dropdown-menu { + left: 127px; + top: 0; + background: #fff; +} + +#burgerMenu li, #plusMenu li { + height: 30px; + list-style-position: inside; +} + +li.dropdown-submenu ul.dropdown-menu { + min-width: 75px; +} + +li.dropdown-submenu ul.dropdown-menu li { + border-style: none !important; +} + +li.dropdown-submenu ul.dropdown-menu a { + padding-left: 20px !important; +} + +@media screen and (max-width: 420px) { + li.dropdown-submenu ul.dropdown-menu a { + font-size: 12px !important; + } +} + +/*dropdown submenu*/ +.dropdown-submenu { + position: relative; +} + +.dropdown-submenu>.dropdown-menu { + top: -8px; + left: 250px; + -webkit-border-radius: 0 6px 6px 6px; + -moz-border-radius: 0 6px 6px; + border-radius: 0 6px 6px 6px; + background: transparent; +} + +.dropdown-submenu:hover>.dropdown-menu { + display: block; +} + +.dropdown-submenu>a:after { + display: block; + content: " "; + float: right; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; + border-width: 5px 0 5px 5px; + border-left-color: #ccc; + margin-top: 10px; + margin-right: -10px; +} + +.dropdown-submenu:hover>a:after { + border-left-color: #fff; +} + +.dropdown-submenu.pull-left { + float: none; +} + +.dropdown-submenu.pull-left>.dropdown-menu { + left: -100%; + margin-left: 10px; + -webkit-border-radius: 6px 0 6px 6px; + -moz-border-radius: 6px 0 6px 6px; + border-radius: 6px 0 6px 6px +} + +/*Plus icon*/ +.plusIcon { + display: none; + position: absolute; + top: 20px; + right: 210px; + width: 30px; +} + +.glyphicon-plus { + color: white; +} + +@media screen and (max-width:600px) { + div .plusIcon, .nav-bar { + display: none !important; + } + + div.burgerIcon { + display: block; + position: fixed; + left: 45px; + } + + #burgerMenu { + position: fixed; + left: 0; + top: 49px; + width: 100%; + height: 100%; + background: url(https://raw.githubusercontent.com/dmlc/web-data/master/mxnet/image/mxnet-background-compressed.jpeg); + background-attachment: initial; + background-size: cover; + } + + #burgerMenu a { + display: block; + font-size: 19px; + width: auto; + padding-left: 75px; + padding-top: 10px; + color: #fff; + text-decoration: none; + } + + #burgerMenu a:hover { + color: initial; + background-color: inherit; + } + + #burgerMenu li { + border-bottom: 1px solid lightgray; + height: 50px; + } + + #logo-wrap { + margin-left: 30px; + } +} +/*--------------------------banner---------------------------*/ +#splash{ + padding:60px 0 0 0; + background-size:cover; + background-attachment:fixed; + color:#fff; + text-align:center +} + +#splash #banner { + text-align: center +} + +#banner-title span { + font-family: AmazonEmber; + font-weight: bold; +} + +#banner-title { + padding: 60px 0 10px 0; + font-size: 40px; + line-height: 55px; + font-weight: 500; + font-family: AmazonEmber; + color: #fff; + max-width: 600px; + text-align: left; + margin-left: 30px; +} + +#landing-title { + margin-right: 40px; + font-size: 35px; + color: #fff; + font-family: AmazonEmber; + font-weight: 300; +} + +#intro { + font-size: 16px; + color: #fff; + font-family: AmazonEmber; + font-weight: 300; +} + +@media screen and (max-width:768px) { + #banner-title { + font-size: 30px; + padding: 60px 30px 10px 30px; + margin-left: 0; + } +} + +#splash h1{ + font-size: 40px; + margin-bottom: 20px; +} + +#splash #social{ + margin:2em 0 4em 0; +} + +#landing-btn-blk { + margin-top: 2em; +} + +#why_mxnet, #install_blk { + margin:2em 0; + display: inline; +} + +#why_mxnet { + padding-left: 20px; +} + +@media screen and (max-width:400px) { + #install_blk, #install_blk{ + display: block; + } + + #install_blk { + padding-left: 0; + margin-top: 0; + } +} + +#why_mxnet_btn { + border: 1.8px solid #FFFFFF; + color: #FFFFFF; + display: inline; + font-size: 18px; + font-family: AmazonEmber; + padding: 8px 20px; + -webkit-transition: .2s; + transition: .2s; +} + +#install_btn { + border: 1.8px solid #FFFFFF; + color: #fff; + display: inline; + font-size: 18px; + font-family: AmazonEmber; + padding: 8px 40px; + -webkit-transition: .2s; + transition: .2s; +} + +#release_btn { + width: auto; + border: none; +} + +#why_mxnet_btn:hover, #install_btn:hover { + background-color: #FFFFFF; + color: #0079b2; + opacity: 0.9; + text-decoration: none; +} + +/*------------------------index page section----------------------------*/ +.section-tout { + padding:3em 0 1em; +} + +.section-tout .container { + height: 220px; +} + +.section-tout .row { + height: 100%; +} + +.section-tout .row div { + height: 110%; + padding-left: 50px; + background-color:#fff; + box-shadow: 0px 2px 4px 0px rgba(0, 28, 36, 0.5); +} + +.section-tout .row a { + font-family: AmazonEmber; + position: absolute; + bottom: 20px; + border: solid 1px; + padding: 5px 10px; + color: #111; +} + +.section-tout h3{ + font-family: AmazonEmber; + font-size:20px; + color: #007dbc; + padding-top: 10px +} + +.section-tout p { + font-family: AmazonEmber; + margin-bottom:2em; +} + +@media (max-width: 1199px) { + .section-tout .container { + height: auto; + } + + .section-tout .row a { + position: inherit; + } + + .section-tout .row div { + padding-left: 45px; + } + + .section-tout .row p { + padding-bottom: 10px; + } +} + +@media (max-width: 767px) { + .section-tout .row div { + margin-bottom: -20px; + } +} + +.section-util { + padding:3em 0 3em; + text-align: left; + margin-bottom: 50px; +} + +.section-util .row > div { + height: 320px; + padding-left: 50px; + padding-top: 40px; +} + +.section-util .row div h2 { + font-family: AmazonEmber; + color: #fff; +} + +#model-zoo-blk { + background-color: #00446e; + box-shadow: 0px 2px 4px 0px rgba(0, 28, 36, 0.5); +} + +#example-blk { + background-color: #006ea7; + box-shadow: 0px 2px 4px 0px rgba(0, 28, 36, 0.5); +} + +#tutorial-blk { + background-color: #00a1c9; + box-shadow: 0px 2px 4px 0px rgba(0, 28, 36, 0.5); +} + +@media (min-width: 1200px) { + #model-zoo-blk { + width: 370px; + margin-right: 20px; + } + + #example-blk { + width: 370px; + margin-right: 20px; + } +} + +.section-util p { + font-family: AmazonEmber; + color: #fff; + position: absolute; + width: 70%; + font-size: 14px; + font-weight: 300; +} + +.section-util .util-btn { + position: absolute; + bottom: 30px; +} + +@media (max-width: 600px) { + .section-util .util-btn { + margin-top: 100px; + } +} + +.section-util .glyphicon { + font-size: 50px; + color: #b3ffff; +} + +.util-btn a { + font-family: AmazonEmber; + display: inline-block; + border: 1.8px solid; + -webkit-transition: .2s; + transition: .2s; + padding: 5px 30px; + color: #fff; +} + +.util-btn a:hover { + background-color: #0079b2; + color: #FFFFFF; + opacity: 0.9; + text-decoration: none; +} + +.section-util .container { + height: 250px; +} + +@media (max-width: 1199px) { + .section-util .container { + height: auto + } +} + +.section-inst { + padding:3em 0 3em; + border-bottom:1px solid rgba(0,0,0,.05); + text-align: left; + background-color: #fff; +} + +.section-inst .row div { + text-align: center; + margin-bottom: 30px; + height: 80px; +} + +.section-inst p { + font-family: AmazonEmber; + font-weight: 300; + margin-bottom:2em; + padding-left: 50px; + color: #111; +} + +.section-inst h2 { + font-family: AmazonEmber; + margin-top: -20px; + margin-bottom: 50px; + color: dimgray; + padding-left: 40px; +} + +@media (min-width: 1200px) { + .section-inst .row div.clear { + clear: both; + } +} + +@media (max-width: 1199px) { + .section-inst .row div.smallClear { + clear: both; + } +} + +.section-inst img { + -webkit-filter: grayscale(90%); /* Chrome, Safari, Opera */ + filter: grayscale(90%); + margin-bottom:2em +} +.section-inst img:hover { + -webkit-filter: grayscale(0%); /* Chrome, Safari, Opera */ + filter: grayscale(0%); +} + +.section-disclaimer { + padding: 3em 0 3em; + background-color: #f2f2f2; +} + +.section-disclaimer .container div { + padding-left: 50px; +} + +.section-disclaimer p { + padding-top: 2em; +} + +.footer li{ + float:right; + margin-right:1.5em; + margin-bottom:1.5em +} +.footer p{ + font-family: AmazonEmber; + font-weight: 300; + font-size: 12px; + clear:right; + margin-bottom:0; +} + +/*------------------content----------------------*/ +div.navbar + div.container { + padding-top: 65px; +} + +div.content { + padding: 80px 40px 40px 45px; + background: #fff; + width: calc(100% - 300px); + float: right; + overflow-x: hidden; + z-index: -1; +} + +@media (max-width: 999px) { + div.content { + overflow-x: auto; + width: 100%; + } +} + +div.page-tracker { + margin-bottom: 30px; + font-family: AmazonEmber; +} + +div.page-tracker ul { + padding-left: 0; +} + +div.page-tracker ul li { + text-transform: capitalize; + display: inline; +} + +div.page-tracker a { + text-transform: capitalize; + color: #337ab7; +} + +div.page-tracker li:last-child { + color: #aab7b8; +} + +div.page-tracker i { + margin: 0 10px; +} + +/*------------------sidebar-----------------------*/ +div.sphinxsidebar { + position: fixed; + padding-top: 40px; + height: 100%; + display: none; + visibility: hidden; + overflow: auto; +} + +div.leftsidebar { + width: 300px; + margin-left: 25px; + background: #f2f2f2; +} + +div.rightsidebar { + right: 20px; + width: 200px; + padding: 40px 0 15px 0; +} + +div.sphinxsidebar ul { + padding: 0; + list-style-type: none !important; +} + +div.sphinxsidebar a { + font-family: AmazonEmber; + font-size: 13px; +} + +div.rightsidebar div.sphinxsidebarwrapper > ul { + padding-left: 15px; +} + +div.sphinxsidebar li { + padding-top: 5px; + margin-bottom: 5px; + margin-left: -10px; +} + +div.leftsidebar > div.sphinxsidebarwrapper { + padding: 40px 20px 10px 20px; + background: #f2f2f2; +} + +div.leftsidebar > div.sphinxsidebarwrapper > ul > li { + margin-left: 20px; +} + +div.rightsidebar > div.sphinxsidebarwrapper > ul { + margin-left: 2px; + border-left: 4px solid #337ab7; +} + +div.rightsidebar > div.sphinxsidebarwrapper > ul > li { + margin-left: 5px; +} + +div.sphinxsidebar li.opened .tocToggle:before { + font-family: 'FontAwesome'; + content: "\f0d7"; + margin: 0 5px 0 -15px; + color: #999999; +} + +div.sphinxsidebar li.closed .tocToggle:before { + font-family: 'FontAwesome'; + content: "\f0da"; + margin: 0 5px 0 -15px; + color: #999999; +} + +div.sphinxsidebar li.leaf .tocToggle:before { + /*font-family: 'FontAwesome';*/ + content: " "; + margin: 0 5px 0 -15px; + color: #f2f2f2; +} + +@media (min-width:1015px) { + div.sphinxsidebar {display: block} +} + +div.sphinxsidebarwrapper h3 { + padding-top: 0; +} + +/*-------------------- table styles --------------------*/ +table { + margin-bottom: 10px; + border-collapse: collapse; } + +table p { + font-size: 16px; } + +td p:first-child { + margin-top: 0px; } + +td p:last-child { + margin-bottom: 0px; } + +td ul:first-child { + margin-top: 0px; + /* new 8/22/07 */ } + +td ol:first-child { + margin-top: 0px; + /* new 8/22/07 */ } + +div.table { + position: relative; } + +div.informaltable { + position: relative; } + +.table-expand-icon { + position: absolute; + right: -20px; + font-size: 24px; + background: #cccccc; + float: right; + bottom: 0; + cursor: pointer; } + +.table-contents table { + border-top: 1px solid #cccccc; + /* medium gray */ + border-left: 1px solid #cccccc; + /* medium gray */ + border-bottom: 0px; + border-right: 0px; + border-spacing: 0px; } + +.table-contents td { + font-size: 16px; + padding: 5px 5px 5px 5px; + border-bottom: 1px solid #cccccc; + /* medium gray */ + border-right: 1px solid #cccccc; + /* medium gray */ + border-left: 0px; + border-top: 0px; + vertical-align: top; } + +.table-contents th { + font-size: 16px; + padding: 5px 5px 5px 5px; + border-bottom: 1px solid #cccccc; + /* medium gray */ + border-right: 1px solid #cccccc; + /* medium gray */ + border-left: 0px; + border-top: 0px; + vertical-align: top; + background-color: #eeeeee; + /* light gray */ + color: #333333; + /* Dark gray */ + font-size: 16px; + font-weight: bold; + text-align: left; } + +/*----------------API class and function formatting---------------------*/ +p.rubric { + margin-top: 10px; +} + +dl { + padding-top: 20px; +} + +dt:target, .highlighted { + background-color: #e7f2fa; + border-bottom: 3px solid #c7254e; + margin-bottom: -3px; +} + +dt:target:before { + background-color: white; + content: ''; + display: block; + height: 60px; +} + +dt { + background: #e7f2fa; + border-bottom: solid #0079b2; +} + +dl.method dt { + background: #f0f0f0; + border-bottom: solid #ccc; +} + +dl.method dt code.descname { + color:#555; +} + +dl.attribute dt { + background: #f0f0f0; + border-bottom: solid #ccc; +} + +dl.attribute dt code.descname { + color:#555; +} + +dt em { + font-weight: normal; + font-style: normal; + font-size: 90%; +} + +code { + color: #337ab7; + background-color: #f5f5f5; +} + +code.docutils.literal { + color: #111; + font-weight: bold; +} + +a code.docutils.literal { + color: #337ab7; +} + +dt code { + color: #555; +} + +dl.last.docutils dt{ + background-color: transparent; + border-bottom: none; +} + +dl.docutils dt { + color: #555; + background-color: #f0f0f0; + border-bottom: solid #ccc; +} + +/*----------------Model zoo page style------------------*/ +#mxnet-model-zoo table, #mxnet-model-zoo td, #mxnet-model-zoo th { + border: 1px solid lightgray; +} + +#mxnet-model-zoo table { + margin-top: 30px; + border-collapse: collapse; +} + +#mxnet-model-zoo th { + vertical-align: middle; + text-align: center; + height: 50px; +} + +#mxnet-model-zoo td { + vertical-align: middle; + height: 50px; + padding: 10px; +} + +#mxnet-model-zoo tr:nth-child(even) { + background-color: #f2f2f2; +} + +/*--------- note block -----------*/ +div.admonition { + padding: 15px; + background-color: #f6f8fa; + border: 1px solid rgb(204, 204, 204); + border-radius: 4px; +} + +p.admonition-title { + color: #187dbb; +} + +/*------------ code block ------------*/ +pre { + background-color: #f6f8fa; +} + +/*-------------API table---------------------*/ +table.docutils { + margin-top: 15px; +} + +table.docutils td, table.docutils th { + padding-top: 5px; + padding-bottom: 5px; + padding-left: 10px; + padding-right: 10px; + /* border-top: 0; */ + /* border-left: 0; */ + /* border-right: 0; */ + border: 1px solid rgb(223, 226, 229); +} + +table.docutils tr:nth-child(even) { + background-color: #f6f8fa; +} + +/*---------------getting started homepage---------*/ + +#lang-demo ul { + margin-top: 20px; + margin-bottom: 15px; +} + +.option-title { + width: 100px; + float: left; + clear: none; + text-align: right; + font-size: 14px; + padding-top: 7px; + padding-bottom: 8px; + padding-right: 10px; + font-weight: bold; +} +.option-row { + padding-bottom: 8px; +} + +.install-inst { +} + +.btn-default:hover, .btn-default:focus, .btn-default:active, +.btn-default.active.focus, .btn-default.active:focus, .btn-default.active:hover, +.btn-default:active.focus, .btn-default:active:focus, .btn-default:active:hover, +.btn-default.active, .open>.dropdown-toggle.btn-default, +.btn-default:active:focus { + color: #fff; + background-color: #0079b2; + border-color: #0079b2; +} + +.btn-default:hover a { + color: #fff; +} + +#setup-options { + margin-top: 15px; + margin-bottom: 15px; + margin-left: 30px; +} + +.opt-group { + margin-top: 10px; + margin-bottom: 10px; +} + +/*----------------Copy code button------------------------*/ +.copy-btn { + display: none; + position: absolute; + right: 0; + width: 40px; + height: 38px; +} + +/*----------------Search function style------------------*/ +#searchPage { + width: 60%; + margin-left: 20%; +} + +#search-preview { + display: none; + background-color: white; + margin-top: -10px; + border: solid; + border-width: 1px; + border-color: #87CEFA; + width: 100%; +} + + +#search-preview p { + color: dimgray; + padding: 5px 20px 0 20px; +} + +#search-preview li { + padding-top: 10px; +} + +#search-preview ul { + padding-left: 20px; + padding-right: 20px; +} + +#search-preview hr { + margin: 10px 0 10px 0; + border-top: 1px solid dimgray; +} + +#search-results ul { + list-style-type: none; +} + +@media screen and (max-width: 510px) { + #search-preview { + position: fixed; + left: 0; + width: 100vw; + } + + #search-preview li { + font-size: 12px; + } +} + +/* enable absolute positioning */ +.inner-addon { + position: relative; +} + +/* style icon */ +.inner-addon .glyphicon { + position: absolute; + padding: 10px; + pointer-events: none; +} + +/* align icon */ +.left-addon .glyphicon { + right: 0px; +} +.right-addon .glyphicon { + right: 0px; +} + +/* add padding */ +.left-addon input { + font-family: AmazonEmber; + font-style: italic; +} +.right-addon input { + padding-right: 40px; +} + +.form-group .glyphicon-search { + color: white; +} + +/*----------------------Get started page----------------------------*/ +#why-mxnet img { + position: relative; + width: 60%; + left: 50%; + margin-right: -50%; + transform: translate(-50%); +} + +button.download { + color: #0079b2; +} + +/*----------------------Download button------------------------*/ +div.download-btn { + + border: solid 1px #000; + border-radius: 3px; + font-size: 90%; + height: 40px; + display: table; + float: left; +} + +div.download-btn a { + padding: 0 10px; + display: table-cell; + vertical-align: middle; + color: #000; +} + +div.download-btn a:hover { + background-color: #0079b2; + color: white; + text-decoration: none; +} + +div.download-btn.download-btn-top { + border-color: #ec7211; + background: #ec7211; + float: right; +} + +div.download-btn.download-btn-top a { + color: #fff; +} + +/*-------------output blocks----------------*/ + +.highlight-results .highlight pre { + background-color: #eeffcc; +} + +.cell-results-header { + color: #888; + padding-bottom: 3px; + font-style: italic; +} + +/*------------Download source-----------------*/ +#download-source-package { + display: none; + padding-top: 40px; +} + +/*------------Mobile dropdown menu smooth transition---------------*/ +@keyframes slide { + 0% { + left: -100%; + } + 25% { + left: -75%; + } + 50% { + left: -50%; + } + 75% { + left: -25%; + } + 100% { + left: 0; + } +} + +#burgerMenu { + animation-name: slide; + animation-duration: 0.3s; + animation-timing-function: ease-in-out; +} diff --git a/docs/build_version_doc/build_all_version.sh b/docs/build_version_doc/build_all_version.sh index 44cd540fda0b..d36f1f5edc64 100755 --- a/docs/build_version_doc/build_all_version.sh +++ b/docs/build_version_doc/build_all_version.sh @@ -19,20 +19,31 @@ # This script is for locally building website for all versions # Built files are stored in $built - -# Takes two arguments: -# tag list - semicolon delimited list of Github tags +# Default repo is mxnet_url="https://github.com/apache/incubator-mxnet.git" +# Default build directory is mxnet_folder="apache-mxnet" +# Takes two required arguments and one optional: +# tag list (required)- semicolon delimited list of Github tags # Example: "1.2.0;1.1.0;master" -# display list - semicolon delimited list of what to display on website +# display list (required) - semicolon delimited list of what to display on website # Example: "1.2.1;1.1.0;master" -# The number of tags for the two arguments must be the same. +# NOTE: The number of tags for the two arguments must be the same. +# Repo URL (optional) - a GitHub URL that is a fork of the MXNet project +# When this is used the build directory will be {github_username}-mxnet + # Example Usage: -# ./build_all_version.sh "1.2.0;1.1.0;master" "1.2.1;1.1.0;master" +# Build the content of the 1.2.0 branch in the main repo to the 1.2.1 folder. # ./build_all_version.sh "1.2.0" "1.2.1" +# Using the main project repo, map the 1.2.0 branch to output to a 1.2.1 directory; others as is: +# ./build_all_version.sh "1.2.0;1.1.0;master" "1.2.1;1.1.0;master" +# Using a custom branch and fork of the repo, map the branch to master, +# map 1.2.0 branch to 1.2.1 and leave 1.1.0 in 1.1.0: +# ./build_all_version.sh "sphinx_error_reduction;1.2.0;1.1.0" \ +# "master;1.2.1;1.1.0" https://github.com/aaronmarkham/incubator-mxnet.git set -e set -x +# $1 is the list of branches/tags to build if [ -z "$1" ] then echo "Please provide a list of branches or tags you wish to build." @@ -44,6 +55,7 @@ if [ -z "$1" ] build_arr=($tag_list) fi +# $2 is the list of output folders which will be displayed on the site if [ -z "$2" ] then echo "Please provide a list of version tags you wish to display on the site." @@ -58,13 +70,61 @@ if [ -z "$2" ] done fi -mxnet_url="https://github.com/apache/incubator-mxnet.git" -mxnet_folder="apache_mxnet" +# $3 is the GitHub project URL or fork +if [ -z "$3" ] + then + echo "Using the main project URL." + mxnet_url="https://github.com/apache/incubator-mxnet.git" + mxnet_folder="apache-mxnet" + else + mxnet_url=$3 + fork=${mxnet_url##"https://github.com/"} + fork_user=${fork%%"/incubator-mxnet.git"} + mxnet_folder=$fork_user"-mxnet" + echo "Building with a user supplied fork: $mxnet_url" +fi + +# This is the output folder built="VersionedWeb" + +function create_repo () { + repo_folder=$1 + mxnet_url=$2 + git clone $mxnet_url $repo_folder --recursive + echo "Adding MXNet upstream repo..." + cd $repo_folder + git remote add upstream https://github.com/apache/incubator-mxnet + cd .. +} + + +function refresh_branches () { + repo_folder=$1 + cd $repo_folder + git fetch + git fetch upstream + cd .. +} + + +function checkout () { + repo_folder=$1 + cd $repo_folder + # Overriding configs later will cause a conflict here, so stashing... + git stash + # Fails to checkout if not available locally, so try upstream + git checkout "$repo_folder" || git branch $repo_folder "upstream/$repo_folder" + if [ $tag == 'master' ]; then + git pull + fi + git submodule update --init --recursive + cd .. +} + + if [ ! -d "$mxnet_folder" ]; then mkdir $mxnet_folder - git clone $mxnet_url $mxnet_folder --recursive fi if [ ! -d "$built" ]; then @@ -81,25 +141,27 @@ fi for key in ${!build_arr[@]}; do tag=${build_arr[${key}]} cd "$mxnet_folder" - git fetch - if [ $tag == 'master' ] - then - git checkout master - git pull - echo "Building master..." - else - # Use "v$tag" for branches or pass that in from jenkins - git checkout "$tag" - echo "Building $tag..." + + # Each tag will get its own subfolder + if [ ! -d "$tag" ]; then + create_repo "$tag" "$mxnet_url" fi - git submodule update --init --recursive || exit 1 + refresh_branches $tag + + checkout $tag + + # Bring over the current configurations, so we can anticipate results. + cp ../../mxdoc.py $tag/docs/ + cp ../../settings.ini $tag/docs/ + cp ../../conf.py $tag/docs/ + cp ../../Doxyfile $tag/docs/ - make clean - cd docs - make clean - make html USE_OPENMP=1 || exit 1 - cd ../../ + echo "Building $tag..." + cd $tag/docs + make html USE_OPENMP=1 BUILD_VER=$tag || exit 1 + # Navigate back to build_version_doc folder + cd ../../../ # Use the display tag name for the folder name file_loc="$built/versions/${display_arr[${key}]}" if [ -d "$file_loc" ] ; then @@ -107,7 +169,9 @@ for key in ${!build_arr[@]}; do fi mkdir "$file_loc" echo "Storing artifacts for $tag in $file_loc folder..." - cp -a "$mxnet_folder/docs/_build/html/." "$file_loc" + cp -a "$mxnet_folder/$tag/docs/_build/html/." "$file_loc" done echo "Now you may want to run update_all_version.sh to create the production layout with the versions dropdown and other per-version corrections." +echo "The following pattern is recommended (tags, default tag, url base):" +echo "./update_all_version.sh "$tags_to_display " master http://mxnet.incubator.apache.org/" diff --git a/docs/build_version_doc/update_all_version.sh b/docs/build_version_doc/update_all_version.sh index e39b0a503412..0c91973bd198 100755 --- a/docs/build_version_doc/update_all_version.sh +++ b/docs/build_version_doc/update_all_version.sh @@ -22,21 +22,22 @@ # It assumes you have already run build_all_version.sh for # the tags you want to update. -# Takes three arguments: -# * tag list - semicolon delimited list of tags to display on site; Example: "1.1.0;1.0.0;master" -# * default tag - which version should the site default to; Example: 1.0.0 -# * root URL - for the versions dropdown to change to production or dev server; Example: http://mxnet.incubator.apache.org/ +# Takes three required arguments: +# * tag list (required) - semicolon delimited list of tags to display on site +# Example: "1.1.0;1.0.0;master" +# * default tag (required) - which version should the site default to +# Example: 1.0.0 +# * root URL (required) - for the versions dropdown to change to production or +# dev server. +# Example: http://mxnet.incubator.apache.org/ # Example Usage: -# ./update_all_version.sh "1.1.0;1.0.0;master" 1.0.0 http://mxnet.incubator.apache.org/ +# ./update_all_version.sh "1.2.1;1.1.0;1.0.0;master" master \ +# http://mxnet.incubator.apache.org/ set -e set -x -MASTER_SOURCE_DIR="../../docs" -STATIC_FILES_DIR="_static" -MXNET_THEME_DIR="_static/mxnet-theme" - if [ -z "$1" ] then echo "Please provide a list of version tags you wish to run." @@ -64,7 +65,6 @@ if [ -z "$3" ] root_url=$3 fi -mxnet_folder="apache_mxnet" built="VersionedWeb" tag_file="tag_list.txt" @@ -85,8 +85,8 @@ function update_mxnet_css { # 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 - echo "Copying mxnet.css from master branch to all versions...." - cp "$MASTER_SOURCE_DIR/$STATIC_FILES_DIR/mxnet.css" "$built/versions/$tag/_static" + echo "Copying mxnet.css from artifacts folder..." + cp "artifacts/mxnet.css" "$built/versions/$tag/_static" echo "Update fixes complete.." } @@ -121,12 +121,9 @@ for tag in $tag_list; do file_loc="$built/versions/$tag" fi - # Copy the latest README.md from master + # Copy the latest README.md; needs to come from local branch if [ $tag == 'master' ]; then - cd $mxnet_folder - git checkout master - cp README.md ../$built - cd .. + cp ../../README.md $built fi done diff --git a/docs/conf.py b/docs/conf.py index d018408d455a..656a1da96d69 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -33,13 +33,13 @@ # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. -needs_sphinx = '1.2' +needs_sphinx = '1.5.6' # General information about the project. project = u'mxnet' author = u'%s developers' % project -copyright = u'2015-2017, %s' % author -github_doc_root = 'https://github.com/dmlc/mxnet/tree/master/docs/' +copyright = u'2015-2018, %s' % author +github_doc_root = 'https://github.com/apache/incubator-mxnet/tree/master/docs/' doc_root = 'http://mxnet.io/' # add markdown parser @@ -107,7 +107,7 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. -exclude_patterns = ['virtualenv'] +exclude_patterns = ['3rdparty', 'build_version_doc', 'virtualenv', 'api/python/model.md', 'README.md'] # The reST default role (used for this markup: `text`) to use for all documents. #default_role = None diff --git a/docs/mxdoc.py b/docs/mxdoc.py index 8332ae22d48f..dabfd3bbb644 100644 --- a/docs/mxdoc.py +++ b/docs/mxdoc.py @@ -26,6 +26,29 @@ # import StringIO from io for python3 compatibility from io import StringIO import contextlib +from ConfigParser import SafeConfigParser + +_BUILD_VER = os.getenv('BUILD_VER', 'default') +print("Building version {}".format(_BUILD_VER)) +_DOC_SET = 'document_sets_' + _BUILD_VER + +parser = SafeConfigParser() +parser.read('settings.ini') + +if _DOC_SET not in parser.sections(): + _DOC_SET = 'document_sets_default' + +for section in [ _DOC_SET ]: + print("Document sets to generate:") + for candidate in [ 'scala_docs', 'clojure_docs', 'doxygen_docs', 'r_docs' ]: + print '%-12s : %s' % (candidate, parser.get(section, candidate)) + print + +_MXNET_DOCS_BUILD_MXNET = parser.getboolean('mxnet', 'build_mxnet') +_SCALA_DOCS = parser.getboolean(_DOC_SET, 'scala_docs') +_CLOJURE_DOCS = parser.getboolean(_DOC_SET, 'clojure_docs') +_DOXYGEN_DOCS = parser.getboolean(_DOC_SET, 'doxygen_docs') +_R_DOCS = parser.getboolean(_DOC_SET, 'r_docs') # white list to evaluate the code block output, such as ['tutorials/gluon'] _EVAL_WHILTELIST = [] @@ -72,7 +95,7 @@ def build_mxnet(app): def build_r_docs(app): """build r pdf""" r_root = app.builder.srcdir + '/../R-package' - pdf_path = root_path + '/docs/api/r/mxnet-r-reference-manual.pdf' + pdf_path = app.builder.srcdir + '/api/r/mxnet-r-reference-manual.pdf' _run_cmd('cd ' + r_root + '; R -e "roxygen2::roxygenize()"; R CMD Rd2pdf . --no-preview -o ' + pdf_path) dest_path = app.builder.outdir + '/api/r/' @@ -383,13 +406,21 @@ def setup(app): # If MXNET_DOCS_BUILD_MXNET is set something different than 1 # Skip the build step - if os.getenv('MXNET_DOCS_BUILD_MXNET', '1') == '1': + if os.getenv('MXNET_DOCS_BUILD_MXNET', '1') == '1' or _MXNET_DOCS_BUILD_MXNET: + print("Building MXNet!") app.connect("builder-inited", build_mxnet) - app.connect("builder-inited", generate_doxygen) - app.connect("builder-inited", build_scala_docs) - app.connect("builder-inited", build_clojure_docs) - # skipped to build r, it requires to install latex, which is kinds of too heavy - # app.connect("builder-inited", build_r_docs) + if _DOXYGEN_DOCS: + print("Building Doxygen!") + app.connect("builder-inited", generate_doxygen) + if _SCALA_DOCS: + print("Building Scala Docs!") + app.connect("builder-inited", build_scala_docs) + if _CLOJURE_DOCS: + print("Building Clojure Docs!") + app.connect("builder-inited", build_clojure_docs) + if _R_DOCS: + print("Building R Docs!") + app.connect("builder-inited", build_r_docs) app.connect('source-read', convert_table) app.connect('source-read', add_buttons) app.add_config_value('recommonmark_config', { diff --git a/docs/settings.ini b/docs/settings.ini new file mode 100644 index 000000000000..b438a071f708 --- /dev/null +++ b/docs/settings.ini @@ -0,0 +1,38 @@ +[mxnet] +build_mxnet = 0 + +[document_sets_default] +clojure_docs = 1 +doxygen_docs = 1 +r_docs = 0 +scala_docs = 1 + +[document_sets_1.2.0] +clojure_docs = 0 +doxygen_docs = 1 +r_docs = 0 +scala_docs = 1 + +[document_sets_1.1.0] +clojure_docs = 0 +doxygen_docs = 1 +r_docs = 0 +scala_docs = 0 + +[document_sets_1.0.0] +clojure_docs = 0 +doxygen_docs = 1 +r_docs = 0 +scala_docs = 0 + +[document_sets_0.12.0] +clojure_docs = 0 +doxygen_docs = 1 +r_docs = 0 +scala_docs = 0 + +[document_sets_0.11.0] +clojure_docs = 0 +doxygen_docs = 1 +r_docs = 0 +scala_docs = 0