Skip to content

Commit

Permalink
Add GitHub Pages workflow & rename to index.html (#20)
Browse files Browse the repository at this point in the history
### Description
This will mean that the slides appear at
https://scikit-surgery.github.io/cmicHACKS2 rather than
https://scikit-surgery.github.io/cmicHACKS2/slides/slides.html. And
means any new change will be deployed.


## Type of change
Please delete options accordingly to the description.

<!-- Write an `x` in all the boxes that apply -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [X] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update


### Checklist
<!-- You do not need to complete all the items by the time you submit
the pull request, but most likely the changes will only be merged if all
the tasks are done. -->

<!-- Write an `x` in all the boxes that apply -->
- [X] I have read the
[`CONTRIBUTING`](https://github.com/CONTRIBUTING.rst) docs and have a
developer setup (especially important are `pre-commit`and `pytest`)
- [X] My code is properly tested
- [X] My code follows the style guidelines 
- [X] My code does not contain unused elements. If so, I documented why
it needs to.
- [X] My changes generate no new warnings 
- [X] I have performed a self-review of my own code
- [X] I have commented my code, particularly in hard-to-understand areas
- [X] I have made corresponding changes to the documentation
- [X] This pull request is ready to be reviewed
- [X] My branch is up-to-date with master (with use of rebase if needed)
- [X] If the PR is ready and there are multiple commits, I have
[squashed them and
force-pushed](https://www.w3docs.com/snippets/git/how-to-combine-multiple-commits-into-one-with-3-steps.html#force-pushing-commits-7)
  • Loading branch information
paddyroddy authored Nov 9, 2023
1 parent 994cc54 commit f8d08b9
Show file tree
Hide file tree
Showing 24 changed files with 2,936 additions and 8 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/slides.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Deploy Slides

on:
push:
branches:
- main
workflow_dispatch:

concurrency:
cancel-in-progress: true
group: >-
${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
jobs:
deploy-slides:
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/slides/Gemfile
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
bundler-cache: true

- name: Install and Build
working-directory: ./slides
run: >-
JEKYLL_GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
JEKYLL_ENV=production
bundle exec jekyll build
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./slides/_site
publish_branch: gh-pages
user_name: github-actions[bot]
user_email: github-actions[bot]@users.noreply.github.com
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

## site
.jekyll-cache/
_site/
_site/
Gemfile.lock

## Kvasir-SEG dataset
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ In this hackathon, instructors aim to engage with participants to bring three le

We hope to bring together researchers, engineers and clinicians across different departments to hack workflows for real-time AI for Surgery (development, evaluation and integration) and hopefully to sparking future collaborations.

See slides for a quick introduction: https://scikit-surgery.github.io/cmicHACKS2/slides/slides.html
See slides for a quick introduction: https://scikit-surgery.github.io/cmicHACKS2

## :sparkles: Project leaders and organisers
Leaders: [Zhehua Mao](https://github.com/ZH-Mao) and [Miguel Xochicale](https://github.com/mxochicale)
Expand Down
6 changes: 3 additions & 3 deletions slides/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ bundle exec jekyll serve
```
2. Open hmtl slides using firefox on a local server.
```
firefox http://127.0.0.1:4000/slides.html #or google-chrome http://127.0.0.1:4000/slides.html
firefox http://127.0.0.1:4000 #or google-chrome http://127.0.0.1:4000
```
3. You might like to remove build files
```
Expand All @@ -46,9 +46,9 @@ rm -rf .jekyll-cache/ _site/ Gemfile.lock

## 🎒 Steps to create github pages
1. Setting up pages at https://github.com/SciKit-Surgery/cmicHACKS2/settings/pages
2. Select deploy from a branch, select branch `7-slides` with path `/root` and[SAVE]. Then, you might need to select `main` branch for the final version of the slides.
2. Select deploy from a branch, select branch `gh-pages` with path `/root` and[SAVE]. Then, you might need to select `main` branch for the final version of the slides.
3. First GitHub action: https://github.com/SciKit-Surgery/cmicHACKS2/actions/runs/6747753816
4. Online slides should be available here https://scikit-surgery.github.io/cmicHACKS2/slides/slides.html
4. Online slides should be available here https://scikit-surgery.github.io/cmicHACKS2


## References
Expand Down
55 changes: 55 additions & 0 deletions slides/figures/agenda/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@

OS_VERSION:=$(shell lsb_release -a 2>/dev/null | grep Description | awk '{ print $$2 "-" $$3 }')
$(eval $(shell grep VERSION_ID /etc/os-release))
#ifeq ($(VERSION_ID), 22.04)
ifeq ($(OS_VERSION), Ubuntu-22.04.1)
EXPORT_ID = --export-png
else
EXPORT_ID = --export-filename
endif
# https://stackoverflow.com/questions/714100/os-detecting-makefile

INKSCAPE?=inkscape --export-dpi=200 $(EXPORT_ID)


#dPDFSETTINGS=screen #lower quality, smaller size. (72 dpi)
#dPDFSETTINGS=ebook #for better quality, but slightly larger pdfs. (150 dpi)
#dPDFSETTINGS=prepress #output similar to Acrobat Distiller "Prepress Optimized" setting (300 dpi)
#dPDFSETTINGS=printer #selects output similar to the Acrobat Distiller "Print Optimized" setting (300 dpi)
dPDFSETTINGS=default #selects output intended to be useful across a wide variety of uses, possibly at the expense of a larger output file

GS?=gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/$(dPDFSETTINGS) -dNOPAUSE -dQUIET -dBATCH -sOutputFile=

FIGURES_SVG=$(wildcard vectors/*.svg)
FIGURES_PNG=$(subst vectors/,outputs/,$(FIGURES_SVG:.svg=.png))
FIGURES_PDF=$(subst vectors/,outputs/,$(FIGURES_SVG:.svg=.pdf))
FIGURES_PDF_REDUCED_SIZE=$(subst vectors/,outputs/,$(FIGURES_SVG:.svg=_reduced_size.pdf))

# Pattern rule for converting SVG to PNG and PDF
png: $(FIGURES_PNG)
outputs/%.png: vectors/%.svg
$(INKSCAPE) $(@) $(<)

pdf: $(FIGURES_PDF)
outputs/%.pdf: vectors/%.svg
$(INKSCAPE) $(@) $(<)

edit:
inkscape $(FIGURES_SVG)

view-png:
eog $(FIGURES_PNG)

view-pdf:
evince $(FIGURES_PDF)

reduce-pdf-size:
$(GS)$(FIGURES_PDF_REDUCED_SIZE) $(FIGURES_PDF)

clean: ## output figure files
rm -f $(FIGURES_PNG) $(FIGURES_PDF) outputs/*.pdf

test:
echo $(VERSION_ID)
echo $(OS_VERSION)
echo $(EXPORT_ID)
44 changes: 44 additions & 0 deletions slides/figures/agenda/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Vector figures

## Notes

## Usage
```
make png
make pdf
make view-png #eog *.png
make view-pdf #evince *.pdf
make reduce-pdf-size dPDFSETTING=book # screen, ebook, prepress, printer and default
make edit # inkscape vector/drawing-v$NN.svg
make clean
```

## tree file and file size
```
tree -s
[ 4096] .
├── [ 1771] Makefile
├── [ 4096] outputs
│   ├── [ 8378] drawing-v00.pdf
│   ├── [ 30203] drawing-v00.png
│   ├── [ 9015] drawing-v00_reduced_size.pdf
│   └── [ 70] README.md
├── [ 508] README.md
├── [ 4096] references
│   └── [ 15] README.md
└── [ 4096] vectors
└── [ 6982] drawing-v00.svg
3 directories, 8 files
```

## Download template
Open a terminal and type:
```
cd ~/Desktop &&svn checkout https://github.com/mxochicale/figures/trunk/00_template-vector-images
cd 00_template-vector-images && rm -rf .svn
```

# References
https://stackoverflow.com/questions/7106012/download-a-single-folder-or-directory-from-a-github-repo
6 changes: 6 additions & 0 deletions slides/figures/agenda/outputs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Versions
## v01
![v](drawing-v01.png)

## v00
![v](drawing-v00.png)
Binary file added slides/figures/agenda/outputs/drawing-v00.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions slides/figures/agenda/references/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# References


Loading

0 comments on commit f8d08b9

Please sign in to comment.