mirror of
https://gitlab.cern.ch/wotsubo/PSBoardDataBase.git
synced 2025-06-07 21:45:43 +09:00
28 lines
900 B
Julia
28 lines
900 B
Julia
using Markdown
|
|
|
|
cd(dirname(@__FILE__))
|
|
|
|
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
|