Skip to content

Alternative build system to #59 #66

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

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
21b7109
Rm jbook.
rossbar Dec 14, 2021
3a43b28
sphinx quickstart.
rossbar Dec 14, 2021
ffb2ced
Add myst-nb and make buildable.
rossbar Dec 14, 2021
1f42498
Update .gitignore.
rossbar Dec 14, 2021
32d4732
sphinx_book_theme + logos.
rossbar Dec 14, 2021
28b402b
Convert first set of tutorials to myst-md nbook fmt.
rossbar Jan 13, 2022
36478cc
Add top-level lectures to site.
rossbar Dec 14, 2021
ef4b911
cherry-pick fixes to 00_images_are_arrays.
stefanv Dec 15, 2021
c8d1aca
cherry-pick skdemo fix.
stefanv Dec 15, 2021
cfd439a
Fix issues with headings.
rossbar Dec 15, 2021
f89fbc3
Add missing deps for 3d img proc notebook.
rossbar Dec 15, 2021
1fe5ff5
WIP: Start adding adv notebooks.
rossbar Dec 15, 2021
fe4c803
WIP: cherrypick adv0 fixes.
stefanv Dec 15, 2021
527fbdc
WIP: cherry-pick adv1 and adv2 fixes.
stefanv Dec 15, 2021
0a4793d
Fix header problems in adv notebooks.
rossbar Dec 15, 2021
76eaf1a
Rm autogenned index directives.
rossbar Dec 15, 2021
ef87299
Fixups to conf.
rossbar Dec 15, 2021
b684d30
Rm theme.css, fixes indentation and title highlights.
rossbar Dec 15, 2021
1c7c78c
Fix headers in adv1.
rossbar Dec 15, 2021
8567ddc
Add sphinx copybutton.
rossbar Dec 15, 2021
5be68ae
Update github workflow: CI fail w/ nb execution failure.
rossbar Dec 15, 2021
1ac4cb3
Fix missing link warning with download role.
rossbar Dec 15, 2021
8b7a95a
Add imageconverters dep for adv0 to run.
rossbar Jan 13, 2022
0797184
Fix broken requirement.
rossbar Jan 13, 2022
3a57f92
Mv unexecutable adv lectures back to not-yet-booked.
rossbar Jan 13, 2022
cfcbe70
Add artifact upload action to deploy workflow.
rossbar Jan 13, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,26 @@ jobs:
# - name: Build the theme
# run: yarn build:theme-prod

# Build the book
- name: Build the book
# Build site
- name: Build site
env:
DISPLAY: ":99.0"
run: jupyter-book build .
# n = nitpicky (broken links), W = warnings as errors,
# T = full tracebacks, keep-going = runt to competion even with errors
run: make SPHINXOPTS="-nWT --keep-going" html

# Deploy the book's HTML to github pages
# Upload build artifacts - useful for debugging failed execution
- name: Upload build artifacts
uses: actions/upload-artifact@v2
with:
name: html-build-artifact
path: _build/html

# Deploy the site HTML to github pages
- name: GitHub Pages action
if: github.repository == 'scikit-image/skimage-tutorials' && github.ref == 'refs/heads/main' && github.event_name == 'push'
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_build/html
cname: scikit-image.org
cname: scikit-image.org
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ build
*.pyc
*~
*pano-advanced-output.png
book/lessons
# Ignore sphinx output
_build/*
61 changes: 20 additions & 41 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,41 +1,20 @@
OBSHELL=/bin/bash

.DEFAULT_GOAL = html

LESSONS_DIR = lessons
GENERATED_LESSONS_DIR = book/lessons

_requirements.installed:
pip install -q -r requirements.txt
touch _requirements.installed

MARKDOWNS = $(wildcard $(LESSONS_DIR)/*.md)
MD_OUTPUTS = $(patsubst $(LESSONS_DIR)/%.md, $(GENERATED_LESSONS_DIR)/%.md, $(MARKDOWNS))
NOTEBOOKS = $(patsubst %.md, %.ipynb, $(MD_OUTPUTS))

.SECONDARY: $(MD_OUTPUTS) $(NOTEBOOKS)

$(GENERATED_LESSONS_DIR)/%.ipynb:$(LESSONS_DIR)/%.md book/lessons book/lessons/images
# This does not work, due to bug in notedown; see https://github.com/aaren/notedown/issues/53
#notedown --match=python --precode='%matplotlib inline' $< > $@
notedown --match=python $< > $@
jupyter nbconvert --execute --inplace $@ --ExecutePreprocessor.timeout=-1

%.md:%.ipynb
jupyter nbconvert --to=mdoutput --output="$(notdir $@)" --output-dir=$(GENERATED_LESSONS_DIR) $<
# $(eval NBSTRING := [📂 Download lesson notebook](.\/$(basename $(notdir $@)).ipynb)\n\n)
# sed -i'.bak' '1s/^/$(NBSTRING)/' $@


book/lessons:
mkdir -p book/lessons

book/lessons/images:
ln -s ${PWD}/lessons/images ${PWD}/book/lessons/images

html: | _requirements.installed $(NOTEBOOKS) $(MD_OUTPUTS)
@export SPHINXOPTS=-W; make -C book html
cp $(GENERATED_LESSONS_DIR)/*.ipynb book/build/html/lessons/

clean:
rm -rf $(GENERATED_LESSONS_DIR)/*
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
10 changes: 0 additions & 10 deletions _config.yml

This file was deleted.

5 changes: 0 additions & 5 deletions _static/css/theme.css

This file was deleted.

Binary file added _static/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _static/skimage-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 0 additions & 6 deletions _toc.yml

This file was deleted.

12 changes: 12 additions & 0 deletions applications.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# scikit-image applications

A collection of tutorials highlighting the use of scikit-image for applications in science.

```{toctree}
---
maxdepth: 1
---
lectures/adv0_chromosomes
lectures/adv1_lesion-quantification
lectures/adv2_microarray
```
78 changes: 78 additions & 0 deletions conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))


# -- Project information -----------------------------------------------------

project = 'scikit-image tutorials'
copyright = '2021, the scikit-image community'
author = 'the scikit-image community'


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"myst_nb",
"sphinx_copybutton",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = [
'_build',
'Thumbs.db',
'.DS_Store',
'README.md',
'preparation.md', # TODO: incorporate in the site somewhere?
'*/not_yet_booked/*',
'*/solutions/*',
'workshops/*',
]


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_book_theme'
html_title = 'scikit-image Tutorials'
html_logo = '_static/skimage-logo.png'
html_favicon = '_static/favicon.png'
tml_theme_options = {
"github_url": "https://github.com/scikit-image/skimage-tutorials/",
"repository_url": "https://github.com/scikit-image/skimage-tutorials/",
"repository_branch": "main",
"use_repository_button": True,
"use_issues_button": True,
"use_edit_page_button": True,
"path_to_docs": "site/",
"launch_buttons": {
"binderhub_url": "https://mybinder.org",
},
}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
54 changes: 0 additions & 54 deletions index.ipynb

This file was deleted.

15 changes: 15 additions & 0 deletions index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# scikit-image tutorials

[![Binder](http://mybinder.org/badge_logo.svg)][launch_binder]

[launch_binder]: http://mybinder.org/v2/gh/scikit-image/skimage-tutorials/main?urlpath=lab/tree/content

## Content

```{toctree}
---
maxdepth: 2
---
introduction
applications
```
16 changes: 16 additions & 0 deletions introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# An introduction to scikit-image

Basic tutorials to prepare you for your journey on scikit-image.

```{toctree}
---
maxdepth: 1
---
lectures/00_images_are_arrays
lectures/1_image_filters
lectures/3_morphological_operations
lectures/4_segmentation
lectures/5_tophat_filters
lectures/6_watershed_tricks
lectures/three_dimensional_image_processing
```
Loading