From d2d05ef74fa41fa59a10fd0e63a295f4241e28ac Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Sat, 27 Oct 2018 10:52:29 +0100 Subject: [PATCH 1/4] support for circeci, updated Travis CI, added notebook example --- .circleci/config.yml | 77 ++++++++++++++++++++++++ .coveralls.yml | 1 - .gitignore | 1 + .pep8speaks.yml | 3 - .rtd-environment.yml | 2 + .travis.yml | 14 +++-- README.rst | 9 ++- appveyor.yml | 19 +++--- docs/conf.py | 3 + docs/index.rst | 6 +- docs/manual/images/notebook_cells.png | Bin 0 -> 13333 bytes docs/manual/notebook_support.ipynb | 81 ++++++++++++++++++++++++++ docs/release/ablog-v0.9-released.rst | 11 ++++ setup.py | 1 + 14 files changed, 206 insertions(+), 22 deletions(-) create mode 100644 .circleci/config.yml delete mode 100644 .coveralls.yml create mode 100644 docs/manual/images/notebook_cells.png create mode 100644 docs/manual/notebook_support.ipynb diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..0035810 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,77 @@ +apt-run: &apt-install + name: Install apt packages + command: | + apt update + apt install -y graphviz build-essential + +docs-install: &docs-install + name: Install Python dependencies + command: | + pip install werkzeug sphinx alabaster invoke python-dateutil sphinx-automodapi nbsphinx ipython + +version: 2 +jobs: + + egg-info-27: + docker: + - image: circleci/python:2.7 + steps: + - checkout + - run: python setup.py egg_info + + egg-info-35: + docker: + - image: circleci/python:3.5 + steps: + - checkout + - run: python setup.py egg_info + + egg-info-36: + docker: + - image: circleci/python:3.6 + steps: + - checkout + - run: python setup.py egg_info + + egg-info-37: + docker: + - image: circleci/python:3.7 + steps: + - checkout + - run: python setup.py egg_info + + html-docs: + docker: + - image: continuumio/miniconda3 + steps: + + - checkout + - run: *skip-check + - run: *apt-install + - run: *docs-install + - run: python setup.py build_sphinx -w + - store_artifacts: + path: build/sphinx/html/index.html + + - run: + name: "Built documentation is available at:" + command: DOCS_URL="${CIRCLE_BUILD_URL}/artifacts/${CIRCLE_NODE_INDEX}/${CIRCLE_WORKING_DIRECTORY/#\~/$HOME}/build/sphinx/html/index.html"; echo $DOCS_URL + +workflows: + version: 2 + + egg-info: + jobs: + - egg-info-27 + - egg-info-35 + - egg-info-36 + - egg-info-37 + + documentation: + jobs: + - html-docs + + +notify: + webhooks: + - url: https://giles.cadair.com/circleci \ No newline at end of file diff --git a/.coveralls.yml b/.coveralls.yml deleted file mode 100644 index da424c2..0000000 --- a/.coveralls.yml +++ /dev/null @@ -1 +0,0 @@ -repo_token: niCbipldEa8bIbuYwWyJqo7082UOtku0w diff --git a/.gitignore b/.gitignore index 9bd1819..bc15156 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ __pycache__/ *.py[cod] MANIFEST +docs/manual/.ipynb_checkpoints/* # Distribution / packaging build/ diff --git a/.pep8speaks.yml b/.pep8speaks.yml index 6b61688..c6c20d2 100644 --- a/.pep8speaks.yml +++ b/.pep8speaks.yml @@ -2,8 +2,5 @@ pycodestyle: max-line-length: 120 # Default is 79 in PEP8 exclude: - setup.py - - ez_setup.py - - ah_bootstrap.py - - astropy_helpers/ - docs/conf.py descending_issues_order: True diff --git a/.rtd-environment.yml b/.rtd-environment.yml index 9979374..6e5cb2e 100644 --- a/.rtd-environment.yml +++ b/.rtd-environment.yml @@ -8,3 +8,5 @@ dependencies: - invoke - python-dateutil - sphinx-automodapi +- nbsphinx +- ipython \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 4b8a840..3636741 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,12 +12,18 @@ sudo: false env: matrix: - PYTHON_VERSION=2.7 SPHINX_VERSION=1.6 - - PYTHON_VERSION=2.7 + - PYTHON_VERSION=2.7 SPHINX_VERSION=1.7 + - PYTHON_VERSION=2.7 SPHINX_VERSION=1.8 - PYTHON_VERSION=3.5 SPHINX_VERSION=1.6 - - PYTHON_VERSION=3.5 + - PYTHON_VERSION=3.5 SPHINX_VERSION=1.7 + - PYTHON_VERSION=3.5 SPHINX_VERSION=1.8 - PYTHON_VERSION=3.6 SPHINX_VERSION=1.6 - - PYTHON_VERSION=3.6 - - PYTHON_VERSION=3.6 SPHINX_VERSION=dev + - PYTHON_VERSION=3.6 SPHINX_VERSION=1.7 + - PYTHON_VERSION=3.6 SPHINX_VERSION=1.8 + - PYTHON_VERSION=3.7 SPHINX_VERSION=1.6 + - PYTHON_VERSION=3.7 SPHINX_VERSION=1.7 + - PYTHON_VERSION=3.7 SPHINX_VERSION=1.8 + - PYTHON_VERSION=3.7 SPHINX_VERSION=dev global: - LOCALE=default diff --git a/README.rst b/README.rst index 1bae24d..a1b092c 100644 --- a/README.rst +++ b/README.rst @@ -3,7 +3,7 @@ ABlog for Sphinx .. image:: https://travis-ci.org/sunpy/ablog.svg?branch=master :target: https://travis-ci.org/sunpy/ablog - + **Please note that is an official continuation of** `Ahmet Bakan's Ablog Sphinx extension `_. ABlog is a Sphinx extension that converts any documentation or personal website project into a full-fledged blog with: @@ -14,6 +14,7 @@ ABlog is a Sphinx extension that converts any documentation or personal website * `Disqus integration`_ * `Font-Awesome integration`_ * `Easy GitHub Pages deploys`_ + * `Jupiter Notebook Support for blog posts`_ .. _Atom feeds: http://ablog.readthedocs.org/blog/atom.xml .. _Archive pages: http://ablog.readthedocs.org/blog/ @@ -21,6 +22,7 @@ ABlog is a Sphinx extension that converts any documentation or personal website .. _Disqus integration: http://ablog.readthedocs.org/manual/ablog-configuration-options/#disqus-integration .. _Font-Awesome integration: http://ablog.readthedocs.org/manual/ablog-configuration-options/#fa .. _Easy GitHub Pages deploys: http://ablog.readthedocs.org/manual/deploy-to-github-pages/ +.. _Jupiter Notebook Support for blog posts: http://ablog.readthedocs.org/manual/deploy-to-github-pages/ .. _installation: @@ -31,9 +33,14 @@ You can install ABlog using pip_:: pip install -U ablog +or anaconda_:: + conda config --add channels conda-forge + conda install ablog + This will also install `Sphinx `_, Alabaster_, Werkzeug_, and Invoke_ respectively required for building your website, making it look good, generating feeds, and running deploy commands. .. _pip: https://pip.pypa.io +.. _anaconda: https://www.anaconda.com/ .. _Werkzeug: http://werkzeug.pocoo.org/ .. _Alabaster: https://github.com/bitprophet/alabaster .. _Invoke: http://www.pyinvoke.org/ diff --git a/appveyor.yml b/appveyor.yml index b6e783e..2d11ed6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -18,6 +18,7 @@ environment: - PYTHON_VERSION: "2.7" - PYTHON_VERSION: "3.5" - PYTHON_VERSION: "3.6" + - PYTHON_VERSION: "3.7" matrix: fast_finish: true @@ -41,12 +42,12 @@ test_script: - ablog build -b latex -T -d .doctrees -w _latex - ablog build -T -b json - ablog build -T -b pickle -# - ps: mkdir test -# - ps: cd test -# - ps: echo "ABlog" ABlog Team" "http://ablog.readthedocs.org" | ablog start -# - ablog build -# - ps: mkdir -p test -# - ps: cd test -# - ps: echo "ablog" "ABlog" "ABlog Team" "http://ablog.readthedocs.org" | ablog start -# - ps: cd ablog -# - ablog build + - ps: md test + - ps: cd test + - ps: echo "ABlog" ABlog Team" "http://ablog.readthedocs.org" | ablog start + - ablog build + - ps: md -p test + - ps: cd test + - ps: echo "ablog" "ABlog" "ABlog Team" "http://ablog.readthedocs.org" | ablog start + - ps: cd ablog + - ablog build diff --git a/docs/conf.py b/docs/conf.py index 4058a9e..b92a7c8 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -19,6 +19,7 @@ extensions = [ 'sphinx.ext.extlinks', 'sphinx_automodapi.automodapi', 'alabaster', + 'nbsphinx', 'ablog' ] @@ -106,6 +107,8 @@ extlinks = { 'pull': ('https://github.com/sunpy/ablog/pull/%s', 'pull request '), } +exclude_patterns = ['docs/manual/.ipynb_checkpoints/*'] + rst_epilog = ''' .. _Sphinx: http://sphinx-doc.org/ .. _Python: http://python.org diff --git a/docs/index.rst b/docs/index.rst index 357e9c9..9313e5b 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -73,6 +73,8 @@ you might find `reStructuredText Primer`_ useful. Once you have content (in ``.rst`` files), you can post *any page* using the :rst:dir:`post` directive as follows: +.. _reStructuredText Primer: http://sphinx-doc.org/rest.html + .. code-block:: rst .. post:: Apr 15, 2014 @@ -104,10 +106,6 @@ can find more about configuring and using ABlog: :format: {title} :sort: - -.. _reStructuredText Primer: http://sphinx-doc.org/rest.html - - .. only:: html .. image:: https://secure.travis-ci.org/sunpy/ablog.png?branch=devel diff --git a/docs/manual/images/notebook_cells.png b/docs/manual/images/notebook_cells.png new file mode 100644 index 0000000000000000000000000000000000000000..1411a865591df2570268be5138b462a2240e0014 GIT binary patch literal 13333 zcmaKTbwE_nx-X%EgrIbnNJ@vafQU3mcXxM}q@;>SGjvHabhmT~DBazi!(DUEd*`0} z?z`7N#F1go+TZ%VU#-n&MR`d~G-5Oa1O!Z}5AQxAARzjIf9Ie+0e^o%l|Tev9yyCi zsi1;CKBy+);5CtpgocZ1$_WCsR{9XA66mL*!Or@Fqt1o5Y<= z4P7kl?I=|&ZA}rB4P7WXcqtW(!5236Hj;HauLMRjItqwxHzh{q=eolV%hK=iTfzM%0)^UBx$$(L510R#!{|Alv z;+$pS=S1}GkSt2nPnVay(YMPSB9sPao+1=j6i%1*m(C)GBlVl9-Z5E4MG@FysF8-v zmJ@jiX-}wvvHyPfO4^Dortw3ERRB>8m8vq~ksnoXIope?5bTbQ4@(4MsOZLNU!#qT zj8M_gsQLN%t0riIv8f|X>5udqT%OX=(V^ipC;r`jE{6KGn?vO{4h{~Ds6Hx{6FtK! z{D)}*!3*XnaMkgn$ydLo6~`WQ(LMh%NJETX%UK=@oSNpp+Pq@bufX7XLUo(AG{&a?cpGUKbT0W)uY}54j-8zbkO69m3#{pcURlVT~=b7r8vdHjHGVMqA z3TSd+9T|LRBaqfTm82ZkRu8TamLb&!E_KgZt&4nCCR588ku~ADCKS`O_V!_}hf5hW z$B}9ZWZH9C@d(m=-1K*r{=Hpd9&3^Lmx~tr3akQ;x1EpqeeRJlyq+rP@a=2eC;Zt6 zLb{fn7-PrAH`Liop=j@Wo_E%_0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ztFcu1V|pS%#4tqsowK8XDHfK@LCfNfoU z{qn)VFo-}fZa+syn}XyW?uMWiV@ROlKztiNv@osocS>+6ka7`wjidrOTx~UJ1cbv{ ze|#j!s6w$Q zy$dEMm5e6t20?a#S_v^w^lXpT;ep(kB*nHUMTXz~4P2Nd{eS_#Gf}8a*NkpvZEX!a zV|(La%g?eZ=S_JeWMs^2Ss|Y*Y!ML=@uf1A!WaG^Fv!c5Lp@%M&qnr_PEAWYJ~}e! z3V&W$db#(PQywBL2Z-}(zjpCzEl%N#B^so9QkOp#6DVR@91A7^cef zA+%(TPpO!dV^~%dEGd5gf(9ic??j*j`PkLf)z$>qOt@+S3|Rp*z18o6_O?J|PuLwF z0wxJh7f5!sYwfmYAAv|61R8_;3k3%4pF-QGV<|-7cyw+Fb{BZie1d(r+W_hV&Jtx4 z;0OgoK&D&b5B?9g6q2#z+@!kzCE!vANVxXVr@W2?0Ahdslb2Qk{e0`xw%~ z&GF5_q)rfU!lO;#Ky+Gsh(OH&V>>!HQ2uXr8{{Eys)cs~5TgLuT=r-1{Qdob*zTRy z_m=}$rG)z!r0c-Tl~+_`YE&3WEs%gS!dC#N%FD}b>P|q`C+oF|3qR(}j)b2P=0N`Y zuaf-B#Qwj(WAgv`h6(-AW?x({TXH-&0!^h6PlHNGO2Re0tgNhBjuf!W`2C7-&-~R{ mis*khN&O#>ST`OJSuuVo8?6YMgJ0P}kdlypS1M-k=|2DlA^ZIR literal 0 HcmV?d00001 diff --git a/docs/manual/notebook_support.ipynb b/docs/manual/notebook_support.ipynb new file mode 100644 index 0000000..8f1b483 --- /dev/null +++ b/docs/manual/notebook_support.ipynb @@ -0,0 +1,81 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Jupyter Notebook Posting" + ] + }, + { + "cell_type": "raw", + "metadata": { + "raw_mimetype": "text/restructuredtext" + }, + "source": [ + ".. post:: 27 Oct 2018\n", + " :author: Nabil\n", + " :tags: posting\n", + " :category: Manual" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "To add support for Notebooks to your Ablog instance, you need to configure your `docs/conf.py` (or whereever your `conf.py` is located.\n", + "\n", + "You will need to add\n", + "\n", + "```\n", + " extennsions = [..., 'nbsphinx', ...]\n", + " exclude_patterns = ['docs/manual/.ipynb_checkpoints/*'] (To exclude the notebook autosaves)\n", + "```\n", + "\n", + "You will need to install [nbsphinx](https://nbsphinx.readthedocs.io/) either from `Anaconda` or `pip`. You might need to install [ipython](https://ipython.org/) to make sure the notebook can be run." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Within the notebook you need to make sure the cells are in this order: Titlte cell, post cell. So for this notebook, it looks like this: ![posting](images/notebook_cells.png)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "So the information is similar to how you create a normal RST post." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Another working example is SunPy's website which runs [Ablog](https://sunpy.org/blog.html). The Pull Request that added support can be found [here](https://github.com/sunpy/sunpy.org/pull/131) and how to link them to a [Binder](https://mybinder.org/) instance [here](https://github.com/sunpy/sunpy.org/pull/134)." + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.6" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/docs/release/ablog-v0.9-released.rst b/docs/release/ablog-v0.9-released.rst index 172a528..e500442 100644 --- a/docs/release/ablog-v0.9-released.rst +++ b/docs/release/ablog-v0.9-released.rst @@ -50,3 +50,14 @@ ABlog v0.9.2 released :location: World Fixed Windows String issue + +ABlog v0.9.3 released +===================== + +.. post:: October 30, 2018 + :author: Nabil + :category: Release + :location: World + +Added example on how to use writing blog posts in Jupyter notebooks. +Several fixes provived by `anzawatta`, sorry I was late to release these! \ No newline at end of file diff --git a/setup.py b/setup.py index 90417f0..db14fb5 100644 --- a/setup.py +++ b/setup.py @@ -53,6 +53,7 @@ setup( ], provides=['ablog'], install_requires=['werkzeug', 'sphinx>=1.6', 'alabaster', 'invoke', 'python-dateutil', 'sphinx-automodapi'], + extra_requires=['nbsphinx'], message_extractors={ 'ablog': [ ('**.html', 'jinja2', None), From acd0a8c60e1fab399a048aa2e22c6d8651d872f2 Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Sat, 27 Oct 2018 11:15:43 +0100 Subject: [PATCH 2/4] bug fix? --- .travis.yml | 14 +++++--------- Makefile | 24 +++++++++++++----------- README.rst | 2 +- ablog/commands.py | 7 ++++--- ablog/post.py | 3 ++- appveyor.yml | 17 +++++++---------- 6 files changed, 32 insertions(+), 35 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3636741..b0e26f3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,32 +12,28 @@ sudo: false env: matrix: - PYTHON_VERSION=2.7 SPHINX_VERSION=1.6 - - PYTHON_VERSION=2.7 SPHINX_VERSION=1.7 - PYTHON_VERSION=2.7 SPHINX_VERSION=1.8 + - PYTHON_VERSION=3.5 SPHINX_VERSION=1.6 - - PYTHON_VERSION=3.5 SPHINX_VERSION=1.7 - PYTHON_VERSION=3.5 SPHINX_VERSION=1.8 + - PYTHON_VERSION=3.6 SPHINX_VERSION=1.6 - - PYTHON_VERSION=3.6 SPHINX_VERSION=1.7 - PYTHON_VERSION=3.6 SPHINX_VERSION=1.8 + - PYTHON_VERSION=3.7 SPHINX_VERSION=1.6 - PYTHON_VERSION=3.7 SPHINX_VERSION=1.7 - PYTHON_VERSION=3.7 SPHINX_VERSION=1.8 - - PYTHON_VERSION=3.7 SPHINX_VERSION=dev global: - LOCALE=default - CONDA_CHANNELS="conda-forge" - - CONDA_DEPENDENCIES="sphinx werkzeug alabaster invoke graphviz" + - CONDA_DEPENDENCIES="sphinx werkzeug alabaster invoke graphviz nbsphinx" - PIP_DEPENDENCIES="sphinx-automodapi" install: - git clone git://github.com/astropy/ci-helpers.git - source ci-helpers/travis/setup_conda.sh - - if [[ $SPHINX_VERSION == dev ]]; then - pip install git+https://github.com/sphinx-doc/sphinx.git; - fi - pip install -e . script: - - make test + - make tests diff --git a/Makefile b/Makefile index c5efb1c..063b608 100644 --- a/Makefile +++ b/Makefile @@ -1,26 +1,28 @@ -.PHONY: demo install rebuild release test docs +.PHONY: demo rebuild tests demo: rm -rf demo printf "demo\nABlog\nABlog Team\nhttp://ablog.readthedocs.org" | ablog start -install: - pip install -U --no-deps --force-reinstall . - -docs: - export PYTHONPATH="$(shell pwd)"; echo $$PYTHONPATH; cd docs; ablog build -a -P - rebuild: cd docs; watchmedo shell-command --patterns='*.rst' --command='ablog build' --recursive -release: - python setup.py register - python setup.py sdist upload - test: cd docs; ablog build -T + +test1: cd docs; ablog build -b latex -T -d .doctrees -w _latex + +test2: cd docs; ablog build -T -b json + +test3: cd docs; ablog build -T -b pickle + +test4: mkdir -p test; cd test; printf "\nABlog\nABlog Team\nhttp://ablog.readthedocs.org" | ablog start; ablog build + +test5: mkdir -p test; cd test; printf "ablog\nABlog\nABlog Team\nhttp://ablog.readthedocs.org" | ablog start; cd ablog; ablog build + +tests: test test1 test2 test3 test4 test5 diff --git a/README.rst b/README.rst index a1b092c..14fd142 100644 --- a/README.rst +++ b/README.rst @@ -22,7 +22,7 @@ ABlog is a Sphinx extension that converts any documentation or personal website .. _Disqus integration: http://ablog.readthedocs.org/manual/ablog-configuration-options/#disqus-integration .. _Font-Awesome integration: http://ablog.readthedocs.org/manual/ablog-configuration-options/#fa .. _Easy GitHub Pages deploys: http://ablog.readthedocs.org/manual/deploy-to-github-pages/ -.. _Jupiter Notebook Support for blog posts: http://ablog.readthedocs.org/manual/deploy-to-github-pages/ +.. _Jupiter Notebook Support for blog posts: http://ablog.readthedocs.org/manual/notebook_support/ .. _installation: diff --git a/ablog/commands.py b/ablog/commands.py index ad16b18..ed48e9c 100644 --- a/ablog/commands.py +++ b/ablog/commands.py @@ -1,5 +1,6 @@ from __future__ import absolute_import, division, print_function import os +import io import sys import glob import ablog @@ -175,11 +176,11 @@ def ablog_build(builder=None, sourcedir=None, website=None, doctrees=None, argv.extend([sourcedir, website]) if SPHINX_LT_17: from sphinx import main - main(argv) + sys.exit(main(argv)) else: from sphinx.cmd.build import main # As of Sphinx 1.7, the first argument is now no longer ignored - main(argv[1:]) + sys.exit(main(argv[1:])) @arg('-D', dest='deep', action='store_true', default=False, @@ -331,7 +332,7 @@ def ablog_post(filename, title=None, **kwargs): # read the file, and add post directive # and save it else: - with open(filename, 'w', encoding='utf-8') as out: + with io.open(filename, 'w', encoding='utf-8') as out: post_text = POST_TEMPLATE % pars out.write(post_text) diff --git a/ablog/post.py b/ablog/post.py index 0b8d01b..fbf9998 100644 --- a/ablog/post.py +++ b/ablog/post.py @@ -2,6 +2,7 @@ """post and postlist directives.""" from __future__ import absolute_import, division, print_function +import io import os import sys from string import Formatter @@ -655,7 +656,7 @@ def generate_atom_feeds(app): if not os.path.isdir(parent_dir): os.makedirs(parent_dir) - with open(feed_path, 'w', encoding='utf-8') as out: + with io.open(feed_path, 'w', encoding='utf-8') as out: feed_str = feed.to_string() try: out.write(feed_str.encode('utf-8')) diff --git a/appveyor.yml b/appveyor.yml index 2d11ed6..c77f91d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -11,7 +11,7 @@ environment: # See: http://stackoverflow.com/a/13751649/163740 CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\ci-helpers\\appveyor\\windows_sdk.cmd" CONDA_CHANNELS: "conda-forge" - CONDA_DEPENDENCIES: "sphinx werkzeug alabaster invoke graphviz" + CONDA_DEPENDENCIES: "sphinx werkzeug alabaster invoke graphviz nbsphinx" PIP_DEPENDENCIES: "sphinx-automodapi" matrix: @@ -26,6 +26,11 @@ matrix: platform: - x64 +before_test: + - cinst pandoc + - cinst graphviz + - set PATH="%PATH%;C:\Program Files (x86)\Pandoc\" + install: - "git clone git://github.com/astropy/ci-helpers.git" - "powershell ci-helpers/appveyor/install-miniconda.ps1" @@ -37,17 +42,9 @@ install: build: false test_script: + - "python setup.py build_sphinx" - ps: cd docs - ablog build -T - ablog build -b latex -T -d .doctrees -w _latex - ablog build -T -b json - ablog build -T -b pickle - - ps: md test - - ps: cd test - - ps: echo "ABlog" ABlog Team" "http://ablog.readthedocs.org" | ablog start - - ablog build - - ps: md -p test - - ps: cd test - - ps: echo "ablog" "ABlog" "ABlog Team" "http://ablog.readthedocs.org" | ablog start - - ps: cd ablog - - ablog build From 6a6fd2be1094373a3bee90d83ecd5285a65efbc1 Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Sat, 27 Oct 2018 14:04:52 +0100 Subject: [PATCH 3/4] Update appveyor.yml --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index c77f91d..d143891 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -42,7 +42,7 @@ install: build: false test_script: - - "python setup.py build_sphinx" + - "%PYTHON% setup.py build_sphinx" - ps: cd docs - ablog build -T - ablog build -b latex -T -d .doctrees -w _latex From 6e6d10ffebf5d0b5ee7714dbd47ef72c2a5bfe60 Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Sat, 27 Oct 2018 15:28:26 +0100 Subject: [PATCH 4/4] Update appveyor.yml --- appveyor.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index d143891..8b13767 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -42,7 +42,6 @@ install: build: false test_script: - - "%PYTHON% setup.py build_sphinx" - ps: cd docs - ablog build -T - ablog build -b latex -T -d .doctrees -w _latex