Skip to content

Commit

Permalink
support jupyter notebook support
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhigang Song committed Feb 27, 2024
1 parent dfa5d68 commit d09e455
Show file tree
Hide file tree
Showing 9 changed files with 129 additions and 59 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
# uses: lhotari/action-upterm@v1

- name: Build static site
run: docker run -v `pwd`:/blog sidgwick/jkelly:latest
run: docker run -v `pwd`:/blog sidgwick/jekyll:latest

- name: Deploy to GitHub Pages
uses: crazy-max/ghaction-github-pages@v2
Expand Down
13 changes: 6 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
FROM ubuntu:latest
FROM ruby:3.1-slim-bullseye as jekyll
RUN apt-get update -q \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qy build-essential ruby ruby-dev graphviz git \
&& apt-get clean \
&& rm -rf /var/lib/apt
&& DEBIAN_FRONTEND=noninteractive apt-get install -qy build-essential ruby ruby-dev graphviz git python3-notebook jupyter-nbconvert \
&& apt-get clean \
&& rm -rf /var/lib/apt

RUN gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/ \
&& gem install jekyll \
&& gem update --system
&& gem install jekyll \
&& gem update --system

WORKDIR /blog
ENTRYPOINT ["/bin/bash", "bootstrap.sh"]
# ENTRYPOINT ["bin/bash"]
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ source "https://gems.ruby-china.com/"
#gem "rexml", ">= 3.2.5"
gem "jekyll-text-theme"
gem "tzinfo-data"
# gem "jekyll-jupyter-notebook"

group :jekyll_plugins do
gem 'jekyll-graphviz', :git => 'https://github.com/sidgwick/jekyll-graphviz.git'
gem "jekyll-jupyter-notebook", :git => "https://github.com/sidgwick/jekyll-jupyter-notebook"
# gem "jekyll-jupyter-notebook", :path => "./_drafts/jekyll-jupyter-notebook"
# gem 'jekyll-graphviz', :path => "./jekyll-graphviz"
end
143 changes: 105 additions & 38 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,51 +4,75 @@ GIT
specs:
jekyll-graphviz (0.1.0)

GIT
remote: https://github.com/sidgwick/jekyll-jupyter-notebook
revision: 0805b888e7ed45e80495c0aefa2cb0a854f2a102
specs:
jekyll-jupyter-notebook (0.0.6)
jekyll

GEM
remote: https://gems.ruby-china.com/
specs:
activesupport (7.0.2.3)
activesupport (7.1.3.2)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
base64 (0.2.0)
bigdecimal (3.1.6)
colorator (1.1.0)
concurrent-ruby (1.1.10)
concurrent-ruby (1.2.3)
connection_pool (2.4.1)
drb (2.2.0)
ruby2_keywords
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
eventmachine (1.2.7)
ffi (1.15.5)
ffi (1.16.3)
forwardable-extended (2.6.0)
gemoji (3.0.1)
html-pipeline (2.14.1)
gemoji (4.1.0)
google-protobuf (3.25.3)
google-protobuf (3.25.3-aarch64-linux)
google-protobuf (3.25.3-arm64-darwin)
google-protobuf (3.25.3-x86-linux)
google-protobuf (3.25.3-x86_64-darwin)
google-protobuf (3.25.3-x86_64-linux)
html-pipeline (2.14.3)
activesupport (>= 2)
nokogiri (>= 1.4)
http_parser.rb (0.8.0)
i18n (1.10.0)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
jekyll (4.2.2)
jekyll (4.3.3)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
i18n (~> 1.0)
jekyll-sass-converter (~> 2.0)
jekyll-sass-converter (>= 2.0, < 4.0)
jekyll-watch (~> 2.0)
kramdown (~> 2.3)
kramdown (~> 2.3, >= 2.3.1)
kramdown-parser-gfm (~> 1.0)
liquid (~> 4.0)
mercenary (~> 0.4.0)
mercenary (>= 0.3.6, < 0.5)
pathutil (~> 0.9)
rouge (~> 3.0)
rouge (>= 3.0, < 5.0)
safe_yaml (~> 1.0)
terminal-table (~> 2.0)
jekyll-feed (0.16.0)
terminal-table (>= 1.8, < 4.0)
webrick (~> 1.7)
jekyll-feed (0.17.0)
jekyll (>= 3.7, < 5.0)
jekyll-paginate (1.1.0)
jekyll-sass-converter (2.2.0)
sassc (> 2.0.1, < 3.0)
jekyll-sass-converter (3.0.0)
sass-embedded (~> 1.54)
jekyll-sitemap (1.4.0)
jekyll (>= 3.7, < 5.0)
jekyll-text-theme (2.2.6)
Expand All @@ -59,50 +83,93 @@ GEM
jemoji (~> 0.8)
jekyll-watch (2.2.1)
listen (~> 3.0)
jemoji (0.12.0)
gemoji (~> 3.0)
jemoji (0.13.0)
gemoji (>= 3, < 5)
html-pipeline (~> 2.2)
jekyll (>= 3.0, < 5.0)
kramdown (2.3.2)
kramdown (2.4.0)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.3)
listen (3.7.1)
liquid (4.0.4)
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.4.0)
minitest (5.15.0)
nokogiri (1.13.3-x86_64-linux)
minitest (5.22.2)
mutex_m (0.2.0)
nokogiri (1.16.2-aarch64-linux)
racc (~> 1.4)
nokogiri (1.16.2-arm-linux)
racc (~> 1.4)
nokogiri (1.16.2-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.2-x86-linux)
racc (~> 1.4)
nokogiri (1.16.2-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.16.2-x86_64-linux)
racc (~> 1.4)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (4.0.6)
racc (1.6.0)
rb-fsevent (0.11.1)
public_suffix (5.0.4)
racc (1.7.3)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
rexml (3.2.5)
rouge (3.28.0)
rexml (3.2.6)
rouge (4.2.0)
ruby2_keywords (0.0.5)
safe_yaml (1.0.5)
sassc (2.4.0)
ffi (~> 1.9)
terminal-table (2.0.0)
unicode-display_width (~> 1.1, >= 1.1.1)
tzinfo (2.0.4)
sass-embedded (1.71.1-aarch64-linux-gnu)
google-protobuf (~> 3.25)
sass-embedded (1.71.1-aarch64-linux-musl)
google-protobuf (~> 3.25)
sass-embedded (1.71.1-arm-linux-gnueabihf)
google-protobuf (~> 3.25)
sass-embedded (1.71.1-arm-linux-musleabihf)
google-protobuf (~> 3.25)
sass-embedded (1.71.1-arm64-darwin)
google-protobuf (~> 3.25)
sass-embedded (1.71.1-x86-linux-gnu)
google-protobuf (~> 3.25)
sass-embedded (1.71.1-x86-linux-musl)
google-protobuf (~> 3.25)
sass-embedded (1.71.1-x86_64-darwin)
google-protobuf (~> 3.25)
sass-embedded (1.71.1-x86_64-linux-gnu)
google-protobuf (~> 3.25)
sass-embedded (1.71.1-x86_64-linux-musl)
google-protobuf (~> 3.25)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
tzinfo-data (1.2022.1)
tzinfo-data (1.2024.1)
tzinfo (>= 1.0.0)
unicode-display_width (1.8.0)
unicode-display_width (2.5.0)
webrick (1.8.1)

PLATFORMS
ruby
aarch64-linux-gnu
aarch64-linux-musl
arm-linux
arm-linux-gnueabihf
arm-linux-musleabihf
arm64-darwin
x86-linux
x86-linux-gnu
x86-linux-musl
x86_64-darwin
x86_64-linux
x86_64-linux-gnu
x86_64-linux-musl

DEPENDENCIES
jekyll-graphviz!
jekyll-jupyter-notebook!
jekyll-text-theme
tzinfo-data

BUNDLED WITH
2.3.10
2.5.6
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -222,4 +222,4 @@ plugins:
- jekyll-paginate
- jekyll-sitemap
- jemoji
# - jekyll-jupyter-notebook
- jekyll-jupyter-notebook
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ tags: ai ntu machine-learning mathematical-foundations

<!--more-->

{::nomarkdown}
{% jupyter_notebook "decision_stump.ipynb" %}
{:/nomarkdown}

{% include_relative decision_stump.html %}
10 changes: 5 additions & 5 deletions _posts/ai/ntu/decision_stump.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
"\n",
"至于 $s$, 它仅可以取 $\\{-1, +1\\}$.\n",
"\n",
"> 出于计算后面的 19/20 题通用考虑, 下面的代码里面对第一个和最后一个 $\\theta$ 的处理, 不是用的 $-1$, $+1$ 的边界, 而是用的 $ x_0 - 1$ 和 $ x_20 + 1 $."
"> 出于计算后面的 19/20 题通用考虑, 下面的代码里面对第一个和最后一个 $\\theta$ 的处理, 不是用的 $-1$$+1$ 边界, 而是用的 $ x_0 - 1$ 和 $ x_{20} + 1 $."
]
},
{
Expand Down Expand Up @@ -267,13 +267,13 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Question 18\n",
"## Question 18\n",
"\n",
"**解:**\n",
"\n",
"参考 Question 17 里面关于 $E_{out}$ 的计算.\n",
"\n",
"---\n",
"-----\n",
"\n",
"我最开始的更新错误部分的写法实际上是:\n",
"\n",
Expand Down Expand Up @@ -304,7 +304,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Question 19\n",
"## Question 19\n",
"\n",
"决策树桩也适用于多维数据. 特别地, 现在每个决策树桩处理一个特定的维度 $i$, 如下:\n",
"\n",
Expand Down Expand Up @@ -391,7 +391,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Question 20\n",
"## Question 20\n",
"\n",
"用第 19 题求得的 params, 在 $\\mathcal{D}_{test}$ 上面执行预测, 并收集每个维度上的错误情况, 最后报告一个最小的错误."
]
Expand Down
4 changes: 2 additions & 2 deletions _posts/javascript/vue/2024-01-24-vue-web-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ date: 2024-01-24 19:00:00
tags: javascript vue
---

{% raw %}

# 准备

安装 vue 命令行工具:
Expand All @@ -24,6 +22,8 @@ tags: javascript vue

<!--more-->

{% raw %}

```text
Vue CLI v5.0.8
? Please pick a preset: Manually select features
Expand Down
7 changes: 3 additions & 4 deletions bootstrap.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
#!/bin/bash

gem install bundler:2.3.10
gem install bundler:2.5.6
bundler --version
gem install rexml -v 3.2.5
gem install jekyll-jupyter-notebook
bundle install

jekyll build
jekyll build --trace
# jekyll serve -H 0.0.0.0


0 comments on commit d09e455

Please sign in to comment.