diff --git a/website/_harp.json b/website/_harp.json index 488a41448..bf31be30c 100644 --- a/website/_harp.json +++ b/website/_harp.json @@ -55,6 +55,31 @@ } }, + "QUICKSTART": [ + { "id": "os", "title": "Operating system", "options": [ + { "id": "mac", "title": "macOS / OSX", "checked": true }, + { "id": "windows", "title": "Windows" }, + { "id": "linux", "title": "Linux" }] + }, + { "id": "package", "title": "Package manager", "options": [ + { "id": "pip", "title": "pip", "checked": true }, + { "id": "conda", "title": "conda" }, + { "id": "source", "title": "from source" }] + }, + { "id": "python", "title": "Python version", "options": [ + { "id": 2, "title": "2.x" }, + { "id": 3, "title": "3.x", "checked": true }] + }, + { "id": "config", "title": "Configuration", "multiple": true, "options": [ + {"id": "venv", "title": "virtualenv", "help": "Use a virtual environment and install spaCy into a user directory" }] + }, + { "id": "model", "title": "Models", "multiple": true, "options": [ + { "id": "en", "title": "English", "meta": "50MB" }, + { "id": "de", "title": "German", "meta": "645MB" }, + { "id": "fr", "title": "French", "meta": "1.33GB" }] + } + ], + "V_CSS": "1.6", "V_JS": "1.2", "DEFAULT_SYNTAX": "python", diff --git a/website/_includes/_scripts.jade b/website/_includes/_scripts.jade index 4c557166f..e5a863787 100644 --- a/website/_includes/_scripts.jade +++ b/website/_includes/_scripts.jade @@ -4,6 +4,10 @@ script(src="/assets/js/main.js?v#{V_JS}") script(src="/assets/js/prism.js") if SECTION == "docs" + if quickstart + script(src="/assets/js/quickstart.js") + script var qs = new Quickstart("#qs") + script. ((window.gitter = {}).chat = {}).options = { useStyles: false, diff --git a/website/docs/usage/_data.json b/website/docs/usage/_data.json index bb5e0134c..a3d37b833 100644 --- a/website/docs/usage/_data.json +++ b/website/docs/usage/_data.json @@ -34,7 +34,8 @@ "index": { "title": "Install spaCy", - "next": "models" + "next": "models", + "quickstart": true }, "v2": { diff --git a/website/docs/usage/index.jade b/website/docs/usage/index.jade index 48fe6b783..7a28836b6 100644 --- a/website/docs/usage/index.jade +++ b/website/docs/usage/index.jade @@ -12,15 +12,29 @@ p | #[a(href="#source-ubuntu") Ubuntu], #[a(href="#source-osx") macOS/OS X] | and #[a(href="#source-windows") Windows] for details. -+aside("Download models") - | After installation you need to download a language model. For more info - | and available models, see the #[+a("/docs/usage/models") docs on models]. ++quickstart(QUICKSTART, "Quickstart") + +qs({config: 'venv', python: 2}) python -m pip install -U virtualenv + +qs({config: 'venv', python: 3}) python -m pip install -U venv + +qs({config: 'venv', python: 2}) virtualenv .env + +qs({config: 'venv', python: 3}) venv .env + +qs({config: 'venv', os: 'mac'}) source .env/bin/activate + +qs({config: 'venv', os: 'linux'}) source .env/bin/activate + +qs({config: 'venv', os: 'windows'}) .env\Scripts\activate - +code.o-no-block. - python -m spacy download en + +qs({package: 'pip'}) pip install -U spacy + + +qs({package: 'conda'}) conda config --add channels conda-forge + +qs({package: 'conda'}) conda install spacy + + +qs({package: 'source'}) git clone https://github.com/explosion/spaCy + +qs({package: 'source'}) cd spaCy + +qs({package: 'source'}) pip install -r requirements.txt + +qs({package: 'source'}) pip install -e . + + +qs({model: 'en'}) python -m spacy download en + +qs({model: 'de'}) python -m spacy download de + +qs({model: 'fr'}) python -m spacy download fr - >>> import spacy - >>> nlp = spacy.load('en') +h(2, "pip") pip +badge("pipy")