Skip to content

Commit 672aacf

Browse files
author
Sylvain MARIE
committed
Trying to bring back code highlighting in doc. Fixes #181
1 parent 0318536 commit 672aacf

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

.travis.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ matrix:
6767
sudo: true
6868
- name: "Python 3.7 Pytest latest - DEPLOY WebSite+Coverage+PyPi"
6969
python: 3.7
70-
env: PYTEST_VERSION="" PYTEST_HTML_VERSION="==1.9.0" SHOULD_DEPLOY="true"
70+
env: PYTEST_VERSION="" PYTEST_HTML_VERSION="==1.9.0" DEPLOY_ENV="true"
7171
dist: xenial
7272
sudo: true
7373

@@ -101,7 +101,7 @@ install:
101101
- python ci_tools/py_install.py conda ci_tools/requirements-conda.txt
102102
- python ci_tools/py_install.py pip ci_tools/requirements-pip.txt
103103
# mkdocs does not work anymore on python 2 so lets only do it when needed
104-
- if [ "${SHOULD_DEPLOY}" = "true" ]; then pip install mkdocs-material mkdocs; fi;
104+
- if [ "${DEPLOY_ENV}" = "true" ]; then pip install mkdocs-material mkdocs pymdown-extensions pygments; fi;
105105
# travis-specific installs
106106
- pip install PyGithub # for ci_tools/github_release.py
107107
- pip install codecov # See https://github.com/codecov/example-python.
@@ -110,7 +110,7 @@ install:
110110
- python -m pytest --version # - pytest --version
111111

112112
script:
113-
#- if [ "${SHOULD_DEPLOY}" = "true" ]; then python ci_tools/headers_check.py; fi;
113+
#- if [ "${DEPLOY_ENV}" = "true" ]; then python ci_tools/headers_check.py; fi;
114114
# - coverage run tests.py
115115
- pip install .
116116
- python -c "import os; os.chdir('..'); import pytest_cases"
@@ -147,7 +147,7 @@ after_success:
147147
# push but only if this is not a build triggered by a pull request
148148
# note: here we use the --dirty flag so that mkdocs does not clean the additional reports that we copied in the site
149149
# note: do not use the --dirty flag as it breaks client-side search
150-
if [ "${TRAVIS_PULL_REQUEST}" = "false" ] && [ "${SHOULD_DEPLOY}" = "true" ]; then echo "Pushing to github"; PYTHONPATH=pytest_cases/ mkdocs gh-deploy -v -f docs/mkdocs.yml --remote-name gh-remote; git push gh-remote gh-pages; fi;
150+
if [ "${TRAVIS_PULL_REQUEST}" = "false" ] && [ "${DEPLOY_ENV}" = "true" ]; then echo "Pushing to github"; PYTHONPATH=pytest_cases/ mkdocs gh-deploy -v -f docs/mkdocs.yml --remote-name gh-remote; git push gh-remote gh-pages; fi;
151151
else
152152
echo "File 'ci_tools/github_travis_rsa' has not been created, please check your encrypted repo token in .travis.yml, on the line starting with 'openssl aes-256-cbc...'"
153153
fi
@@ -161,7 +161,7 @@ deploy:
161161
on:
162162
tags: true
163163
# python: 3.5 #only one of the builds have to be deployed
164-
condition: $SHOULD_DEPLOY = "true"
164+
condition: $DEPLOY_ENV = "true"
165165
# server: https://test.pypi.org/legacy/
166166
distributions: "sdist bdist_wheel"
167167

@@ -172,7 +172,7 @@ deploy:
172172
on:
173173
tags: true
174174
# only one of the builds have to be deployed
175-
condition: $SHOULD_DEPLOY = "true"
175+
condition: $DEPLOY_ENV = "true"
176176

177177
# TODO update zenodo record
178178

ci_tools/run_tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ cleanup() {
1212

1313
trap "cleanup" INT TERM EXIT
1414

15-
if [ "${SHOULD_DEPLOY}" = "true" ]; then
15+
if [ "${DEPLOY_ENV}" = "true" ]; then
1616
# full
1717
# Run tests with "python -m pytest" to use the correct version of pytest
1818
echo -e "\n\n****** Running tests ******\n\n"

docs/mkdocs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ nav:
1313
theme: material # readthedocs mkdocs
1414

1515
markdown_extensions:
16+
- pymdownx.highlight # see https://squidfunk.github.io/mkdocs-material/reference/code-blocks/#highlight
17+
- pymdownx.superfences # same as above as well as code blocks inside other blocks
1618
- admonition # to add notes such as http://squidfunk.github.io/mkdocs-material/extensions/admonition/
17-
- codehilite:
18-
guess_lang: false
1919
- toc:
20-
permalink: true
20+
permalink: true

0 commit comments

Comments
 (0)