mirror of
https://github.com/vale981/ablog
synced 2025-03-04 16:51:39 -05:00
bug fix?
This commit is contained in:
parent
d2d05ef74f
commit
acd0a8c60e
6 changed files with 32 additions and 35 deletions
14
.travis.yml
14
.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
|
||||
|
|
24
Makefile
24
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
|
||||
|
|
|
@ -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:
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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'))
|
||||
|
|
17
appveyor.yml
17
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
|
||||
|
|
Loading…
Add table
Reference in a new issue