mirror of
https://gitlab.cern.ch/wotsubo/PSBoardDataBase.git
synced 2025-07-02 01:29:25 +09:00
Add summary pages for hosted notebooks
This commit is contained in:
parent
2bab455089
commit
d1ff3aed23
10 changed files with 30 additions and 5 deletions
26
docs/make_notebook_index.jl
Normal file
26
docs/make_notebook_index.jl
Normal file
|
@ -0,0 +1,26 @@
|
|||
using Markdown
|
||||
|
||||
cd("src/notebooks/") do
|
||||
contents =
|
||||
map(readdir() |> filter(!=(".gitignore")) |> filter(!=("index.html"))) do file
|
||||
last_updated = let
|
||||
cmdout =
|
||||
read(`git log $file`, String) |>
|
||||
IOBuffer |>
|
||||
eachline |>
|
||||
Iterators.Stateful
|
||||
@assert popfirst!(cmdout) |> startswith("commit")
|
||||
@assert popfirst!(cmdout) |> startswith("Author")
|
||||
dateline = popfirst!(cmdout)
|
||||
chopprefix(dateline, "Date:") |> strip
|
||||
end
|
||||
"- [`$file`]($file) (last updated: $last_updated)"
|
||||
end |> (v -> join(v, '\n'))
|
||||
index_content = Markdown.parse("""
|
||||
# notebooks
|
||||
$(contents)
|
||||
""")
|
||||
open("index.html", "w") do f
|
||||
show(f, MIME"text/html"(), index_content)
|
||||
end
|
||||
end
|
1
docs/src/notebooks/.gitignore
vendored
Normal file
1
docs/src/notebooks/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
index.html
|
Loading…
Add table
Add a link
Reference in a new issue