From 7046772f9fb8103b4b4be923cda37543e57466d2 Mon Sep 17 00:00:00 2001 From: Orestis Ousoultzoglou Date: Thu, 4 Jan 2024 14:41:22 +0200 Subject: [PATCH] Add links to diary entries; better styling --- assets/css/extended/custom.css | 16 ++++++++- content/diary.md | 60 +++++++++++++++++++++---------- layouts/shortcodes/diaryList.html | 13 +++++++ 3 files changed, 69 insertions(+), 20 deletions(-) create mode 100644 layouts/shortcodes/diaryList.html diff --git a/assets/css/extended/custom.css b/assets/css/extended/custom.css index a9500fd..11dedb8 100644 --- a/assets/css/extended/custom.css +++ b/assets/css/extended/custom.css @@ -1,3 +1,17 @@ .chroma { background-color: unset !important; -} \ No newline at end of file +} + +.diary-entries { + list-style-type: none; /* Remove bullets */ + padding-left: 0; /* Adjust padding if needed */ +} + +.diary-entry-number { + font-weight: bold; /* Make the number bold */ + margin-right: 0.5em; /* Add space after the number */ +} + +.diary-entry-content { + display: inline; /* Keep content inline with the number */ +} diff --git a/content/diary.md b/content/diary.md index 8e3a4be..96abb75 100644 --- a/content/diary.md +++ b/content/diary.md @@ -5,22 +5,44 @@ url: "/diary/" summary: diary --- -1. There's a guide on writing Julia documentation in the [manual](https://docs.julialang.org/en/v1/manual/documentation/#Writing-Documentation) -2. `module`s automatically contain `using Core`, `using Base`, and definitions of `eval` and `include`. If you only want `Core` to be imported, you can use `baremodule` instead. If you don't even want `Core`, you can do `Module(:MyModuleName, false, false)` and `Core.@eval` code into it (`@eval MyModuleName add(x, y) = $(+)(x, y)`) -3. `julia --project` is the same as `julia --project=.` -4. Specialized versions of methods for specific types are `MethodInstance`s, an internal type in `Core.Compiler` -5. `Base.arrayref` in, e.g., `@code_typed` is from [boot.jl](https://github.com/JuliaLang/julia/blob/e8f89682d7b434f1159626a213756b3691f48d03/base/boot.jl#L962) - ```julia - # for backward compat - arrayref(inbounds::Bool, A::Array, i::Int...) = Main.Base.getindex(A, i...) - ``` - - > as of 1..11, `arrayref` is no longer a thing Julia knows about. `Array` is basically a first class `mutable struct` built on top of `Memory`. Initially we removed `arrayref` entirely, but it turns out that enough people were using it (mostly for dumb reasons) that we added a fallback to prevent code from breaking - - cf. 8 -6. https://docs.julialang.org/en/v1/devdocs/boundscheck/#Propagating-inbounds TODO -7. Calls annotated `::Union{}` do not return -8. https://hackmd.io/@vtjnash/rkzazi7an TODO -9. In REPL, `using REPL; ModuleName `: ["Set mod as the default contextual module in the REPL, both for evaluating expressions and printing them."](https://docs.julialang.org/en/v1/stdlib/REPL/#Changing-the-contextual-module-which-is-active-at-the-REPL) -10. `@allocated` -11. +{{< diaryList >}} +There's a guide on writing Julia documentation in the [manual](https://docs.julialang.org/en/v1/manual/documentation/#Writing-Documentation) +%% + +`module`s automatically contain `using Core`, `using Base`, and definitions of `eval` and `include`. If you only want `Core` to be imported, you can use `baremodule` instead. If you don't even want `Core`, you can do `Module(:MyModuleName, false, false)` and `Core.@eval` code into it (`@eval MyModuleName add(x, y) = $(+)(x, y)`) +%% + +`julia --project` is the same as `julia --project=.` +%% + +Specialized versions of methods for specific types are `MethodInstance`s, an internal type in `Core.Compiler` +%% + +`Base.arrayref` in, e.g., `@code_typed` is from [boot.jl](https://github.com/JuliaLang/julia/blob/e8f89682d7b434f1159626a213756b3691f48d03/base/boot.jl#L962) + +```julia +# for backward compat +arrayref(inbounds::Bool, A::Array, i::Int...) = Main.Base.getindex(A, i...) +``` + +> as of 1..11, `arrayref` is no longer a thing Julia knows about. `Array` is basically a first class `mutable struct` built on top of `Memory`. Initially we removed `arrayref` entirely, but it turns out that enough people were using it (mostly for dumb reasons) that we added a fallback to prevent code from breaking + +cf. 8 +%% + +https://docs.julialang.org/en/v1/devdocs/boundscheck/#Propagating-inbounds TODO +%% + +Calls annotated `::Union{}` do not return +%% + +https://hackmd.io/@vtjnash/rkzazi7an TODO +%% + +In REPL, `using REPL; ModuleName `: ["Set mod as the default contextual module in the REPL, both for evaluating expressions and printing them."](https://docs.julialang.org/en/v1/stdlib/REPL/#Changing-the-contextual-module-which-is-active-at-the-REPL) +%% + +`@allocated` +%% + +{{< /diaryList >}} diff --git a/layouts/shortcodes/diaryList.html b/layouts/shortcodes/diaryList.html new file mode 100644 index 0000000..45df5e4 --- /dev/null +++ b/layouts/shortcodes/diaryList.html @@ -0,0 +1,13 @@ +{{ $counter := 0 }} +
+{{ range split .Inner "%%" }} + {{ $entry := . | markdownify }} + {{ if ne $entry "" }} + {{ $counter = add $counter 1 }} +
+ {{ $counter }}. +
{{ $entry }}
+
+ {{ end }} +{{ end }} +