Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move2lite #86

Merged
merged 15 commits into from
Mar 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
book/*
notebooks/*
.ipynb_checkpoints/*
lib/.ipynb_checkpoints/*
*/*/.ipynb_checkpoints/*
*.swp
lib/__pycache__/*
5 changes: 1 addition & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
FROM darribas/gds_py:2.0

RUN pip install deprecated
RUN pip install --no-deps git+https://github.com/pysal/pysal.git
FROM darribas/gds_py:4.0

# Local docs
RUN rm -R work/
Expand Down
44 changes: 36 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ you want to build the book locally, you will need the following:
* `git`
* Python libraries listed in [`build-requirements.txt`](lib/jupyter-book-master/build-requirements.txt)

A recommended route is to run this repository inside a [`gds_env`](https://github.com/darribas/gds_env)
(use the `gds_dev` flavour) container, which is the platform used to build it. If you have it installed,
you can launch it from the `notebooks` folder by running:

```
> docker run --rm -ti -p 8888:8888 -p 4000:4000 -v ${PWD}:/home/jovyan/work darribas/gds_dev:4.0
```

## Build process

The current build process involves two main steps:
Expand All @@ -28,14 +36,6 @@ The current build process involves two main steps:

This will generate a `notebooks` folder that contains all the files
required to build the book.
1. Test all the `.ipynb` files are well-formated and can be converted:

`> python lib/build.py --test_no_run`

1. Execute all the `.ipynb` files:

`> python lib/build.py --test_run`

1. Build the book from the downloaded notebooks. This can be done by running
the following command from the root folder:

Expand All @@ -44,6 +44,34 @@ The current build process involves two main steps:
This will create/update the `docs` folder in the root folder so it contains
everything needed for the hosting server to serve the book. Commit the
changes and the updated book will be available online shortly.

The built website is available on the `./docs` folder and is ready to be pushed to the repository
for serving on Github Pages. If you want to serve it locally, you will need to:

1. Navigate into the `./docs` directory:

`> cd docs`

1. Serve the site:

`> jekyll serve`

If you are serving it inside a container, fix the host so it can be accessed from the host machine:

`> jekyll serve --host="0.0.0.0"`

Then point your browser to `localhost:4000/notebooks/`

Additionally, the command line tool `lib/build.py` incorporates experimental support for testing
the notebooks. Again, two options are available:

1. Test all the `.ipynb` files are well-formated and can be converted:

`> python lib/build.py --test_no_run`

1. Execute all the `.ipynb` files:

`> python lib/build.py --test_run`



81 changes: 41 additions & 40 deletions docs/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (4.2.10)
activesupport (4.2.11.1)
i18n (~> 0.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
bibtex-ruby (4.4.7)
latex-decode (~> 0.0)
citeproc (1.0.9)
Expand All @@ -23,12 +23,12 @@ GEM
colorator (1.1.0)
commonmarker (0.17.13)
ruby-enum (~> 0.5)
concurrent-ruby (1.1.4)
concurrent-ruby (1.1.5)
csl (1.5.0)
namae (~> 1.0)
csl-styles (1.0.1.9)
csl (~> 1.0)
dnsruby (1.61.2)
dnsruby (1.61.3)
addressable (~> 2.5)
em-websocket (0.5.1)
eventmachine (>= 0.12.9)
Expand All @@ -37,19 +37,19 @@ GEM
ffi (>= 1.3.0)
eventmachine (1.2.7)
execjs (2.7.0)
faraday (0.15.4)
faraday (0.17.0)
multipart-post (>= 1.2, < 3)
ffi (1.10.0)
ffi (1.11.1)
formatador (0.2.5)
forwardable-extended (2.6.0)
gemoji (3.0.0)
github-pages (197)
activesupport (= 4.2.10)
gemoji (3.0.1)
github-pages (202)
activesupport (= 4.2.11.1)
github-pages-health-check (= 1.16.1)
jekyll (= 3.7.4)
jekyll (= 3.8.5)
jekyll-avatar (= 0.6.0)
jekyll-coffeescript (= 1.1.1)
jekyll-commonmark-ghpages (= 0.1.5)
jekyll-commonmark-ghpages (= 0.1.6)
jekyll-default-layout (= 0.1.4)
jekyll-feed (= 0.11.0)
jekyll-gist (= 1.5.0)
Expand All @@ -60,7 +60,7 @@ GEM
jekyll-readme-index (= 0.2.0)
jekyll-redirect-from (= 0.14.0)
jekyll-relative-links (= 0.6.0)
jekyll-remote-theme (= 0.3.1)
jekyll-remote-theme (= 0.4.0)
jekyll-sass-converter (= 1.5.2)
jekyll-seo-tag (= 2.5.0)
jekyll-sitemap (= 1.2.0)
Expand All @@ -85,8 +85,8 @@ GEM
listen (= 3.1.5)
mercenary (~> 0.3)
minima (= 2.5.0)
nokogiri (>= 1.8.5, < 2.0)
rouge (= 2.2.1)
nokogiri (>= 1.10.4, < 2.0)
rouge (= 3.11.0)
terminal-table (~> 1.4)
github-pages-health-check (1.16.1)
addressable (~> 2.3)
Expand All @@ -113,13 +113,13 @@ GEM
guard (~> 2.8)
guard-compat (~> 1.0)
multi_json (~> 1.8)
html-pipeline (2.10.0)
html-pipeline (2.12.0)
activesupport (>= 2)
nokogiri (>= 1.4)
http_parser.rb (0.6.0)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
jekyll (3.7.4)
jekyll (3.8.5)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
Expand All @@ -137,13 +137,13 @@ GEM
jekyll-coffeescript (1.1.1)
coffee-script (~> 2.2)
coffee-script-source (~> 1.11.1)
jekyll-commonmark (1.2.0)
jekyll-commonmark (1.3.1)
commonmarker (~> 0.14)
jekyll (>= 3.0, < 4.0)
jekyll-commonmark-ghpages (0.1.5)
jekyll (>= 3.7, < 5.0)
jekyll-commonmark-ghpages (0.1.6)
commonmarker (~> 0.17.6)
jekyll-commonmark (~> 1)
rouge (~> 2)
jekyll-commonmark (~> 1.2)
rouge (>= 2.0, < 4.0)
jekyll-default-layout (0.1.4)
jekyll (~> 3.0)
jekyll-feed (0.11.0)
Expand All @@ -165,12 +165,13 @@ GEM
jekyll (~> 3.3)
jekyll-relative-links (0.6.0)
jekyll (~> 3.3)
jekyll-remote-theme (0.3.1)
jekyll-remote-theme (0.4.0)
addressable (~> 2.0)
jekyll (~> 3.5)
rubyzip (>= 1.2.1, < 3.0)
jekyll-sass-converter (1.5.2)
sass (~> 3.4)
jekyll-scholar (5.14.0)
jekyll-scholar (5.16.0)
bibtex-ruby (~> 4.0, >= 4.0.13)
citeproc-ruby (~> 1.0)
csl-styles (~> 1.0)
Expand Down Expand Up @@ -222,7 +223,7 @@ GEM
jekyll-seo-tag (~> 2.0)
jekyll-titles-from-headings (0.5.1)
jekyll (~> 3.3)
jekyll-watch (2.1.2)
jekyll-watch (2.2.1)
listen (~> 3.0)
jemoji (0.10.2)
gemoji (~> 3.0)
Expand All @@ -243,41 +244,41 @@ GEM
jekyll (~> 3.5)
jekyll-feed (~> 0.9)
jekyll-seo-tag (~> 2.1)
minitest (5.11.3)
multi_json (1.13.1)
multipart-post (2.0.0)
minitest (5.13.0)
multi_json (1.14.1)
multipart-post (2.1.1)
namae (1.0.1)
nenv (0.3.0)
nokogiri (1.10.1)
nokogiri (1.10.4)
mini_portile2 (~> 2.4.0)
notiffany (0.1.1)
notiffany (0.1.3)
nenv (~> 0.1)
shellany (~> 0.0)
octokit (4.13.0)
octokit (4.14.0)
sawyer (~> 0.8.0, >= 0.5.3)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
pry (0.12.2)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
public_suffix (3.0.3)
public_suffix (3.1.1)
rb-fsevent (0.10.3)
rb-inotify (0.10.0)
ffi (~> 1.0)
rouge (2.2.1)
rouge (3.11.0)
ruby-enum (0.7.2)
i18n
ruby_dep (1.5.0)
rubyzip (1.2.2)
rubyzip (2.0.0)
safe_yaml (1.0.5)
sass (3.7.3)
sass (3.7.4)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
sawyer (0.8.1)
addressable (>= 2.3.5, < 2.6)
faraday (~> 0.8, < 1.0)
sawyer (0.8.2)
addressable (>= 2.3.5)
faraday (> 0.8, < 2.0)
shellany (0.0.1)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
Expand All @@ -287,7 +288,7 @@ GEM
ethon (>= 0.9.0)
tzinfo (1.2.5)
thread_safe (~> 0.1)
unicode-display_width (1.5.0)
unicode-display_width (1.6.0)

PLATFORMS
ruby
Expand All @@ -303,4 +304,4 @@ DEPENDENCIES
tzinfo-data

BUNDLED WITH
2.0.1
1.17.2
11 changes: 7 additions & 4 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
help:
@echo "Please use 'make <target>' where <target> is one of:"
@echo " install to install the necessary dependencies for jupyter-book to build"
@echo " book to convert the `content/` folder into Jekyll markdown in `_build/`"
@echo " book to convert the content/ folder into Jekyll markdown in _build/"
@echo " clean to clean out site build files"
@echo " runall to run all notebooks in-place, capturing outputs with the notebook"
@echo " serve to serve the repository locally with Jekyll"
@echo " build to build the site HTML locally with Jekyll and store in _site/"
@echo " build to build the site HTML and store in _site/"
@echo " site to build the site HTML, store in _site/, and serve with Jekyll"


install:
gem install bundler
bundle install
jupyter-book install ./

book:
jupyter-book build ./
Expand All @@ -27,5 +27,8 @@ serve:
bundle exec guard

build:
jupyter-book build ./ --overwrite

site: build
bundle exec jekyll build
touch _site/.nojekyll
Loading