mirror of https://github.com/explosion/spaCy.git
* Rework the docs compilation function
This commit is contained in:
parent
f16bd3b853
commit
c27327d92b
|
@ -1,9 +1,12 @@
|
||||||
|
from __future__ import print_function
|
||||||
|
|
||||||
from fabric.api import local, lcd, env, settings, prefix
|
from fabric.api import local, lcd, env, settings, prefix
|
||||||
from os.path import exists as file_exists
|
from os.path import exists as file_exists
|
||||||
from fabtools.python import virtualenv
|
from fabtools.python import virtualenv
|
||||||
from os import path
|
from os import path
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
PWD = path.dirname(__file__)
|
PWD = path.dirname(__file__)
|
||||||
|
@ -56,10 +59,25 @@ def prebuild(build_dir='/tmp/build_spacy'):
|
||||||
local('fab test')
|
local('fab test')
|
||||||
local('python setup.py sdist')
|
local('python setup.py sdist')
|
||||||
|
|
||||||
|
|
||||||
def docs():
|
def docs():
|
||||||
with virtualenv(VENV_DIR):
|
def jade(source_name, out_dir):
|
||||||
with lcd(path.join(path.dirname(__file__), 'docs')):
|
pwd = path.join(path.dirname(__file__), 'website')
|
||||||
local('make html')
|
jade_loc = path.join(pwd, 'src', 'jade', source_name)
|
||||||
|
out_loc = path.join(pwd, 'site', out_dir)
|
||||||
|
local('jade -P %s --out %s' % (jade_loc, out_loc))
|
||||||
|
|
||||||
|
jade('home/index.jade', '')
|
||||||
|
jade('docs/index.jade', 'docs/')
|
||||||
|
jade('blog/index.jade', 'blog/')
|
||||||
|
jade('tutorials/index.jade', 'tutorials/')
|
||||||
|
|
||||||
|
for post_dir in (Path(__file__).parent / 'website' / 'src' / 'jade' / 'blog').iterdir():
|
||||||
|
if post_dir.is_dir() \
|
||||||
|
and (post_dir / 'index.jade').exists() \
|
||||||
|
and (post_dir / 'meta.jade').exists():
|
||||||
|
jade(str(post_dir / 'index.jade'), path.join('blogs', post_dir.parts[-1]))
|
||||||
|
|
||||||
|
|
||||||
def publish(version):
|
def publish(version):
|
||||||
with virtualenv(VENV_DIR):
|
with virtualenv(VENV_DIR):
|
||||||
|
@ -68,7 +86,7 @@ def publish(version):
|
||||||
local('git push origin %s' % version)
|
local('git push origin %s' % version)
|
||||||
local('python setup.py sdist')
|
local('python setup.py sdist')
|
||||||
local('python setup.py register')
|
local('python setup.py register')
|
||||||
local('twine upload dist/%s.tar.gz' % version)
|
local('twine upload dist/spacy-%s.tar.gz' % version)
|
||||||
|
|
||||||
|
|
||||||
def env(lang="python2.7"):
|
def env(lang="python2.7"):
|
||||||
|
|
Loading…
Reference in New Issue