Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
Add links to diary entries; better styling
Browse files Browse the repository at this point in the history
  • Loading branch information
xlxs4 committed Jan 4, 2024
1 parent 2ee92ce commit 7046772
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 20 deletions.
16 changes: 15 additions & 1 deletion assets/css/extended/custom.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
.chroma {
background-color: unset !important;
}
}

.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 */
}
60 changes: 41 additions & 19 deletions content/diary.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <Alt+m>`: ["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 <Alt+m>`: ["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 >}}
13 changes: 13 additions & 0 deletions layouts/shortcodes/diaryList.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{ $counter := 0 }}
<div class="diary-entries">
{{ range split .Inner "%%" }}
{{ $entry := . | markdownify }}
{{ if ne $entry "" }}
{{ $counter = add $counter 1 }}
<div id="entry{{ $counter }}" class="diary-entry">
<a href="#entry{{ $counter }}" class="diary-entry-number">{{ $counter }}.</a>
<div class="diary-entry-content">{{ $entry }}</div>
</div>
{{ end }}
{{ end }}
</div>

0 comments on commit 7046772

Please sign in to comment.