From 5557700d80a38a12d8968b639ca94c7da0c0a52c Mon Sep 17 00:00:00 2001
From: Evgenii Akentev
Date: Sat, 2 Mar 2024 23:16:56 +0400
Subject: [PATCH] Add table of contents
---
config.toml | 6 ++
content/pages/books.md | 8 +--
content/pages/projects.md | 6 +-
.../implementations-of-the-handle-pattern.md | 1 +
...houghts-on-backpack-modules-and-records.md | 13 +++--
content/posts/why-i-am-not-a-scientist.md | 2 +-
.../posts/wisdom-and-software-engineering.md | 1 +
themes/theme/layouts/_default/list.html | 35 +++++++-----
themes/theme/layouts/_default/single.html | 42 +++++++++-----
themes/theme/layouts/index.html | 39 +++++++------
themes/theme/layouts/pages/single.html | 20 +++++--
themes/theme/layouts/partials/header.html | 1 +
themes/theme/layouts/partials/toc.html | 10 ++++
themes/theme/static/css/pure-min.css | 11 ++++
themes/theme/static/css/stylesheet.css | 55 +++++++++++++++----
15 files changed, 171 insertions(+), 79 deletions(-)
create mode 100644 themes/theme/layouts/partials/toc.html
create mode 100644 themes/theme/static/css/pure-min.css
diff --git a/config.toml b/config.toml
index 5e23f81..c6aa350 100644
--- a/config.toml
+++ b/config.toml
@@ -31,3 +31,9 @@ copyright = 'This work is licensed under a Creative Commons Attribution-ShareAli
[markup.goldmark]
[markup.goldmark.renderer]
unsafe = true
+
+ [markup.tableOfContents]
+ endLevel = 5
+ ordered = false
+ startLevel = 2
+
diff --git a/content/pages/books.md b/content/pages/books.md
index d824a13..7ad7411 100644
--- a/content/pages/books.md
+++ b/content/pages/books.md
@@ -4,7 +4,7 @@ title: Books
Books I read. Bold titles that I enjoyed and recommend.
-#### 2024
+### 2024
- **Zombies in Western Culture, by John Vervaeke, Christopher Mastropietro, Filip Miscevic**
- **ÐоÑлован, ÐндÑей ÐлаÑонов**
@@ -12,7 +12,7 @@ Books I read. Bold titles that I enjoyed and recommend.
- A Supposedly Fun Thing I'll Never Do Again, by David Foster Wallace
- A Russian Journal, by John Steinbeck, Robert Capa
-#### 2023
+### 2023
- **ÐаÑ, ÐÐ»Ð°Ð´Ð¸Ð¼Ð¸Ñ Ðабоков**
- **Blood Meridian, by Cormac McCarthy**
@@ -27,7 +27,7 @@ Books I read. Bold titles that I enjoyed and recommend.
- The Education of a Value Investor, by Guy Spier
- **Political Order and Political Decay, by Francis Fukuyama**
-#### 2022
+### 2022
- **The Broom of the System, by David Foster Wallace**
- Philosophy, Pussycats, and Porn, by Stoya
@@ -38,7 +38,7 @@ Books I read. Bold titles that I enjoyed and recommend.
- **The Culture Code: The Secrets of Highly Successful Groups, by Daniel Coyle**
- **Clearing the Air: The Beginning and the End of Air Pollution, by Tim Smedley**
-#### 2021
+### 2021
- The Art of War, by Sun Tzu
- A Portrait of the Artist as a Young Man, by James Joyce
diff --git a/content/pages/projects.md b/content/pages/projects.md
index 83d2b21..40ddf2c 100644
--- a/content/pages/projects.md
+++ b/content/pages/projects.md
@@ -2,7 +2,7 @@
title: Projects
---
-#### Hackage packages
+### Hackage packages
@@ -22,7 +22,7 @@ title: Projects
-#### Hosted web projects
+### Hosted web projects
@@ -48,7 +48,7 @@ title: Projects
-#### Educational
+### Educational
diff --git a/content/posts/implementations-of-the-handle-pattern.md b/content/posts/implementations-of-the-handle-pattern.md
index 6a8e02f..496e0f4 100644
--- a/content/posts/implementations-of-the-handle-pattern.md
+++ b/content/posts/implementations-of-the-handle-pattern.md
@@ -3,6 +3,7 @@ title: Implementations of the Handle pattern
date: 2021-01-31
draft: false
tags: [haskell, backpack]
+toc: true
---
In ["Monad Transformers and Effects with Backpack"](https://blog.ocharles.org.uk/posts/2020-12-23-monad-transformers-and-effects-with-backpack.html) [@acid2](https://twitter.com/acid2) presented how to apply Backpack to monad transformers. There is a less-popular approach to deal with effects â [Handle](https://jaspervdj.be/posts/2018-03-08-handle-pattern.html) ([Service](https://www.schoolofhaskell.com/user/meiersi/the-service-pattern)) pattern. I recommend reading both posts at first since they answer many questions regarding the design decisions behind the Handle pattern (why `IO`, why not type classes, etc). In this post, I want to show different implementations of the Handle pattern and compare them. All examples described below are available [in this repository](https://git.ak3n.com/?p=handle-examples.git).
diff --git a/content/posts/thoughts-on-backpack-modules-and-records.md b/content/posts/thoughts-on-backpack-modules-and-records.md
index 645b05e..7a4f8a6 100644
--- a/content/posts/thoughts-on-backpack-modules-and-records.md
+++ b/content/posts/thoughts-on-backpack-modules-and-records.md
@@ -3,6 +3,7 @@ title: Thoughts on Backpack, modules, and records
date: 2021-01-31
draft: false
tags: [haskell, backpack, modules, records]
+toc: true
---
In ["Implementations of the Handle pattern"](/posts/implementations-of-the-handle-pattern) I have explored how Backpack might be used for the Handle pattern. It helped me to take a better look at Backpack and reflect a bit on modules and records in Haskell.
@@ -26,9 +27,9 @@ What's the point of having an unused feature which is unmaintained and unfinishe
I looked at [the GHC proposals](https://github.com/ghc-proposals/ghc-proposals/) to see if there are any improvements of modularity in the future and, in my opinion, most proposals are focused on concrete problems instead of reflecting on the whole language. It may work well but also it may create inconsistency in the language.
-#### [QualifiedDo](https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0216-qualified-do.rst)
+#### QualifiedDo
-`QualifiedDo` brings syntax sugar for overloading `do` notation:
+[`QualifiedDo`](https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0216-qualified-do.rst) brings syntax sugar for overloading `do` notation:
```haskell
{-# LANGUAGE LinearTypes #-}
@@ -98,17 +99,17 @@ f <*> x = do
It's just like opening the records! It might be tedious to write these imports instead of `Linear.do`, but we wouldn't need to bring new functionality to the language if we had local imports. Maybe it means that "do notation" is really important to the Haskell community but to me, it feels like a temporary hack at the moment, not a fundamental part of the language.
-#### [Local modules](https://github.com/goldfirere/ghc-proposals/blob/local-modules/proposals/0000-local-modules.rst)
+#### Local modules
-`LocalModules` sounds like a good step in the right direction. It will be possible to create modules in modules and to open them locally! Just like in the example above with `Linear` module. Another good thing is that each `data` declaration implicitly creates a new local module, [like in Agda](https://agda.readthedocs.io/en/v2.6.1/language/record-types.html#record-modules). I'm not sure if it's possible to open them, I haven't found it in the proposal, but that would unify the opening of records and modules. Unfortunately, the proposal doesn't explore the interaction with Backpack:
+[`LocalModules`](https://github.com/goldfirere/ghc-proposals/blob/local-modules/proposals/0000-local-modules.rst) sounds like a good step in the right direction. It will be possible to create modules in modules and to open them locally! Just like in the example above with `Linear` module. Another good thing is that each `data` declaration implicitly creates a new local module, [like in Agda](https://agda.readthedocs.io/en/v2.6.1/language/record-types.html#record-modules). I'm not sure if it's possible to open them, I haven't found it in the proposal, but that would unify the opening of records and modules. Unfortunately, the proposal doesn't explore the interaction with Backpack:
>This proposal does not appear to interact with Backpack. It does not address signatures, the key feature in Backpack. Perhaps the ideas here could be extended to work with signatures.
Does it mean that there will be `LocalSignatures` in the future? Why not design the whole mechanism at once? Is there a risk of missing something important that would be hard to fix later?
-#### [First class modules](https://github.com/michaelpj/ghc-proposals/blob/imp/first-class-modules/proposals/0000-first-class-modules.rst)
+#### First class modules
-This proposal is about making a module a first-class entity in the language. Its status is *dormant* because it's too much to change while the benefits seem to be the same as in `LocalModules`. While `LocalModules` is a technical proposal that goes into details, `First class modules` is more about language design proposal. `LocalModules` does not replace `First class modules`, but *a part of it*. This is exactly what I was looking for, the proposal that tries to build a vision for the language, what it might look in the future. The proposal mentions Backpack only once:
+[This proposal](https://github.com/michaelpj/ghc-proposals/blob/imp/first-class-modules/proposals/0000-first-class-modules.rst) is about making a module a first-class entity in the language. Its status is *dormant* because it's too much to change while the benefits seem to be the same as in `LocalModules`. While `LocalModules` is a technical proposal that goes into details, `First class modules` is more about language design proposal. `LocalModules` does not replace `First class modules`, but *a part of it*. This is exactly what I was looking for, the proposal that tries to build a vision for the language, what it might look in the future. The proposal mentions Backpack only once:
> Interface files must be able to handle the possibility that an exported name refers to a module. This may have some interaction with Backpack.
diff --git a/content/posts/why-i-am-not-a-scientist.md b/content/posts/why-i-am-not-a-scientist.md
index d2db426..8bf341d 100644
--- a/content/posts/why-i-am-not-a-scientist.md
+++ b/content/posts/why-i-am-not-a-scientist.md
@@ -19,4 +19,4 @@ That's a perfect way to figure out what's worth learning. What's the real intere
I talked to great researchers (who are amazing persons) about their experience and everyday work. I learned that scientists depend on their funding, on grants and writing grant proposals, and they can't just start researching what they find interesting. They deal with a lot of bureaucracy (which I can't stand, I'm extremely allergic to it) and exist in the rigid social structure (a university or a research institution), while I value freedom too much.
-That's how removing the Ego from the equation was a major factor that helped me to resolve my long-standing self-identification crises â to be an engineer or a scientist.
\ No newline at end of file
+That's how removing the Ego from the equation was a major factor that helped me to resolve my long-standing self-identification crises â to be an engineer or a scientist.
diff --git a/content/posts/wisdom-and-software-engineering.md b/content/posts/wisdom-and-software-engineering.md
index d1a3880..a7a0321 100644
--- a/content/posts/wisdom-and-software-engineering.md
+++ b/content/posts/wisdom-and-software-engineering.md
@@ -3,6 +3,7 @@ title: Wisdom and software engineering
date: 2024-01-15
draft: false
tags: [wisdom, software]
+toc: true
---
It's been a while since I read ["The Intelligence Trap"](https://www.goodreads.com/book/show/41817546-the-intelligence-trap) â a nice book on intelligence and wisdom with many facts about knowledge, four stages of competence, how to teach children, how to learn, &c. More importantly it encourages humility and explains how big ego / expertise might be harmful. It certainly bootstraped some thought processes in my mind, getting me curious in different topics â especially wisdom.
diff --git a/themes/theme/layouts/_default/list.html b/themes/theme/layouts/_default/list.html
index 50c48e7..86d2960 100644
--- a/themes/theme/layouts/_default/list.html
+++ b/themes/theme/layouts/_default/list.html
@@ -2,21 +2,26 @@
{{ partial "subheader.html" . }}
-{{ .Title }}
+
{{ partial "footer.html" . }}
diff --git a/themes/theme/layouts/_default/single.html b/themes/theme/layouts/_default/single.html
index c6a3071..4666a20 100644
--- a/themes/theme/layouts/_default/single.html
+++ b/themes/theme/layouts/_default/single.html
@@ -2,22 +2,34 @@
{{ partial "subheader.html" . }}
-