Skip to content

Commit

Permalink
Theme (d2l-ai#423)
Browse files Browse the repository at this point in the history
* add frontpage.html

* change theme

* change permission

* fix build_html

* fix build html

* Update build_html.sh

* Update Makefile

* Update fasttext.md

* Update Jenkinsfile

* Update Jenkinsfile

* Update glove.md

* Update notation.md

* Update notation.md

* Update Makefile

* update mxtheme

* use python 3.6 to build

* Update Jenkinsfile
  • Loading branch information
Mu Li committed Nov 14, 2018
1 parent cd40357 commit bc5029a
Show file tree
Hide file tree
Showing 20 changed files with 301 additions and 538 deletions.
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
**/.ipynb_checkpoints
**/__pycache__
data/
build/
build/chapter*
build/_build
build/img
build/environment.yml
build/gluonbook
build/data
build/README.md
*.json
*.params
*.DS_Store
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "build/mx-theme"]
path = build/mx-theme
url = https://github.com/mli/mx-theme
28 changes: 28 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
stage("Build HTML") {
node {
ws('workspace/d2l-zh') {
checkout scm
sh "build/build_html.sh"
}
}
}
stage("Build PDF") {
node {
ws('workspace/d2l-zh') {
sh "build/build_pdf.sh"
}
}
}

stage("Publish") {
node {
ws('workspace/d2l-zh') {
sh """#!/bin/bash
set -ex
if [[ ${env.BRANCH_NAME} == master ]]; then
aws s3 sync --delete build/_build/html/ s3://zh.diveintodeeplearning.org/ --acl public-read
fi
"""
}
}
}
15 changes: 7 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ OBJ = $(patsubst %.md, build/%.md, $(MARKDOWN)) \
ORIGN_DEPS = $(wildcard img/* data/* gluonbook/*) environment.yml README.md
DEPS = $(patsubst %, build/%, $(ORIGN_DEPS))

PKG = build/_build/html/gluon_tutorials_zh.tar.gz build/_build/html/gluon_tutorials_zh.zip
PKG = build/_build/html/d2l-zh.tar.gz build/_build/html/d2l-zh.zip

pkg: $(PKG)

build/_build/html/gluon_tutorials_zh.zip: $(OBJ) $(DEPS)
build/_build/html/d2l-zh.zip: $(OBJ) $(DEPS)
cd build; zip -r $(patsubst build/%, %, $@ $(DEPS)) chapter*

build/_build/html/gluon_tutorials_zh.tar.gz: $(OBJ) $(DEPS)
build/_build/html/d2l-zh.tar.gz: $(OBJ) $(DEPS)
cd build; tar -zcvf $(patsubst build/%, %, $@ $(DEPS)) chapter*

build/%: %
Expand All @@ -33,10 +33,9 @@ build/%: %

html: $(DEPS) $(OBJ)
make -C build html
cp build/index.html build/_build/html/
cp -r img/frontpage/ build/_build/html/_images/

TEX=build/_build/latex/gluon_tutorials_zh.tex
TEX=build/_build/latex/d2l-zh.tex

build/_build/latex/%.pdf: img/%.svg
@mkdir -p $(@D)
Expand All @@ -61,8 +60,8 @@ pdf: $(DEPS) $(OBJ) $(PDFIMG)
sed -i /{\\\\tablename\\\\\ \\\\thetable{}\ --\ continued\ from\ previous\ page}/d $(TEX)
cd build/_build/latex && \
bash ../../convert_output_svg.sh && \
buf_size=10000000 xelatex gluon_tutorials_zh.tex && \
buf_size=10000000 xelatex gluon_tutorials_zh.tex
buf_size=10000000 xelatex d2l-zh.tex && \
buf_size=10000000 xelatex d2l-zh.tex

clean:
rm -rf build/chapter* build/_build $(DEPS) $(PKG)
1 change: 1 addition & 0 deletions build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .

all: html
.PHONY: help
help:
@echo "Please use \`make <target>' where <target> is one of"
Expand Down
96 changes: 96 additions & 0 deletions build/_static/frontpage.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
h1, .side-doc-outline {
display: none;
}
.document .page-content {
width: 100%;
}

h2, h3, h4 {
letter-spacing: 2px;
}
.mdl-grid {
align-items: center;
justify-content: center;
text-align: center;
padding: 150px 0 0 0;
}

#id2 h2 {
padding: 150px 0 0 0;
}

.header h2 {
font-size: 30px;
padding-bottom: 35px;
}

.header p {
font-size: 24px;
letter-spacing: 2px;
line-height: 36px;
padding-bottom: 10px;
}

.header img {
max-width: 350px;
}

.header .mdl-button {
margin: 0px 10px;
letter-spacing: 2px;
font-size: 16px;
margin: 1rem 1.5rem;
height: 40px;
width: 120px;
}


.author-item {
max-width: 300px;
}

.author-item h3 {
padding-top: 25px;
padding-bottom: 10px;
}
.author-item img {
border-radius: 50%;
width: 120px;
}
.authors h4 {
width: 100%;
}

.features .mdl-cell {
padding: 0 36px;
}
.features h2, .features-2 h2 {
padding-bottom: 24px;
}
.features-2 p {
padding: 0 200px;
}


@media (max-width: 1000px) {
.mdl-grid, #id2 h2 {
padding: 50px 0 0 0;
}

.header .mdl-button {
width: 150px;
margin: 10px 100px;
}

.header img, .features-2 img {
max-width: 300px;
}

.features img {
max-width: 350px;
}

.features-2 p {
padding: 0 24px;
}
}
16 changes: 0 additions & 16 deletions build/_static/gluon.css

This file was deleted.

Loading

0 comments on commit bc5029a

Please sign in to comment.