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

Tutorials infrastructure: switch to text-based notebook workflow #59

Closed
wants to merge 38 commits into from
Closed
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
7ee54d5
Adding jupytext options to Makefile
Jun 23, 2021
0803983
Migrating from the "old" format: toc is not a mapping
Jun 23, 2021
55ff765
Moving builds to their folder
Jun 23, 2021
f3bf746
Building site instead of book
Jun 23, 2021
de2d146
Adding Makefile on website
Jun 23, 2021
e345a61
Removing website Makefile refs
Jun 23, 2021
1d4e64c
Adding website/conf.py
Jun 23, 2021
37c53d5
Starting index.md
Jun 23, 2021
3086296
Adding Indices and tables to index.md
Jun 23, 2021
0c22b39
Ignoring website local builds
Jun 23, 2021
568fe59
An example — testing jupytext conversion
Jun 23, 2021
2437a6a
Adding example to toctree on index.md
Jun 23, 2021
831741f
Creating a link from website/images to ../images
Jun 23, 2021
e818bc4
Testing toc structure
Jun 23, 2021
747d842
Organizing folders
Jun 23, 2021
f217e16
Changing intro.md
Jun 24, 2021
9244886
Testing python instead of ipython3 on {code-cell}s
Sep 13, 2021
872d226
jb-article -> jb-book
Sep 14, 2021
9803c81
Adding more converted notebooks
Sep 14, 2021
7af90a1
Changing - to _ on adv3 filename
Sep 15, 2021
fa7fed3
Adding some of the newly converted notebooks to the toc
Sep 15, 2021
71f8a0b
Fix tabs in Makefile
stefanv Dec 2, 2021
ae4c3fe
Require book directory for building html
stefanv Dec 2, 2021
caea7c1
Fix incorrect build path
stefanv Dec 2, 2021
f18a5cd
website -> site
Dec 2, 2021
78a689b
website -> site
Dec 2, 2021
83728db
website -> site
Dec 2, 2021
d4325e7
Refactor the build system
stefanv Dec 3, 2021
9edcefd
Fix skdemo
stefanv Dec 3, 2021
ef683cc
Fix up color_and_exposure module
stefanv Dec 3, 2021
f95be21
Fix image links
stefanv Dec 3, 2021
28d0e4c
Fix notebooks; fix skdemo; fix notebook build path
stefanv Dec 3, 2021
4103ab0
Require imagecodecs for reading tiffs
stefanv Dec 3, 2021
db180a5
Fix filters imports
stefanv Dec 3, 2021
64cea04
threshold_adaptive is not threshold_local
stefanv Dec 3, 2021
bfcc8c5
Final fixes to adv0_chromosomes
stefanv Dec 3, 2021
ad248c4
Fix adv1_lesion_quantification
stefanv Dec 3, 2021
6edeb56
Fix adv2_microarray
stefanv Dec 10, 2021
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
11 changes: 6 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
python-version: [3.8]
# TODO Uncomment when skimage theme is ready
# node-version: [15]

steps:
- uses: actions/checkout@v2.3.3

Expand Down Expand Up @@ -60,17 +61,17 @@ 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 .
run: make -C website/ html

# Deploy the book's HTML to github pages
# Deploy site 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/actions-gh-pages@v3.6.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_build/html
publish_dir: ./website/_build/html
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this move? I don't love it...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I felt it'd make things more organized. I don't mind, though. Would you like me to leave it as it was?

cname: scikit-image.org
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ build
*~
*pano-advanced-output.png
book/lessons

# ignoring website local builds
website/_build
23 changes: 11 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ LESSONS_DIR = lessons
GENERATED_LESSONS_DIR = book/lessons

_requirements.installed:
pip install -q -r requirements.txt
touch _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))
Expand All @@ -17,25 +17,24 @@ NOTEBOOKS = $(patsubst %.md, %.ipynb, $(MD_OUTPUTS))

$(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
#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) $<
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
mkdir -p book/lessons

book/lessons/images:
ln -s ${PWD}/lessons/images ${PWD}/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/
@export SPHINXOPTS=-W; make -C book html
cp $(GENERATED_LESSONS_DIR)/*.ipynb book/build/html/lessons/

clean:
rm -rf $(GENERATED_LESSONS_DIR)/*
rm -rf $(GENERATED_LESSONS_DIR)/*
5 changes: 3 additions & 2 deletions _toc.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
- file: lectures/00_images_are_arrays
format: jb-article
alexdesiqueira marked this conversation as resolved.
Show resolved Hide resolved
root: lectures/00_images_are_arrays
sections:
- file: lectures/1_image_filters
- file: lectures/3_morphological_operations
- file: lectures/4_segmentation
- file: lectures/three_dimensional_image_processing

Loading