Commit 014a99b1 authored by Carlos Torres's avatar Carlos Torres

Merge branch 'sphinx' into 'master'

Using  Sphinx

See merge request !26
parents 4d567fc7 c5a64688
......@@ -3,3 +3,4 @@
/site
*.DS_Store
_site/
/docs/build
......@@ -7,7 +7,7 @@ Includes info about:
- sc_pack,
- ShimmerCat server for the accelerator
Note that the documenation is structured around four different functions: *tutorials, how-to guides, explanation* and *technical reference*, based on the tips in https://www.divio.com/blog/documentation/.
Note that the documenation is structured around four different functions: *tutorials, how-to guides, explanation* and *technical reference*, based on the tips in https://www.divio.com/blog/documentation/.
## How to create a static website for the docs?
......@@ -24,7 +24,10 @@ Install the requirements:
- $ pip install -r requirements.txt
We use [MkDocs](https://www.mkdocs.org/) to generate the static site from the `.md` files. Take a look to the `mkdocs.yml` we have on the same directory this file is.
### We use two variants to generate the static site from the `.md` files.
1. We use [MkDocs](https://www.mkdocs.org/) to generate the static site from the `.md` files. Take a look to the `mkdocs.yml` we have on the same directory this file is.
To run the docs server locally use:
......@@ -34,3 +37,12 @@ Open up http://127.0.0.1:8000/ in your browser, and you'll see the index page be
If you want to know more details about how to use the MkDocs, please visit https://www.mkdocs.org/.
2. We use [Sphinx](https://www.sphinx-doc.org), take a look to the `docs/contents.rst` file.
We have developed our own theme (`shimmercat_qs_docs_sphinx_theme`), very similar to [pytorch_sphinx_theme](https://github.com/pytorch/pytorch_sphinx_theme).
To generate the static files:
- $ cd docs
- $ make html
The generated files will be in `docs/build/html` folder. You can open them directly in the browser or use the server of your choice.
......@@ -8,4 +8,9 @@ VENV_BIN=${CURRENT_DIR}/../venv/bin
source ${VENV_BIN}/activate
pip install -r ${CURRENT_DIR}/requirements.txt
mkdocs build --clean
${VENV_BIN}/sc_pack ctl restart shimmercat
\ No newline at end of file
cd "$CURRENT_DIR/docs"
make html
deactivate
sudo systemctl restart sc-deployment_docs_accelerator
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = ShimmerCatQSDocs
SOURCEDIR = .
BUILDDIR = build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
/* html {
font-size: 100%;
}
body,input{
font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif
}
code,kbd,pre{
font-family:"Roboto Mono","Courier New",Courier,monospace
} */
.version {
display: none;
}
/*.content-all {
max-width: 122rem;
margin-right: auto;
margin-left: auto;
}*/
.mobile-main-menu-links-container {
margin-top: -150px;
}
.tutorials-header .header-logo {
background-image: url(../images/shimmercat-logo.svg);
}
/*.mobile-main-menu.open {
background-color: #127caa;
}*/
.mobile-main-menu-header-container .header-logo {
height: 23px;
width: 93px;
background-image: url(../images/shimmercat-logo.svg);
background-repeat: no-repeat;
background-size: 93px 23px;
display: none;
float: left;
z-index: 10;
}
/*h1 {
font-size: 1.8rem;
letter-spacing: 0.5px;
line-height: 1.8rem;
text-transform: none;
margin: 1.375rem 0;
}*/
.project-logo{
position: absolute;
left: 30px;
font-size: 1.3rem;
color: #FFFFFF;
opacity: 1.0;
}
.logo_evicio {
max-width: 20%;
width: 20%;
}
.table-days {
}
.header-holder{
background-color: #2F2F2F;
border-bottom: 1px solid #2F2F2F;
}
.header-holder .main-menu ul li a {
color: #FFFFFF;
opacity: 0.7;
}
.header-holder .main-menu ul li a:hover,
.header-holder .main-menu ul li a.active {
color: #FFFFFF;
opacity: 1;
}
/*.table-days table:not([class]) th {
min-width: 10rem;
padding: 1.2rem 1.6rem;
background-color: rgba(0, 0, 0, 0.54);
color: white;
vertical-align: top;
}
.table-days table thead tr th:first-child {
width: 80%
}
.table-days table thead tr th:last-child {
width: auto;
}
.table-days table:not([class]) {
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);
max-width: 100%;
border-radius: 0.2rem;
font-size: 1.0rem;
overflow: auto;
-webkit-overflow-scrolling: touch;
}
.table-days table:not([class]) td {
border-top: 0.1rem solid rgba(0, 0, 0, 0.07);
vertical-align: top;
}*/
article.pytorch-article table tr th:first-of-type,
article.pytorch-article table tr td:first-of-type {
padding-left: 1.2rem;
}
.pytorch-right-menu a {
font-size: 0.8rem;
line-height: 0.8rem;
}
.pytorch-left-menu a:link,
.pytorch-left-menu a:visited,
.pytorch-left-menu a:hover,
.pytorch-right-menu a:link,
.pytorch-right-menu a:visited,
.pytorch-right-menu a:hover {
color: #6c6c6d;
padding: 0;
text-decoration: none;
}
.pytorch-left-menu a:link.reference.internal,
.pytorch-left-menu a:visited.reference.internal,
.pytorch-left-menu a:hover.reference.internal,
.pytorch-right-menu a:link.reference.internal,
.pytorch-right-menu a:visited.reference.internal,
.pytorch-right-menu a:hover.reference.internal {
margin-bottom: 0.8rem;
position: relative;
}
@media screen and (min-width: 1100px) {
.header-logo {
background-size: 24px 24px;
position: absolute;
height: 24px;
width: 24px;
top: 4px;
float: none;
}
.header-holder {
height: 70px;
}
}
@media screen and (min-width: 1100px) {
/* .pytorch-left-menu {
display: block;
overflow-x: hidden;
overflow-y: hidden;
padding-bottom: 110px;
padding: 1.5rem 1.875rem 0 0;
width: 25%;
z-index: 200;
float: left;
margin-left: 5%;
}
.pytorch-container {
margin-left: 30%;
margin-right: 5%;
padding-top: 1.5rem;
}
.header-holder .container {
padding-right: 5%;
padding-left: 5%;
} */
}
/*
.container-fluid.header-holder{
background-color: #127caa;
}*/
/*.tutorials-header .main-menu ul li a {
color: #FFFFFF;
display: block;
margin-top: 0;
transition: opacity 0.25s, -webkit-transform 0.4s cubic-bezier(0.1, 0.7, 0.1, 1);
transition: transform 0.4s cubic-bezier(0.1, 0.7, 0.1, 1), opacity 0.25s;
transition: transform 0.4s cubic-bezier(0.1, 0.7, 0.1, 1), opacity 0.25s, -webkit-transform 0.4s cubic-bezier(0.1, 0.7, 0.1, 1);
font-size: 1.1rem;
opacity: 0.7;
}
.tutorials-header .main-menu ul li a:hover,
.tutorials-header .main-menu ul li a.active{
color: #FFFFFF;
opacity: 1;
}
.md-footer-meta.md-typeset {
padding: 20px;
text-align: center;
background: #000000;
opacity: 0.8;
}
.tutorials-header .main-menu-open-button {
background-image: url(../images/icon-menu-dots-white.svg);
}
.md-footer-copyright a {
color: #FFFFFF;
opacity: 0.8;
}*/
@media screen and (max-width: 768px) {
h1 {
font-size: 1.2rem;
letter-spacing: 0.5px;
line-height: 1.2rem;
text-transform: none;
margin: 0.5rem 0;
}
.header-logo {
height: 25px;
width: 25px;
background-repeat: no-repeat;
background-size: 25px 25px;
display: block;
float: left;
z-index: 10;
}
.project-logo {
font-size: 1.0rem;
}
.pytorch-left-nav-collapsed {
background-size: 10px 9px;
background-position: right 4px;
width: 100%;
}
.pytorch-left-nav-collapsible {
background-size: 10px 9px;
background-position: right 4px;
width: 100%;
}
}
.pytorch-left-nav-collapsed {
background-size: 10px 9px;
background-position: right 4px;
width: 100%;
}
.pytorch-left-nav-collapsible {
background-position: right 9px;
width: 100%;
}
.pytorch-left-menu ul,
.pytorch-right-menu ul {
margin-bottom: 1.0rem;
}
@media screen and (min-width: 768px) {
.docs-tutorials-resources {
padding-top: 0;
padding-bottom: 0;
}
}
element.style {
width: 100%;
position: absolute;
bottom: -50px;
}
/*.site-footer {
padding: 2.5rem 0;
width: 100%;
background-image: none;
background-color: rgba(18, 124, 170);
background-size: 100%;
margin-left: 0;
margin-right: 0;
position: relative;
z-index: 201;
}
.site-footer a,
.site-footer a:link{
color: #FFFFFF;
opacity: 0.8;
}
.site-footer a:hover,
.site-footer a:visited {
color: #FFFFFF;
opacity: 1;
}
.site-footer ul li {
font-size: 1.1rem;
line-height: 2rem;
color: #6c6c6d;
padding-bottom: 0.375rem;
}*/
.footer-logo {
background-image: url(../images/shimmercat-logo.svg);
}
img[alt="create_token"] {
max-width: 100%
}
img[alt="curl"],
img[alt="what-is-curl-command-Linux"],
img[alt="cdn_ssl_tls"],
img[alt="cdn_ssl_tls_1"],
img[alt="cdn_ssl_tls_2"],
img[alt="cdn_ssl_tls_3"],
img[alt="cdn_ssl_tls_4"],
img[alt="cdn_ssl_tls_5"],
img[alt="cdn_ssl_tls_6"],
img[alt="cdn_ssl_tls_7"],
img[alt="cdn_ssl_tls_8"]{
max-width: 80%
}
img[alt="ansible_explained"],
img[alt="docker_explained"] {
max-width: 75%
}
img[alt="pops-1"],
img[alt="servers"],
img[alt="ram"],
img[alt="security"],
img[alt="load-balancing"] {
max-width: 60%;
}
img[alt="theinternet"],
img[alt="2circles"],
img[alt="money-icon"],
img[alt="Template-img/caching/images_icon"],
img[alt="computer-icon"],
img[alt="truck-icon"],
img[alt="purge-cache"],
img[alt="theinternet-dns"] {
max-width: 50%
}
img[alt="linux"],
img[alt="windows"],
img[alt="apple"],
img[alt="clipboard_icon"] {
vertical-align: baseline;
}
img[alt="linux"],
img[alt="windows"],
img[alt="apple"] {
max-width: 3%
}
img[alt="clipboard_icon"] {
max-width: 1.5%
}
img[alt="api_overview"] {
max-width: 50%
}
<?xml version="1.0" encoding="UTF-8"?>
<svg width="25px" height="6px" viewBox="0 0 25 6" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 51.2 (57519) - http://www.bohemiancoding.com/sketch -->
<title>Page 1</title>
<desc>Created with Sketch.</desc>
<defs>
<polygon id="path-1" points="0 0.4815 4.81659091 0.4815 4.81659091 5.249925 0 5.249925"></polygon>
<polygon id="path-3" points="0.683560606 0.4815 5.50022727 0.4815 5.50022727 5.249925 0.683560606 5.249925"></polygon>
<polygon id="path-5" points="0.61030303 0.4815 5.42621212 0.4815 5.42621212 5.249925 0.61030303 5.249925"></polygon>
</defs>
<g id="desktop" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Behaviors" transform="translate(-856.000000, -249.000000)">
<g id="mobile" transform="translate(-3.000000, -4.000000)">
<g id="condensed-menu-scroll" transform="translate(530.000000, 158.000000)">
<g id="Page-1" transform="translate(329.000000, 95.000000)">
<g id="Group-3">
<mask id="mask-2" fill="white">
<use xlink:href="#path-1"></use>
</mask>
<g id="Clip-2"></g>
<path d="M-7.57575758e-05,2.865675 C-7.57575758e-05,1.548675 1.07871212,0.481425 2.40825758,0.481425 C3.73856061,0.481425 4.81659091,1.548675 4.81659091,2.865675 C4.81659091,4.182675 3.73856061,5.249925 2.40825758,5.249925 C1.07871212,5.249925 -7.57575758e-05,4.182675 -7.57575758e-05,2.865675" id="Fill-1" fill-opacity="0.5" fill="#FFFFFF" mask="url(#mask-2)"></path>
</g>
<g id="Group-6" transform="translate(9.000000, 0.000000)">
<mask id="mask-4" fill="white">
<use xlink:href="#path-3"></use>
</mask>
<g id="Clip-5"></g>
<path d="M0.683560606,2.865675 C0.683560606,1.548675 1.76234848,0.481425 3.09265152,0.481425 C4.42295455,0.481425 5.50022727,1.548675 5.50022727,2.865675 C5.50022727,4.182675 4.42295455,5.249925 3.09265152,5.249925 C1.76234848,5.249925 0.683560606,4.182675 0.683560606,2.865675" id="Fill-4" fill-opacity="0.5" fill="#FFFFFF" mask="url(#mask-4)"></path>
</g>
<g id="Group-9" transform="translate(19.000000, 0.000000)">
<mask id="mask-6" fill="white">
<use xlink:href="#path-5"></use>
</mask>
<g id="Clip-8"></g>
<path d="M0.61030303,2.865675 C0.61030303,1.548675 1.68833333,0.481425 3.01863636,0.481425 C4.34893939,0.481425 5.42621212,1.548675 5.42621212,2.865675 C5.42621212,4.182675 4.34893939,5.249925 3.01863636,5.249925 C1.68833333,5.249925 0.61030303,4.182675 0.61030303,2.865675" id="Fill-7" fill-opacity="0.5" fill="#FFFFFF" mask="url(#mask-6)"></path>
</g>
</g>
</g>
</g>
</g>
</g>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 15.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="178.5px" height="178.5px" viewBox="216.814 283.29 178.5 178.5" enable-background="new 216.814 283.29 178.5 178.5"
xml:space="preserve">
<g>
<path fill="#127CAA" d="M309.825,283.354l-1.849,88.74l-91.163-1.339c0.956-48.45,40.545-87.465,89.25-87.465
C307.339,283.29,308.613,283.29,309.825,283.354z"/>
<path fill="#DB3A34" d="M395.313,372.54c0,0.255,0,0.574,0,0.829l-87.337-1.275l1.849-88.74
C357.383,285.33,395.313,324.473,395.313,372.54z"/>
<path fill="#FCBA04" d="M395.313,373.369c-0.446,48.896-40.226,88.421-89.186,88.421l1.849-89.696L395.313,373.369z"/>
<path fill="#60992D" d="M307.977,372.094l-1.849,89.696h-0.064c-49.278,0-89.25-39.972-89.25-89.25c0-0.574,0-1.147,0-1.785
L307.977,372.094z"/>
</g>
<circle fill="#2F2F2F" cx="306.063" cy="372.54" r="75.926"/>
<g>
<path fill="#FFFFFF" d="M261.694,388.223c0.893,0,1.466,0,2.104,0c8.606,0,17.149,0,25.755,0c2.741,0,3.57-0.765,3.697-3.443
c0.063-1.147,0.063-2.295-0.064-3.442c-0.255-2.104-1.02-2.741-3.124-2.805c-6.502,0-13.005,0-19.571,0
c-3.379,0-6.757,0-10.072-0.255c-4.973-0.382-8.033-3.188-8.861-8.16c-0.893-5.546-0.893-11.156,0.063-16.703
c0.893-5.355,4.463-8.224,10.009-8.288c10.901-0.063,21.739-0.063,32.64,0c5.61,0,8.606,2.741,9.18,8.415
c0.191,1.913,0.191,3.825,0.063,5.737c-0.319,4.08-4.08,6.12-7.714,4.271c-1.53-0.765-2.167-2.104-2.422-3.698
c-0.127-0.892-0.191-1.785-0.255-2.741c-0.765-0.063-1.402-0.127-1.976-0.127c-8.479-0.063-17.021-0.063-25.5-0.127
c-0.446,0-0.893,0-1.403,0c-1.721,0.127-2.359,0.574-2.55,2.359c-0.191,1.657-0.191,3.379,0,5.036
c0.191,1.785,0.956,2.359,2.741,2.359c4.016,0.063,7.969,0,11.985,0c5.228,0,10.455,0,15.619,0c6.821,0,10.392,2.805,11.22,9.499
c0.638,4.973,0.765,10.073-0.127,15.109c-0.957,5.737-4.271,8.606-10.136,8.606c-11.029,0.063-22.058,0.063-33.086,0
c-5.1,0-7.777-2.359-8.479-7.459c-0.319-2.422-0.383-4.909-0.127-7.331c0.318-2.869,2.231-4.144,5.164-4.08
c2.933,0.063,4.526,1.53,4.845,4.462C261.439,386.31,261.566,387.139,261.694,388.223z"/>
<path fill="#FFFFFF" d="M335.134,399.952c-5.419,0-10.901,0-16.32,0c-0.765,0-1.529,0-2.295-0.063
c-3.952-0.318-6.566-2.486-7.395-6.375c-0.319-1.466-0.511-3.06-0.511-4.526c-0.063-10.965-0.063-21.93,0-32.895
c0-1.338,0.191-2.741,0.446-4.08c0.829-4.335,3.507-6.63,7.969-6.821c1.977-0.064,4.017,0,5.993,0c9.435,0,18.87,0.063,28.305,0
c6.312-0.064,9.562,2.932,9.817,9.69c0.063,1.466,0.063,2.933-0.063,4.335c-0.255,3.251-2.04,4.909-5.228,4.845
c-3.124,0-4.781-1.53-4.973-4.781c-0.191-2.677-0.701-2.358-2.613-2.358c-8.479,0-17.021,0-25.5,0
c-2.933,0-3.315,0.382-3.698,3.188c-0.127,0.701-0.127,1.402-0.127,2.04c0,6.885,0,13.77,0,20.719c0,1.02,0.063,1.976,0.255,2.996
c0.318,1.785,0.956,2.359,2.741,2.422c1.912,0.064,3.825,0,5.737,0c6.821,0,13.643,0,20.464,0c2.55,0,2.55,0,2.741-2.422
c0.255-3.06,1.849-4.717,4.781-4.845c2.933-0.127,5.164,1.53,5.355,4.526c0.127,2.741,0.063,5.546-0.446,8.224
c-0.766,4.017-3.634,6.184-7.714,6.184C346.928,400.017,341.062,399.952,335.134,399.952
C335.134,399.889,335.134,399.889,335.134,399.952z"/>
</g>
</svg>
jQuery(function($) {
var path = window.location.href; // because the 'href' property of the DOM element is the absolute path
$('.main-menu ul li a').each(function() {
if (this.href === path) {
$(this).addClass('active');
}
});
$("p.caption").each(function() {
var act = $(this);
act.addClass("left-nav-top-caption");
$("span.caption-text").addClass("pytorch-left-nav-collapsed");
act.next("ul").hide();
});
$("span.caption-text").on("click", function(e) {
e.preventDefault();
$("span.caption-text").removeClass('pytorch-left-nav-collapsible');
$("span.caption-text").addClass('pytorch-left-nav-collapsed');
var $this = $(this);
if ($this.parent().next("ul").hasClass('show')) {
$this.parent().next("ul").removeClass('show');
$this.parent().next("ul").slideUp(350);
} else {
$this.parent().parent().find('ul').removeClass('show');
$this.parent().parent().find('ul').slideUp(350);
$this.parent().next("ul").toggleClass('show');
$this.parent().next("ul").slideToggle(350);
$this.addClass('pytorch-left-nav-collapsible');
$this.removeClass('pytorch-left-nav-collapsed');
}
});
$('.reference.internal.current').parent().parent().prev().children().click();
$('.toggle__demo').click(function(e) {
e.preventDefault();