home

My NixOS systems configurations.
Log | Files | Refs | LICENSE

commit bc7963d4103ad8cd64e4522c08cd1751c69d75c9
parent 1f735085886a78adf7da898489551d335ffd8d64
Author: Vincent Demeester <vincent@sbr.pm>
Date:   Sat,  7 May 2022 13:26:50 +0200

www/vincent.demeester.fr: working on 2022 setup

Signed-off-by: Vincent Demeester <vincent@sbr.pm>

Diffstat:
Awww/vincent.demeester.fr/content/about.org | 27+++++++++++++++++++++++++++
Dwww/vincent.demeester.fr/content/about/index.org | 26--------------------------
Mwww/vincent.demeester.fr/content/index.org | 21+++++++++++++++++----
Awww/vincent.demeester.fr/content/legacy/about/index.org | 27+++++++++++++++++++++++++++
Mwww/vincent.demeester.fr/content/legacy/posts/index.org | 814++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
Mwww/vincent.demeester.fr/content/posts/2022-05-05-random.org | 15++++++++++++++-
Awww/vincent.demeester.fr/content/sandbox.org | 451+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mwww/vincent.demeester.fr/content/sitemap.org | 20+++++++-------------
Awww/vincent.demeester.fr/css/2022.css | 605+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mwww/vincent.demeester.fr/lib/publish-common.el | 17+++++++++--------
Mwww/vincent.demeester.fr/lib/publish.el | 64++++++++++++++++++++++++----------------------------------------
Awww/vincent.demeester.fr/templates/2022.org | 8++++++++
Dwww/vincent.demeester.fr/templates/2022.post.org | 4----
13 files changed, 1957 insertions(+), 142 deletions(-)

diff --git a/www/vincent.demeester.fr/content/about.org b/www/vincent.demeester.fr/content/about.org @@ -0,0 +1,27 @@ +#+TITLE: About me +#+SETUPFILE: ../../templates/2022.org + +I develop mainly in Go, a little bit of Java, a tiny bit of Python ; I'm learning Haskell +and LISP with Clojure (and also Emacs Lisp). The more I learn about about Functionnal +languages and their way of thinking, the more I feel enlighten. I'm using Emacs as my main +editor and IntelliJ IDEA for Java-related stuff. I'm a GNU/Linux user, mainly NixOS +GNU/Linux. I no longer use or need Microsoft® Windows® but I'm, sometimes, using Mac OS X +at work (but I don't really like OS X and Apple in general). I'm a FSFE fellow since 2010 +(and previously a FSF fellow), Framasoft and La Quadrature du Net supporter/donator. I +also try to support various free software, like Mediagoblin. + +* Contact + +- Email :: vinSPAMcentAT@demSPAMeesterDOT.fr +- GnuPG :: [[https://vincent.demeester.fr/about/VincentDemeester.asc][5860 2A88]] +- Instant messaging :: + - vdemeester@jabber.fsfe.org + - vdemeester@irc.freenode.net #fsfe #docker #docker-compose #docker-dev ##openweb +- Socials :: + + [[https://twitter.com/vdemeest][@vdemeest]] on Twitter + + [[https://github.com/vdemeester][@vdemeester]] on GitHub + + [[https://gitlab.com/vdemeester][@vdemeester]] on Gitlab + +* Talks + +- TODO :: TBD diff --git a/www/vincent.demeester.fr/content/about/index.org b/www/vincent.demeester.fr/content/about/index.org @@ -1,26 +0,0 @@ -#+TITLE: About me - -I develop mainly in Go, a little bit of Java, a tiny bit of Python ; I'm learning Haskell -and LISP with Clojure (and also Emacs Lisp). The more I learn about about Functionnal -languages and their way of thinking, the more I feel enlighten. I'm using Emacs as my main -editor and IntelliJ IDEA for Java-related stuff. I'm a GNU/Linux user, mainly NixOS -GNU/Linux. I no longer use or need Microsoft® Windows® but I'm, sometimes, using Mac OS X -at work (but I don't really like OS X and Apple in general). I'm a FSFE fellow since 2010 -(and previously a FSF fellow), Framasoft and La Quadrature du Net supporter/donator. I -also try to support various free software, like Mediagoblin. - -* Contact - -- Email :: vinSPAMcentAT@demSPAMeesterDOT.fr -- GnuPG :: [[https://vincent.demeester.fr/about/VincentDemeester.asc][5860 2A88]] -- Instant messaging :: - - vdemeester@jabber.fsfe.org - - vdemeester@irc.freenode.net #fsfe #docker #docker-compose #docker-dev ##openweb -- Socials :: - + [[https://twitter.com/vdemeest][@vdemeest]] on Twitter - + [[https://github.com/vdemeester][@vdemeester]] on GitHub - + [[https://gitlab.com/vdemeester][@vdemeester]] on Gitlab - -* Talks - -- TODO :: TBD diff --git a/www/vincent.demeester.fr/content/index.org b/www/vincent.demeester.fr/content/index.org @@ -1,12 +1,25 @@ -#+TITLE: Vincent Demeester +#+TITLE: Hi, I'm Vincent Demeester #+FILETAGS: home index #+LINK: monorepo https://git.sr.ht/~vdemeester/home +#+SETUPFILE: ../templates/2022.org #+BEGIN_EXPORT html -<header> -<h1>Hi, I'm Vincent Demeester</h1> <p>I'm a <em>french</em> developer 🐻, Gopher 🐹, sysadmin 🐺, <abbr title="who does all kinds of work"> factotum</abbr> 🦁, <span class="fan"><abbr title="as in free speek">free</abbr>-software <abbr title="You could say Evangelist">fan</abbr></span> 👼 and unicode lover 🐸. I'm working <a href="https://www.redhat.com">RedHat</a> 🎩 as a principal software engineer, previously at <a href="https://www.docker.com">Docker</a> 🐳 and <a href="http://www.zenika.com/">Zenika</a> 🐯. I am a maintainer of the <a href="https://docker.com">docker project (<a href="https://github.com/moby/moby"><code>moby/moby</code></a>, <a href="https://github.com/docker/cli"><code>docker/cli</code></a>, …), the <a href="https://github.com/tektoncd">TektonCD</a> project (<code>tektoncd/*</code>) and a tiny bit of <a href="https://github.com/NixOS/nixpkgs">NixOS</a>.</p> -</header> +#+END_EXPORT + +This is my personal space on the /World Wide Web/. It is meant to be simple, /modest/ and +*persistent* — by persistent, it means that I am trying to not breaking URIs. The list +below is a "selection" of some content. If you are looking for an "index" of all pages +(almost), there is a [[file:sitemap.org][sitemap]]. + +- [[file:posts/2022-05-05-random.org][Random thoughts after 2 years]] +- [[file:sandbox.org][Sandbox]], where I try the /design/ of the website. + +#+BEGIN_EXPORT html +<small class='opinions'>Opinions stated here are my own and do not express the views of my employer, spouse, children, pets, neighbors, secret crushes, favorite authors, or anyone else who is not me. And maybe not even me, depending on how old this is.</small><br/> +<small class='engine'> + Powered by <a href='https://www.gnu.org/software/emacs/'>Gnu Emacs</a> and <a href='https://orgmode.org'>orgmode</a> +</small> #+END_EXPORT #+BEGIN_COMMENT diff --git a/www/vincent.demeester.fr/content/legacy/about/index.org b/www/vincent.demeester.fr/content/legacy/about/index.org @@ -0,0 +1,27 @@ +#+TITLE: About me +#+SETUPFILE: ../../templates/2022.org + +I develop mainly in Go, a little bit of Java, a tiny bit of Python ; I'm learning Haskell +and LISP with Clojure (and also Emacs Lisp). The more I learn about about Functionnal +languages and their way of thinking, the more I feel enlighten. I'm using Emacs as my main +editor and IntelliJ IDEA for Java-related stuff. I'm a GNU/Linux user, mainly NixOS +GNU/Linux. I no longer use or need Microsoft® Windows® but I'm, sometimes, using Mac OS X +at work (but I don't really like OS X and Apple in general). I'm a FSFE fellow since 2010 +(and previously a FSF fellow), Framasoft and La Quadrature du Net supporter/donator. I +also try to support various free software, like Mediagoblin. + +* Contact + +- Email :: vinSPAMcentAT@demSPAMeesterDOT.fr +- GnuPG :: [[https://vincent.demeester.fr/about/VincentDemeester.asc][5860 2A88]] +- Instant messaging :: + - vdemeester@jabber.fsfe.org + - vdemeester@irc.freenode.net #fsfe #docker #docker-compose #docker-dev ##openweb +- Socials :: + + [[https://twitter.com/vdemeest][@vdemeest]] on Twitter + + [[https://github.com/vdemeester][@vdemeester]] on GitHub + + [[https://gitlab.com/vdemeester][@vdemeester]] on Gitlab + +* Talks + +- TODO :: TBD diff --git a/www/vincent.demeester.fr/content/legacy/posts/index.org b/www/vincent.demeester.fr/content/legacy/posts/index.org @@ -1,90 +1,813 @@ #+TITLE: Posts +#+AUTHOR: Vincent Demeester +#+OPTIONS: toc:nil +* [[file:content/legacy/posts/2020-07-08-june-status-update.org][Status update, June 2020]] +:PROPERTIES: +:ID: 2020-07-08-june-status-update.org +:RSS_TITLE: Status update, June 2020 +:RSS_PERMALINK: content/legacy/posts/2020-07-08-june-status-update.html +:PUBDATE: <2020-07-08 Wed 00:00> +:END: + + +Time for the first new monthly status update! I do like those updates from [[https://drewdevault.com/2020/06/15/Status-update.html][Drew DeVault]] +and [[https://emersion.fr/blog/2020/status-update-19/][Simon Ser]], so I figured, why not trying myself 🙃. I am not sure where to start and +where to end, but I guess I'll figure things out as I go. + + +[[file:content/legacy/posts/2020-07-08-june-status-update.org][(Read more)]] -* 2020-07-08 — [[file:2020-07-08-june-status-update.org][Status update, June 2020]] +* [[file:content/legacy/posts/2020-06-21-website-update.org][website update]] :PROPERTIES: -:PUBDATE: [2020-07-08 Wed] +:ID: 2020-06-21-website-update.org +:RSS_TITLE: website update +:RSS_PERMALINK: content/legacy/posts/2020-06-21-website-update.html +:PUBDATE: <2020-06-21 Sun 00:00> :END: -* 2020-06-08 — [[file:2020-06-21-website-update.org][website update]] + + +A really small article to talk about small updates on the website (/well, maybe not that +small/). In a gist: a new css and articles changes. + +- Updating the style of the website to something really similar to [[https://newcss.net/][new.css]]. It is way + simpler and /pleasing/ (at least for me). +- My [[../articles][=/articles=]] are now exporting from my [[../articles/personal_knowledge_base.org][personal knowledge base]], powered by + [[../articles/org_roam.org][=org-roam=]]. +- A new [[https://dl.sbr.pm/][=/files=]] part is available, where I share some random file. See for example the + [[https://dl.sbr.pm/wallpapers/dynamics/][dynamic wallpaper]] part. + +[[file:content/legacy/posts/2020-06-21-website-update.org][(Read more)]] + +* [[file:content/legacy/posts/2020-04-15-emacs-bankruptcy-is-fun.org][Emacs bankruptcy is fun]] :PROPERTIES: -:PUBDATE: [2020-06-08 Mon] +:ID: 2020-04-15-emacs-bankruptcy-is-fun.org +:RSS_TITLE: Emacs bankruptcy is fun +:RSS_PERMALINK: content/legacy/posts/2020-04-15-emacs-bankruptcy-is-fun.html +:PUBDATE: <2020-04-15 Wed 00:00> :END: -* 2020-04-15 — [[file:2020-04-15-emacs-bankruptcy-is-fun.org][Emacs bankruptcy is fun]] + + +Since go 1.14 go released, I've had a broken =go-mode= setup on my Emacs. I was using +=lsp-mode= and =gopls= and well, the update broke everything. I initally try to fix it but +I made it worse. At the same time, I started to get fed up with some performance issue of +my configuration and how slow my Emacs starts, about 6s. + +I, thus, declared my third Emacs bankruptcy, =:disabled= everything and slowly started +from scratch, with the following goal: + +- Have it start quick, as less than a second, not too much more than =emacs -Q= would +- Disable anything that I don't use often initially +- Try to use as much built-in as possible (example: using =icomplete= instead of + =ivy=/=counsel=) + + +[[file:content/legacy/posts/2020-04-15-emacs-bankruptcy-is-fun.org][(Read more)]] + +* [[file:content/legacy/posts/2020-03-22-org-mode-website.org][Migrating to an org-mode website]] :PROPERTIES: -:PUBDATE: [2020-04-15 Wed] +:ID: 2020-03-22-org-mode-website.org +:RSS_TITLE: Migrating to an org-mode website +:RSS_PERMALINK: content/legacy/posts/2020-03-22-org-mode-website.html +:PUBDATE: <2020-03-22 Sun 00:00> :END: -* 2020-03-22 — [[file:2020-03-22-org-mode-website.org][Migrating to an org-mode website]] + :PROPERTIES: -:PUBDATE: [2020-03-22 Sun] +:ID: 24a765bd-a0ed-42cf-b96c-db667f7d37e2 :END: -* 2020-02-22 — [[file:2020-02-22-digital-minimalism.org][On digital minimalism, Linux, NixOS and Emacs]] + +This is a story… a story of me changing the way I code and publish my website. In the +past, I've switch from [[https://vincent.demeester.fr/posts/2012-05-07-reinit-and-jekyll/][Jekyll]] to [[https://vincent.demeester.fr/posts/2015-05-01-orgmode-et-jekyll/]["=orgmode= and Jekyll"]] to [[https://vincent.demeester.fr/posts/2015-05-09-migration-to-hugo/][Hugo]] (sorry those are written +in french). The past year, I've written and documented myself a little bit about +[[https://www.theminimalists.com/minimalism/][minimalism]] and [[https://www.goodreads.com/book/show/40672036-digital-minimalism][digital minimalism]]. Although I don't see myself as a minimalist, it helped +me realize some issues I had. + +I also realized if I want to write more, I need to lower the barrier between writing and +publishing my content ; /if I want it to be published, of course/. This /post/ is about +what I'm putting in place for this, with a premise : I spend my life in [[https://www.gnu.org/software/emacs/][Emacs]] and thus in +[[https://orgmode.org/][=orgmode=]]. And [[https://orgmode.org/][=orgmode=]] is feature-full and has this badass feature : =org-publish=. + +To build and publish this website, we will /try/ to rely on a reproducible setup, meaning +[[https://www.gnu.org/software/emacs/][Emacs]] and [[https://orgmode.org/][=orgmode=]] of course, [[https://www.gnu.org/software/make/][GNU Make]] of course *but* most importantly, [[https://nixos.org/nix/][Nix]] (in the near +future 👼). + +:update: +There is now an article about it, that uses literate programming: [[../articles/meta_publishing_this_website.org][publishing this +website]]. The content of the post might no be up-to-date at some point. +:end: + + + +[[file:content/legacy/posts/2020-03-22-org-mode-website.org][(Read more)]] + +* [[file:content/legacy/posts/2020-02-22-digital-minimalism.org][On digital minimalism, Linux, NixOS and Emacs]] :PROPERTIES: -:PUBDATE: [2020-02-22 Sat] +:ID: 2020-02-22-digital-minimalism.org +:RSS_TITLE: On digital minimalism, Linux, NixOS and Emacs +:RSS_PERMALINK: content/legacy/posts/2020-02-22-digital-minimalism.html +:PUBDATE: <2020-02-22 Sat 00:00> :END: -* 2019-03-23 — [[file:2019-03-23-gotest-tools-poll.org][Golang testing — gotest.tools poll]] + + +I've been reading and listening about Minimalism and Digital Minimalism for a little while +now. I've watch some [[https://www.youtube.com/channel/UCJ24N4O0bP7LGLBDvye7oCA][Matt D'Avella]] youtube video (and documentary), read [[https://www.goodreads.com/book/show/40672036-digital-minimalism][Digital +Minimalism]] from [[https://www.goodreads.com/author/show/147891.Cal_Newport][Cal Newport]], and read a bunch of [[Links][articles and blog posts]]. + +I wouldn't say I am a minimalist, neither am I a digital minimalist *but* it is something +that is a bit appealing and I feel I am slowly taking inspiration from those. I've started +reducing to a minimun what my /smart/-phone does, I've reduced the number of /gadgets/ +I've add over time. But in this posts, I am going to focus on my systems and tools — this +means Linux distributions, Emacs and other tools. + + +[[file:content/legacy/posts/2020-02-22-digital-minimalism.org][(Read more)]] + +* [[file:content/legacy/posts/2019-03-23-gotest-tools-poll.org][Golang testing — gotest.tools poll]] :PROPERTIES: -:PUBDATE: [2019-03-23 Sat] +:ID: 2019-03-23-gotest-tools-poll.org +:RSS_TITLE: Golang testing — gotest.tools poll +:RSS_PERMALINK: content/legacy/posts/2019-03-23-gotest-tools-poll.html +:PUBDATE: <2019-03-23 Sat 00:00> :END: -* 2019-01-26 — [[file:2019-01-26-nix-run-alias.org][Nix run aliases]] + +Let's continue the [[https://gotest.tools][=gotest.tools=]] serie, this time with the =poll= package. + +#+BEGIN_QUOTE +Package poll provides tools for testing asynchronous code. +#+END_QUOTE + +When you write test, you may test a piece of code that work asynchronously, where the +state you're expecting is gonna take a bit of time to be achieved. This is especially true +when you work on networking or file-system code. And this happens a lot when you write +integration (or end-to-end) test, less for unit-tests. + +The package =poll= is trying to tackle those use cases. We'll first take a look at the +main function, =WaitOn=, then how to write a ~Check~, using the ~Result~ type. + + +[[file:content/legacy/posts/2019-03-23-gotest-tools-poll.org][(Read more)]] + +* [[file:content/legacy/posts/2019-01-26-nix-run-alias.org][Nix run aliases]] :PROPERTIES: -:PUBDATE: [2019-01-26 Sat] +:ID: 2019-01-26-nix-run-alias.org +:RSS_TITLE: Nix run aliases +:RSS_PERMALINK: content/legacy/posts/2019-01-26-nix-run-alias.html +:PUBDATE: <2019-01-26 Sat 00:00> :END: -* 2019-01-20 — [[file:2019-01-20-2018-year-review.org][2018 year review]] + + +I use [[https://nixos.org/][=NixOS=]] each and every day, everywhere. One really cool feature of =nix= is +=nix-shell= and more recently (with =nix= >= =2.0.0=), =nix run=. + +#+begin_src man +Usage: nix run <FLAGS>... <INSTALLABLES>... + +Summary: run a shell in which the specified packages are available. + +Flags: + --arg <NAME> <EXPR> argument to be passed to Nix functions + --argstr <NAME> <STRING> string-valued argument to be passed to Nix functions + -c, --command <COMMAND> <ARGS> command and arguments to be executed; defaults to 'bash' + -f, --file <FILE> evaluate FILE rather than the default + -i, --ignore-environment clear the entire environment (except those specified with --keep) + -I, --include <PATH> add a path to the list of locations used to look up <...> file names + -k, --keep <NAME> keep specified environment variable + -u, --unset <NAME> unset specified environment variable + +Examples: + + To start a shell providing GNU Hello from NixOS 17.03: + $ nix run -f channel:nixos-17.03 hello + + To start a shell providing youtube-dl from your 'nixpkgs' channel: + $ nix run nixpkgs.youtube-dl + + To run GNU Hello: + $ nix run nixpkgs.hello -c hello --greeting 'Hi everybody!' + + To run GNU Hello in a chroot store: + $ nix run --store ~/my-nix nixpkgs.hello -c hello + +Note: this program is EXPERIMENTAL and subject to change. +#+end_src + +As you can see from the =-h= summary, it makes it really easy to run a shell or a command +with some packages that are not in your main configuration. It will download the +package(s) if there are not available in the Nix store (=/nix/store/=). + +A few month ago I decided it would be a perfect use-case for command I do not run +often. My idea was, let's define =aliases= (in the shell) that would make a simple command +call, like =ncdu=, become =nix run nixpkgs.ncdu -c ndcu=. My /shell of choice/ is [[https://fishshell.com/][fish]], so +I decided to dig into the /language/ in order to implement that. + +The use case is the following : +- When I type =foo=, I want the command =foo= in package =bar= to be executed. +- I want to be able to pin a channel for the package — I'm using [[https://matthewbauer.us/][Matthew Bauer]] [[https://matthewbauer.us/blog/channel-changing.html][Channel + Changing with Nix]] setup for pin-pointing a given channel. + + +[[file:content/legacy/posts/2019-01-26-nix-run-alias.org][(Read more)]] + +* [[file:content/legacy/posts/2019-01-20-2018-year-review.org][2018 year review]] :PROPERTIES: -:PUBDATE: [2019-01-20 Sun] +:ID: 2019-01-20-2018-year-review.org +:RSS_TITLE: 2018 year review +:RSS_PERMALINK: content/legacy/posts/2019-01-20-2018-year-review.html +:PUBDATE: <2019-01-20 Sun 00:00> :END: -* 2018-09-18 — [[file:2018-09-18-gotest-tools-icmd.org][Golang testing — gotest.tools icmd]] + + +Here is my review of 2018, the first of its kind, hopefully not the last 👼. I saw +some[fn:1] /2018[fn:2] reviews/[fn:3] articles[fn:4] in my Feedly feed and I thought it +would be a good idea to write my own too. + +I'll try in the next year — maybe month if I ever want to do monthly reviews — to automate +some of it ; using the beloved =org-mode=. + +[fn:1] [[https://punchagan.muse-amuse.in/blog/2018-in-review/][2018 in Review - Noetic Nought]] +[fn:2] [[https://medium.com/@buster/42-dig-deeper-e2278d1fe015][42 — Dig deeper – Buster Benson – Medium]] +[fn:3] [[https://jvns.ca/blog/2018/12/23/2018--year-in-review/][2018: Year in review - Julia Evans]] +[fn:4] [[https://writing.natwelch.com/post/685][Nat? Nat. Nat! | #685 2018 Year in Review]] + + +[[file:content/legacy/posts/2019-01-20-2018-year-review.org][(Read more)]] + +* [[file:content/legacy/posts/2018-09-18-gotest-tools-icmd.org][Golang testing — gotest.tools icmd]] :PROPERTIES: -:PUBDATE: [2018-09-18 Tue] +:ID: 2018-09-18-gotest-tools-icmd.org +:RSS_TITLE: Golang testing — gotest.tools icmd +:RSS_PERMALINK: content/legacy/posts/2018-09-18-gotest-tools-icmd.html +:PUBDATE: <2018-09-18 Tue 00:00> :END: -* 2018-09-14 — [[file:2018-09-14-gotest-tools-fs.org][Golang testing — gotest.tools fs]] + +Let's continue the [[https://gotest.tools][=gotest.tools=]] serie, this time with the =icmd= package. + +#+BEGIN_QUOTE +Package icmd executes binaries and provides convenient assertions for testing the results. +#+END_QUOTE + +After file-system operations (seen in [[/posts/2018-09-14-gotest-tools-fs/][=fs=]]), another common use-case in tests is to + +[[file:content/legacy/posts/2018-09-18-gotest-tools-icmd.org][(Read more)]] + +* [[file:content/legacy/posts/2018-09-14-gotest-tools-fs.org][Golang testing — gotest.tools fs]] :PROPERTIES: -:PUBDATE: [2018-09-14 Fri] +:ID: 2018-09-14-gotest-tools-fs.org +:RSS_TITLE: Golang testing — gotest.tools fs +:RSS_PERMALINK: content/legacy/posts/2018-09-14-gotest-tools-fs.html +:PUBDATE: <2018-09-14 Fri 00:00> :END: -* 2018-09-06 — [[file:2018-09-06-gotest-tools-golden.org][Golang testing — gotest.tools golden]] + + +Let's continue the [[https://gotest.tools][=gotest.tools=]] serie, this time with the =fs= package. + +#+BEGIN_QUOTE +Package fs provides tools for creating temporary files, and testing the contents and structure of a directory. +#+END_QUOTE + +This package is heavily using functional arguments (as we saw in [[/posts/2017-01-01-go-testing-functionnal-builders/][functional arguments for +wonderful builders]]). Functional arguments is, in a nutshell, a combinaison of two Go +features : /variadic/ functions (=...= operation in a function signature) and the fact +that =func= are /first class citizen/. This looks more or less like that. + +#+BEGIN_SRC go + type Config struct {} + + func MyFn(ops ...func(*Config)) *Config { + c := &Config{} // with default values + for _, op := range ops { + op(c) + } + return c + } + + // Calling it + conf := MyFn(withFoo, withBar("baz")) +#+END_SRC + +The =fs= package has too *main* purpose : + +1. create folders and files required for testing in a simple manner +2. compare two folders structure (and content) + + +[[file:content/legacy/posts/2018-09-14-gotest-tools-fs.org][(Read more)]] + +* [[file:content/legacy/posts/2018-09-06-gotest-tools-golden.org][Golang testing — gotest.tools golden]] :PROPERTIES: -:PUBDATE: [2018-09-06 Thu] +:ID: 2018-09-06-gotest-tools-golden.org +:RSS_TITLE: Golang testing — gotest.tools golden +:RSS_PERMALINK: content/legacy/posts/2018-09-06-gotest-tools-golden.html +:PUBDATE: <2018-09-06 Thu 00:00> :END: -* 2018-09-01 — [[file:2018-09-01-gotest-tools-skip.org][Golang testing — gotest.tools skip]] + +Let's continue the [[https://gotest.tools][=gotest.tools=]] serie, this time with the =golden= package. This is a +[[/posts/2017-04-22-golang-testing-golden-file/][/quick follow-up/ on a previous =golden= post]], but focused on the =gotest.tools= +implementation. I'm gonna be quicker, please read that one if =golden= files is a new +concept for you. + +#+BEGIN_QUOTE +Package =golden= provides tools for comparing large mutli-line strings. + +Golden files are files in the =./testdata/= sub-directory of the package under test. +#+END_QUOTE + +In the previous article, we described the problem, and how to fix it by writing a small +helper. Well, that small helper is in =gotest.tools/golden= now, and it has a tiny bit +more features. + +One of the difference between the =gotest.tools= implementation and the previous post is +the flag name. In =gotest.tools/golden=, the flag is =-test.update-golden= (was just +=-test.update= before). Just as before, if the =-test.update-golden= flag is set then the +actual content is written to the golden file, before reading it and comparing. + +There is two ways to use the =golden= package: +- on it's own, using =golden.Assert= or =golden.AssertBytes= +- as a =cmp.Comparison=, with =golden.String= or =golden.Bytes= + + +[[file:content/legacy/posts/2018-09-06-gotest-tools-golden.org][(Read more)]] + +* [[file:content/legacy/posts/2018-09-01-gotest-tools-skip.org][Golang testing — gotest.tools skip]] :PROPERTIES: -:PUBDATE: [2018-09-01 Sat] +:ID: 2018-09-01-gotest-tools-skip.org +:RSS_TITLE: Golang testing — gotest.tools skip +:RSS_PERMALINK: content/legacy/posts/2018-09-01-gotest-tools-skip.html +:PUBDATE: <2018-09-01 Sat 00:00> :END: -* 2018-08-16 — [[file:2018-08-16-gotest-tools-assertions.org][Golang testing — gotest.tools assertions]] + + +Let's continue the [[https://gotest.tools][=gotest.tools=]] serie, this time with the =skip= package. This is a +really simple one so this should be quick. + +#+BEGIN_QUOTE +=skip= provides functions for skipping a test and printing the source code of the +condition used to skip the test. +#+END_QUOTE + +The package consists of only one function : =If=. The idea comes mainly from +[[https://github.com/docker/docker][=docker/docker=]] integration test suite, where we wanted to skip some test (or test suites) +given different context. By context I mean things like the system we are running on +(=Windows=, =Linux=, …) or the capabilities of the running kernel or node (is =apparmor= +available or not on the current machine). + +This =If= method takes a =testing.T= pointer and either a boolean, a function that +returns a boolean, *or* an expression. + +#+BEGIN_SRC go + // boolean + // --- SKIP: TestName (0.00s) + // skip.go:19: MissingFeature + var MissingFeature bool + skip.If(t, MissingFeature) + + // function + // --- SKIP: TestName (0.00s) + // skip.go:19: !IsExperimentalDaemon(dockerClient): daemon is not experimental + skip.If(t, IsExperimentalDaemon(dockerClient), "daemon is not experimental") + + // expression + // --- SKIP: TestName (0.00s) + // skip.go:19: apiVersion < version("v1.24") + skip.If(t, apiVersion < version("v1.24")) +#+END_SRC + +There is few elements to note though : + +- This package (as other parts of the =gotest.tools= packages), will try to look at source + files to display the expression used (same goes for =assert=). This is usually not a + problem because you run tests where the source code is. *However*, in the cases you + generate a test binary to be executed later (à-la =kubernetes= or other projects), this + can display a weird error message if the sources are not available… You shouldn't be + worried too much about it, but it's better if you know :) +- The main reason to use =skip.If= is mainly for new contributors to get in quickly, + *reducing potential friction of them running the tests on their environment*. The more + the tests are written in a way they explicitely declare their requirements (and skipped + if the environment does not meet those), the easier it makes contributors run your + tests. *But*, this also means, you should try to measure the skipped tests on your + continuous integration system to make sure you run all of them eventually… otherwise + it's dead code. /But more on that in later posts 😉/. + +That's all for today folks, told you that was going to be quick. + +[[file:content/legacy/posts/2018-09-01-gotest-tools-skip.org][(Read more)]] + +* [[file:content/legacy/posts/2018-08-16-gotest-tools-assertions.org][Golang testing — gotest.tools assertions]] :PROPERTIES: -:PUBDATE: [2018-08-16 Thu] +:ID: 2018-08-16-gotest-tools-assertions.org +:RSS_TITLE: Golang testing — gotest.tools assertions +:RSS_PERMALINK: content/legacy/posts/2018-08-16-gotest-tools-assertions.html +:PUBDATE: <2018-08-16 Thu 00:00> :END: -* 2018-07-28 — [[file:2018-07-28-gotest-tools-intro.org][Golang testing — gotest.tools introduction]] + + +Let's take a closer look at [[https://gotest.tools][=gotest.tools=]] assertions packages. This is mainly about =assert=, =assert/cmp= and +=assert/opt=. + +#+BEGIN_QUOTE +Package assert provides assertions for comparing expected values to actual values. When assertion fails a helpful error +message is printed. +#+END_QUOTE + +There is two main functions (=Assert= and =Check=) and some helpers (like =NilError=, …). They all take a =*testing.T= as +a first argument, pretty common across testing Go libraries. Let's dive into those ! + + +[[file:content/legacy/posts/2018-08-16-gotest-tools-assertions.org][(Read more)]] + +* [[file:content/legacy/posts/2018-07-28-gotest-tools-intro.org][Golang testing — gotest.tools introduction]] :PROPERTIES: -:PUBDATE: [2018-07-28 Sat] +:ID: 2018-07-28-gotest-tools-intro.org +:RSS_TITLE: Golang testing — gotest.tools introduction +:RSS_PERMALINK: content/legacy/posts/2018-07-28-gotest-tools-intro.html +:PUBDATE: <2018-07-28 Sat 00:00> :END: -* 2014-03-24 — [[file:2014-03-24-redesign-et-résolutions.org][Redesign et Résolutions]] + + +I already wrote 2 previous posts about golang and testing. It's something I care deeply +about and I wanted to continue writing about it. It took me a bit more time than I +thought, but getting back to it. Since the [[http://vincent.demeester.fr/posts/2017-04-22-golang-testing-golden-file/][last post]], Daniel Nephin and I worked (but +mainly Daniel 🤗) on bootstrapping a testing helper library. + +Let me introduce it to you this library : [[https://gotest.tools][=gotest.tools=]]. As described in the [[https://godoc.org/gotest.tools][godoc]] package comment, =gotest.tools= is a +collection of packages to augment =testing= and support common patterns. It's an enhanced and growing version of the +initial helpers we (the docker/moby maintainers) wrote initially in [[https://github.com/docker/docker][=docker/docker=]] repository. We are using in quite some +project here at [[https://github.com][Docker]]. + +There is a bunch of packages that will all have their own post (linked here when available) : + +- [[file:2018-08-16-gotest-tools-assertions.org][=assert=]] (with =assert/cmp= and =assert/opt=) that provides assertions for comparing expected values to actual values. +- =env= that provides functions to test code that read environment variable or the current working directory. +- [[file:2018-09-14-gotest-tools-fs.org][=fs=]] that provides tools for creating temporary files, and testing the contents and structure of a directory. +- [[file:2018-09-06-gotest-tools-golden.org][=golden=]] that provides tools for comparing large multi-line strings. +- [[file:2018-09-18-gotest-tools-icmd.org][=icmd=]] that executes binaries and provides convenient assertions for testing the results. +- [[file:2019-03-23-gotest-tools-poll.org][=poll=]] that provides tools for testing asynchronous code. +- [[file:2018-09-01-gotest-tools-skip.org][=skip=]] that provides functions for skipping a test and printing the source code of the condition used to skip the test. + +There is also experimental package, using the =x= notation (as the golang team uses, for example with =golang.org/x/sync=) : + +- =x/subtest= that provides a =TestContext= to subtests which handles cleanup and provides a =testing.TB= and =context.Context=. + +There is already some good =testing= helpers in the Go ecosystem : [[https://github.com/stretchr/testify][=testify=]], [[http://labix.org/gocheck][=gocheck=]], [[https://github.com/onsi/ginkgo][=ginkgo=]] and a lot more — so +why create a new one ? There is multiple reason for it, most of them can be seen in the following [[https://github.com/gotestyourself/gotest.tools/issues/49#issuecomment-362436026][GitHub issue]]. + +[[https://github.com/dnephin/][Daniel]] also wrote a very useful converter if your code base is currently using =testify= : =gty-migrate-from-testify=. + +#+BEGIN_SRC sh +$ go get -u gotest.tools/assert/cmd/gty-migrate-from-testify +# […] +$ go list \ + -f '{{.ImportPath}} {{if .XTestGoFiles}}{{"\n"}}{{.ImportPath}}_test{{end}}' \ + ./... | xargs gty-migrate-from-testify +#+END_SRC + +In the next post, let's dig into the assertion part of the library, package =assert= 👼. + +[[file:content/legacy/posts/2018-07-28-gotest-tools-intro.org][(Read more)]] + +* [[file:content/legacy/posts/2014-03-24-redesign-et-résolutions.org][Redesign et Résolutions]] :PROPERTIES: -:PUBDATE: [2014-03-24 Mon] +:ID: 2014-03-24-redesign-et-résolutions.org +:RSS_TITLE: Redesign et Résolutions +:RSS_PERMALINK: content/legacy/posts/2014-03-24-redesign-et-résolutions.html +:PUBDATE: <2014-03-24 Mon 00:00> :END: -* 2013-10-12 — [[file:2013-10-12-podcasts.org][Podcasts]] + + +Un /tout petit/ post pour parler rapidement, entre autre, du redesign de +[[http://vincent.demeester.fr][vincent.demeester.fr]] et de mes +résolutions. + + +[[file:content/legacy/posts/2014-03-24-redesign-et-résolutions.org][(Read more)]] + +* [[file:content/legacy/posts/2013-10-12-podcasts.org][Podcasts]] :PROPERTIES: -:PUBDATE: [2013-10-12 Sat] +:ID: 2013-10-12-podcasts.org +:RSS_TITLE: Podcasts +:RSS_PERMALINK: content/legacy/posts/2013-10-12-podcasts.html +:PUBDATE: <2013-10-12 Sat 00:00> :END: -* 2013-09-08 — [[file:2013-09-08-maven-tmpfs.org][Maven Tmpfs]] + + +#+BEGIN_QUOTE + Voici un petit billet présentant les différents podcast que j'écoute + plus ou moins régulièrement. +#+END_QUOTE + +J'écoute énormément de musique et de podcast ; je passe beaucoup de +temps avec des écouteurs sur la tête ou la chaine hifi en route. Les +podcasts ont une grande place. Voici une liste plus ou moins bien triés +de ceux auxquels je suis souscrit et/ou que j'écoute en ce moment. Je +tiendrais peut-être ce post à jour ou en créerait un nouveau sinon :-). + + +[[file:content/legacy/posts/2013-10-12-podcasts.org][(Read more)]] + +* [[file:content/legacy/posts/2013-09-08-maven-tmpfs.org][Maven Tmpfs]] :PROPERTIES: -:PUBDATE: [2013-09-08 Sun] +:ID: 2013-09-08-maven-tmpfs.org +:RSS_TITLE: Maven Tmpfs +:RSS_PERMALINK: content/legacy/posts/2013-09-08-maven-tmpfs.html +:PUBDATE: <2013-09-08 Sun 00:00> :END: -* 2012-12-16 — [[file:2012-12-16-gollum-comme-wiki-personnel.org][Gollum comme Wiki personnel]] + + +Je suis un utilisateur convaincu de [[http://maven.apache.org/][maven]], malgré ces défauts, le +moto *"Convention over configuration"* me va vraiment bien. Que ce soit +au boulot ou à la maison, j'ai plus d'ordinateurs équipés de ssd (ou de +mémoire flash) que de disque traditionnel (mécanique ?). Pour augmenter +un peu la durée de vie de ces disques SSD, j'ai cherché à savoir comment +/déporter/ le /build/ de maven (qui, pour rappel, se passe dans le +dossier =target/=) hors du SSD ; ici ce sera dans le dossier =/tmp/= qui +est monté en mémoire (merci =tmpfs=), mais on peut imaginer déporter ça +sur un autre disque, etc.. Après quelques recherches j'ai trouvés +quelques inspirations. + +#+BEGIN_QUOTE + *Limitations* + + Dans la solution présentée ci-dessous les principales limitations sont + les suivantes (que j'essaierais de diminuer au fil du temp ;P) : + + 1. Il est nécessaire de modifier le pom.xml du projet ; cela ne + s'appliquera donc pas à tous les projets maven sans modification du + pom.xml. + 2. Cela ne fonctionne que sur une plateforme qui support les liens + symboliques (Linux, Mac OS X, et autre UNIX). + 3. Cela ne fonctionne qu'avec Java 7 ou plus. + 4. Si vous utilisez m2e, il va gentillement gueuler et c'est moche ; pour résoudre le + problème, il faut faire un tour vers [[http://wiki.eclipse.org/M2E_plugin_execution_not_covered][M2E plugin execution not covered]]. +#+END_QUOTE + +Pour [[http://maven.apache.org/][maven]], le dossier =target/= vient de la propriété +=project.build.directory=. Dans la théorie, il suffirait de modifier +(dans =$HOME/.m2/settings.xml=) cette propriété et le tour serait jouer. +Malheuresement ce n'est pas possible, =project.build.directory= est une +propriété interne et n'est, à priori, pas modifiable. + +Notre souhait est le suivant : + +1. Le build doit se faire dans =/tmp/m2/=, ce qui pour un projet se + traduit par =/tmp/m2/${groupId}:${artifactId}=. +2. Le dossier =target/= dans les sources est un lien symbolique vers le + dossier dans =/tmp/m2/= +3. On passe par un *profile* qui n'est *pas actif* par défaut (pour ne + pas faire chier le monde) mais *activable via une propriété* (maven + nous permet de le faire et c'est cool =^_^=). La propriété utilisée + sera =external.build.root=. + +Le code ci-dessous est repris directement de mon inspiration[fn:1]. Il +s'occupe de créer le dossier =${groupId}:${artifactId}= dans +=external.build.root= et de faire le lien dans le dossier courant. + +#+begin_src xml +<project> + <!-- […] --> + <profiles> + <profile> + <id>external-build-dir</id> + <activation> + <activeByDefault>false</activeByDefault> + <property> + <name>external.build.root</name> + </property> + </activation> + <build> + <plugins> + <plugin> + <groupId>com.alexecollins.maven.plugin</groupId> + <artifactId>script-maven-plugin</artifactId> + <version>1.0.0</version> + <executions> + <execution> + <id>prep-work-tree</id> + <goals> + <goal>execute</goal> + </goals> + <phase>initialize</phase> + <configuration> + <script> + import java.nio.file.* + def dir = + "${external.build.root}/${project.groupId}:${project.artifactId}" + println "using Maven dir ${dir}" + def dirPath = Paths.get(dir) + if (!Files.exists(dirPath)) { + Files.createDirectories(dirPath) + } + def target = Paths.get("${project.build.directory}") + if (!Files.exists(target)) { + Files.createSymbolicLink(target, dirPath) + }</script> + </configuration> + </execution> + <execution> + <id>drop-symlink</id> + <goals> + <goal>execute</goal> + </goals> + <phase>clean</phase> + <configuration> + <script> + import java.nio.file.* + def target = Paths.get("${project.build.directory}") + if (Files.isSymbolicLink(target)) { + Files.delete(target) + } + </script> + </configuration> + </execution> + </executions> + <dependencies> + <dependency> + <groupId>org.codehaus.groovy</groupId> + <artifactId>groovy</artifactId> + <version>1.8.6</version> + </dependency> + </dependencies> + <configuration> + <language>groovy</language> + </configuration> + </plugin> + </plugins> + </build> + </profile> + </profiles> + <!-- […] --> +</project> +#+end_src + +Ainsi, il suffit ensuite d'avoir quelques choses du genre dans son +=$HOME/.m2/settings.xml= pour que les builds qui ont ce profil se +/build/ dans =/tmp/m2/=. On peut aussi ne rien avoir dans +=$HOME/.m2/settings.xml= et utilise =-Dexternal.build.root=/tmp/m2/= +avec la commande =mvn=. + +#+begin_src xml +<settings> + <!-- […] --> + <profiles> + <profile> + <id>build-in-ramfs</id> + <properties> + <external.build.root>/tmp/m2/</external.build.root> + </properties> + </profile> + </profiles> + <activeProfiles> + <activeProfile>build-in-ramfs</activeProfile> + </activeProfiles> + <!-- […] --> +</settings> +#+end_src + + +[fn:1] [[http://elehack.net/writings/programming/maven-target-in-tmpfs][PuttingMaven build directories out-of-tree]] par [[http://elehack.net/][Michal Ekstrand]] + +[[file:content/legacy/posts/2013-09-08-maven-tmpfs.org][(Read more)]] + +* [[file:content/legacy/posts/2012-12-16-gollum-comme-wiki-personnel.org][Gollum comme Wiki personnel]] :PROPERTIES: -:PUBDATE: [2012-12-16 Sun] +:ID: 2012-12-16-gollum-comme-wiki-personnel.org +:RSS_TITLE: Gollum comme Wiki personnel +:RSS_PERMALINK: content/legacy/posts/2012-12-16-gollum-comme-wiki-personnel.html +:PUBDATE: <2012-12-16 Sun 00:00> :END: -* 2012-07-23 — [[file:2012-07-23-maven-release-gitflow.org][Maven Release Gitflow]] + + +Il y a environ 4 mois j'ai eu un accident de vélo ; un traumatisme +crânien, des brulures sur la face, quelques points de sutures, un doigt +cassé et une hernie discale m'ont cloué (et me clou encore) plus que +d'habitude sur ma chaise de bureau. Le bon côté des choses, c'est que +cela m'a permit de me poser et de réfléchir une bonne façon d'être +efficace et organiser, au travail et à la maison :-). + +Une des principales /action/ que j'ai pris est d'utiliser un wiki local +et synchronisé sur /tout/ mes PCs. Le /format/ wiki est assez adapté à +une prise de note et à la création de contenu plus complet (comme des +[[http://shortbrain.org][articles]] ou de la documentation pour des +projets en cours). Les conditions étaient les suivantes : + +- Facilité de mise en place. +- Pas de base de données. +- /Merging/ facile ([[http://git-scm.com][git]] /rules my world/). +- [[http://daringfireball.net/projects/markdown/][Markdown]] comme + syntaxe, car utilisé à peu près partout (blogs, articles, READMEs, + documentations). +- Éditable à partir d'une interface web ou de mon éditeur favoris. + +L'outil qui remplit presque toutes ces conditions s'appelle +[[https://github.com/github/gollum][gollum]]. C'est un moteur wiki, +écris en ruby, qui se base sur un repository +[[http://git-scm.com][git]]. Il est développer par l'équipe de +[[http://github.com][Github]] et c'est celui qui est utilisé par les +pages wiki là-bas. Il permet d'utiliser à peu près n'importe quel +syntaxe (dont +[[https://github.com/github/github-flavored-markdown][github-markdown]] +qui est assez proche de celle de +[[http://johnmacfarlane.net/pandoc][pandoc]]). Par ailleurs, comme il se +base sur [[http://git-scm.com][git]], les points /"pas de base de +données"/, /"merging facile"/ et /"éditable également à partir de mon +éditeur favoris"/ sont toutes remplies. + +Avec [[https://github.com/github/gollum][Gollum]] vous avez un wiki +markdown décentralisé, éditable via une interface web ou via votre +éditeur favoris. + + +[[file:content/legacy/posts/2012-12-16-gollum-comme-wiki-personnel.org][(Read more)]] + +* [[file:content/legacy/posts/2012-07-23-maven-release-gitflow.org][Maven Release Gitflow]] :PROPERTIES: -:PUBDATE: [2012-07-23 Mon] +:ID: 2012-07-23-maven-release-gitflow.org +:RSS_TITLE: Maven Release Gitflow +:RSS_PERMALINK: content/legacy/posts/2012-07-23-maven-release-gitflow.html +:PUBDATE: <2012-07-23 Mon 00:00> :END: -* 2012-05-13 — [[file:2012-05-13-jekyll-foreman-guard-bundler.org][Jekyll Forman Guard Bundler]] + + +I like a lot the [[http://nvie.com/posts/a-successful-git-branching-model/][gitflow]] way of managing project. When working on maven project, there is +few great plugins that helps to get the work done. One of them is [[http://maven.apache.org/plugins/maven-release-plugin][maven-release-plugin]]. + +Inspired on this [[https://gist.github.com/1043970][gist]], I've come +with a cool way of doing things (let say we want to release a 0.1 +version of an artifact) : + + +[[file:content/legacy/posts/2012-07-23-maven-release-gitflow.org][(Read more)]] + +* [[file:content/legacy/posts/2012-05-13-jekyll-foreman-guard-bundler.org][Jekyll Forman Guard Bundler]] :PROPERTIES: -:PUBDATE: [2012-05-13 Sun] +:ID: 2012-05-13-jekyll-foreman-guard-bundler.org +:RSS_TITLE: Jekyll Forman Guard Bundler +:RSS_PERMALINK: content/legacy/posts/2012-05-13-jekyll-foreman-guard-bundler.html +:PUBDATE: <2012-05-13 Sun 00:00> :END: -* 2012-05-08 — [[file:2012-05-08-gitolite-quick-and-dirty-mirror.org][Gitolite quick and dirty mirror]] + + +This post is a quick "How did I setup my Jekyll environnement ?". We are +going all the tools that are quite awesome in Ruby. + + +[[file:content/legacy/posts/2012-05-13-jekyll-foreman-guard-bundler.org][(Read more)]] + +* [[file:content/legacy/posts/2012-05-08-gitolite-quick-and-dirty-mirror.org][Gitolite quick and dirty mirror]] :PROPERTIES: -:PUBDATE: [2012-05-08 Tue] +:ID: 2012-05-08-gitolite-quick-and-dirty-mirror.org +:RSS_TITLE: Gitolite quick and dirty mirror +:RSS_PERMALINK: content/legacy/posts/2012-05-08-gitolite-quick-and-dirty-mirror.html +:PUBDATE: <2012-05-08 Tue 00:00> :END: -* 2012-05-07 — [[file:2012-05-07-reinit-and-jekyll.org][Reinit and Jekyll]] + + +I'm running a gitolite _instance_ on my personal server to manage my repositories +(personnal, private or public) ; and I am quickly going to share with you how I setup a +_quick and dirty_ mirror feature. + +First, I am using **gitolite 3**. The mirroring we are going to setup is not the +_supported_ [[http://sitaramc.github.com/gitolite/mirroring.html][mirroring *built-in*]]. We are going to implement a simplier way to set mirror +thing : + +1. Write a custom gitolite command ; the idea is to be able to write ~git-config~ stuff. +2. Write a hook that take a specific ~git-config~ (let say ~mirror.url~) and do a simple + mirroring. + + +[[file:content/legacy/posts/2012-05-08-gitolite-quick-and-dirty-mirror.org][(Read more)]] + +* [[file:content/legacy/posts/2012-05-07-reinit-and-jekyll.org][Reinit and Jekyll]] :PROPERTIES: -:PUBDATE: [2012-05-07 Mon] -:END:- \ No newline at end of file +:ID: 2012-05-07-reinit-and-jekyll.org +:RSS_TITLE: Reinit and Jekyll +:RSS_PERMALINK: content/legacy/posts/2012-05-07-reinit-and-jekyll.html +:PUBDATE: <2012-05-07 Mon 00:00> +:END: + + +Two weeks ago, my /online/ personal server has been attacked and, +somehow, died. I'm in the process of re-installation of it but I'm going +to hardened a bit the security on it. Anyway, this crash meant that +every piece of site I maintain has been down. That's why I moved this +/identity site/ on the github pages, using a CNAME ; That way I can +crash as much as I want my server(s), this page should still be up for a +while. + +And I'm switching on Jekyll for this website as It is supported by +Github page, easy to use and easy to deploy elsewhere (if one day I want +to move from Github). + +The rest of the post is going to be used as a /sandbox/ post to test the +site styles. + +#+BEGIN_QUOTE + This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, + consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. + Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. + + Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse + id sem consectetuer libero luctus adipiscing. +#+END_QUOTE + + +[[file:content/legacy/posts/2012-05-07-reinit-and-jekyll.org][(Read more)]] + diff --git a/www/vincent.demeester.fr/content/posts/2022-05-05-random.org b/www/vincent.demeester.fr/content/posts/2022-05-05-random.org @@ -1,7 +1,8 @@ #+title: Random thoughts after 2 years +#+SUBTITLE: Re-organizing my writing workflow and website #+date: <2022-05-05 Thu> #+filetags: #home -#+setupfile: ../templates/2022.post.org +#+SETUPFILE: ../../templates/2022.org * Introduction @@ -41,6 +42,18 @@ (buffer-string))) #+end_src +<2022-05-07 Sat 10:45> Hello world + +<2022-05-07> +- Hello world +- Bye world + + +[2022-05-07 Sat 10:45] +Another content + +~code~ versus =code=. {{marking something would be awesome as well}}. + #+begin_quote HTML export of drawer with NAME and CONTENT. name is the name of the drawer, that will be used as class. diff --git a/www/vincent.demeester.fr/content/sandbox.org b/www/vincent.demeester.fr/content/sandbox.org @@ -0,0 +1,451 @@ +#+TITLE: Emacs org-mode sandbox +#+SUBTITLE: A Clean and Comfort Stylesheet +#+SETUPFILE: ../templates/2022.org + +#+BEGIN_abstract + +This article serves as a complete demonstration for my [[file:notes.css][org.css]], a simple and +clean stylesheet for org-exported HTML file. You may switch between the default +style provided by Emacs Org mode, i.e., styles specified in the variable +=org-html-style-default= and my customized stylesheet using the button at the +top left corner. + +#+END_abstract + +#+TOC: headlines 2 + +Hello ~world~ vs =world= 🙃 + +* Demo +:PROPERTIES: +:CUSTOM_ID: sec:demo +:END: +<2015-11-09 Mon 14:41> + +#+BEGIN_QUOTE + +[[http://orgmode.org/][Org mode]] is for keeping notes, maintaining TODO lists, planning projects, +and authoring documents with a fast and effective /plain-text/ system +cite:dominik2003-org. + +#+END_QUOTE + + +We use [[https://en.wikipedia.org/wiki/Lorem_ipsum][Lorem ipsum]] text to demonstrate all elements you would expect to see in +the org-exported HTML pages. Note however that the =.title=, =.subtitle= and +=#postamble= element are not included in this section. + +** TODO Title with TODO + +** DONE Title with DONE + +Some inactive timestamps + +[2019-02-20 Wed 12:03] With time ! + +Let's write some stuff between the two ! + +[2019-02-20 Wed] Without time + +** [#A] Title with Priority + +** Title with Tag :tag0:tag1: + +** Miscellaneous + +#+TOC: headlines 2 local + +*** Table + +#+CAPTION: Table Caption +| \(N\) | \(N^2\) | \(N^3\) | \(N^4\) | \(\sqrt n\) | \(\sqrt[4]N\) | +|-------+---------+---------+---------+-----------+-----------------| +| 1 | 1 | 1 | 1 | 1 | 1 | +| 2 | 4 | 8 | 16 | 1.4142 | 1.1892 | +| 3 | 9 | 27 | 81 | 1.7321 | 1.3161 | +|-------+---------+---------+---------+-----------+-----------------| +#+TBLFM: $2=$1^2::$3=$1^3::$4=$1^4::$5=sqrt($1)::$6=sqrt(sqrt(($1))) + +*** List + +**** The ordered list + +1. Lorem ipsum dolor sit amet, consectetur adipiscing elit. +2. Donec et massa sit amet ligula maximus feugiat. +3. Morbi consequat orci et tincidunt sagittis. + +**** Unordered list + +- Aliquam non metus nec elit pellentesque scelerisque. +- In accumsan nunc ac orci varius hendrerit. +- Suspendisse non eros eu nisi finibus maximus. + +**** Unordered checked list [1/3] + +- [X] Aliquam non metus nec elit pellentesque scelerisque. +- [ ] In accumsan nunc ac orci varius hendrerit. +- [ ] Suspendisse non eros eu nisi finibus maximus. + +**** Definition list + +#+BEGIN_aside +This is a side note. If collection is a string, item must also be a string, and is +compared using =strings.Contains()=. If collection is a Map, contains will succeed if item +is a key in the map. +#+END_aside + +- Lorem ipsum :: dolor sit amet, consectetur adipiscing elit. Mauris laoreet + sollicitudin venenatis. Duis sed consequat dolor. +- Etiam feugiat :: pharetra sapien et semper. Nunc ornare lacus sit amet massa + auctor, vitae aliquam eros interdum. Mauris arcu ante, imperdiet vel purus + ac, bibendum faucibus diam. Ut blandit nec mi at ultricies. Donec eget + mattis nisl. In sed nibh felis. Cras quis convallis orci. +- Sed aliquam :: odio sed faucibus aliquam, arcu augue elementum justo, ut + vulputate ligula sem in augue. Maecenas ante felis, pellentesque auctor + semper non, eleifend quis ante. Fusce enim orci, suscipit ac dapibus et, + fermentum eu tortor. Duis in facilisis ante, quis faucibus dolor. Etiam + maximus lorem quis accumsan vehicula. + +**** Drawers + +Still outside the drawer + +:generic: +This is inside the drawer. +:END: + +And an update 😉 + +:update: +This is an update :) +:END: + +After the drawer. + +:Note: +This is a note +:END: +:Info: +This is an info +:END: +:Tip: +This is a tip +:END: +:Warning: +This is a warning +:END: +*** Picture + +#+CAPTION: Demo Picture with Caption +#+ATTR_HTML: :class shadow +[[file:./images/sandbox/pic-demo.png]] + +And a really wide picture. + +#+CAPTION: A really long picture +#+ATTR_HTML: :width 100% +[[file:./images/sandbox/long-img.png]] + +*** Math + +\begin{align} +\mathcal{F}(a) &= \frac{1}{2\pi i}\oint_\gamma \frac{f(z)}{z - a}\,dz\\ +\int_D (\nabla\cdot \mathcal{F})\,dV &=\int_{\partial D}\mathcal{F}\cdot n\, dS +\end{align} + +* Org-mode links :emacs: + +** TODO Host dependent link + +- grep:foo:~/src/github.com/vdemeester +- rg:foo:~/src/github.com/vdemeester + +** Github links + +- gh:vdemeester/ape +- [[gh:knative/build-pipeline#123][A super PR here]] +- gh:knative/build-pipeline#123 + +** ~man~ + +- [[man:tmux][tmux]] +- [[man:git][git]] + +- [[man:git-commit][Manpage for git-commit]] +- [[https://orgmode.org/manual/store_002dlink-protocol.html][The Org Manual: store-link protocol]] + +** Others + +- tag:foo + +- [[git:~/src/github.com/vdemeester/ape/README.md::v0.2.0]] + +* Org-babel + +** ~emacs-lisp~ + +#+begin_src emacs-lisp :exports both :results value drawer +(message "foo is bar") +#+end_src + +#+RESULTS: +:results: +foo is bar +:end: + +** ~go~ + +#+begin_src go :imports '("fmt") :exports both :results value drawer + fmt.Println("Hello, 世界") +#+end_src + +#+RESULTS: +:results: +Hello, 世界 +:end: + +** ~http~ + +#+BEGIN_SRC http :pretty +POST http://httpbin.org/post +Content-Type: application/json + +{ + "key": "value" +} +#+END_SRC + +#+RESULTS: +:results: +{ + "url": "http://httpbin.org/post", + "json": { + "key": "value" + }, + "headers": { + "User-Agent": "curl/7.35.0", + "Host": "httpbin.org", + "Content-Type": "application/json", + "Content-Length": "18", + "Accept": "*/*" + }, + "form": {}, + "files": {}, + "data": "{ \"key\": \"value\"}", + "args": {} +} +:end: + +** ~rust~ + +#+begin_src rust :exports both :results value drawer + fn main() { + let greetings = ["Hello", "Hola", "Bonjour", + "Ciao", "こんにちは", "안녕하세요", + "Cześć", "Olá", "Здравствуйте", + "chào bạn", "您好"]; + + for (num, greeting) in greetings.iter().enumerate() { + print!("{} : ", greeting); + match num { + 0 => println!("This code is editable and runnable!"), + 1 => println!("Este código es editable y ejecutable!"), + 2 => println!("Ce code est modifiable et exécutable!"), + 3 => println!("Questo codice è modificabile ed eseguibile!"), + 4 => println!("このコードは編集して実行出来ます!"), + 5 => println!("여기에서 코드를 수정하고 실행할 수 있습니다!"), + 6 => println!("Ten kod można edytować oraz uruchomić!"), + 7 => println!("Esse código é editável e executável!"), + 8 => println!("Этот код можно отредактировать и запустить!"), + 9 => println!("Bạn có thể edit và run code trực tiếp!"), + 10 => println!("这段代码是可以编辑并且能够运行的!"), + _ => {}, + } + } + } +#+end_src + +#+RESULTS: +:results: +Hello : This code is editable and runnable! +Hola : Este código es editable y ejecutable! +Bonjour : Ce code est modifiable et exécutable! +Ciao : Questo codice è modificabile ed eseguibile! +こんにちは : このコードは編集して実行出来ます! +안녕하세요 : 여기에서 코드를 수정하고 실행할 수 있습니다! +Cześć : Ten kod można edytować oraz uruchomić! +Olá : Esse código é editável e executável! +Здравствуйте : Этот код можно отредактировать и запустить! +chào bạn : Bạn có thể edit và run code trực tiếp! +您好 : 这段代码是可以编辑并且能够运行的! +:end: + +** ~typescript~ + +*** Execute with node.js + +#+BEGIN_SRC typescript :exports both :results value drawer +module Greeting { + export class Hello { + constructor(private text : string) { + } + say() :void{ + console.log(this.text); + } + } +} + +var hello : Greeting.Hello = new Greeting.Hello("Hello, World!"); +hello.say(); +#+END_src + +#+RESULTS: +:results: +Hello, World! +:end: + +*** Transpile + +You can see transpile results by specifying ":wrap SRC js" header argument. + +#+Begin_SRC typescript :exports both :wrap SRC js :results value drawer +module Greeting { + export class Hello { + constructor(private text : string) { + } + say() :void{ + consonle.log(this.text); + } + } +} + +var hello : Greeting.Hello = new Greeting.Hello("Hello, World!"); +hello.say(); +#+END_SRC + +#+RESULTS: +:results: +#+BEGIN_SRC js +var Greeting; +(function (Greeting) { + var Hello = (function () { + function Hello(text) { + this.text = text; + } + Hello.prototype.say = function () { + console.log(this.text); + }; + return Hello; + })(); + Greeting.Hello = Hello; +})(Greeting || (Greeting = {})); +var hello = new Greeting.Hello("Hello, World!"); +hello.say(); +#+END_SRC +:end: + +** Ditaa + +Let's try something with ~ditaa~ + +#+begin_src ditaa :file ./images/sandbox/some_filename.png + +-----------+ +---------+ + | PLC | | | + | Network +<------>+ PLC +<---=---------+ + | cRED | | c707 | | + +-----------+ +----+----+ | + ^ | + | | + | +----------------|-----------------+ + | | | | + v v v v + +----------+ +----+--+--+ +-------+---+ +-----+-----+ Windows clients + | | | | | | | | +----+ +----+ + | Database +<----->+ Shared +<---->+ Executive +<-=-->+ Operator +<---->|cYEL| . . .|cYEL| + | c707 | | Memory | | c707 | | Server | | | | | + +--+----+--+ |{d} cGRE | +------+----+ | c707 | +----+ +----+ + ^ ^ +----------+ ^ +-------+---+ + | | | + | +--------=--------------------------+ + v + +--------+--------+ + | | + | Millwide System | -------- Data --------- + | cBLU | --=----- Signals ---=-- + +-----------------+ +#+end_src + +#+RESULTS: +[[file:./images/sandbox/some_filename.png]] + + +** Graphviz + +** References and labels ! + +foo is bar + +#+BEGIN_SRC emacs-lisp -l "<ref:%s>" +(save-excursion ;; <ref:foo> + (message "this is baz") + (goto-char (point-min)) ;; <ref:bar> +#+END_SRC + +In line [[(foo)]] we remember the current position. [[(bar)][Line (bar)]] jumps to +point-min. + +#+BEGIN_SRC emacs-lisp -n -r +(save-excursion (ref:sc) + (message "this is sparta") + (goto-char (point-min)) (ref:jump) +#+END_SRC + +In line [[(sc)]] we remember the current position. [[(jump)][Line (jump)]] jumps to point-min. + + +* Counsel + +/this is italic/ +_this should be underlined_ + +* Known Issues +:PROPERTIES: +:CUSTOM_ID: sec:known-issues +:END: + +The citation exporter, =ox-bibtex=, does NOT work seamlessly. As of =Org-mode +8.3.2=, I have the following issues. + +** +Dangling Element+ :solved: +:PROPERTIES: +:CUSTOM_ID: sec:dangling-element +:END: + +The lisp function =insert-file-contents= used in =ox-bibtex= does not move point +and insertion-marker to the end of inserted text (I'm not sure it is a bug or an +intention). The result is that the citation is a dangling table not included in +the bibliography div. + +The expected result is + +#+BEGIN_SRC html +<div id="bibliography"> + <h2>Bibliography</h2> + <table> + <!-- Citation content goes here --> + </table> +</div> +#+END_SRC + +But we got + +#+BEGIN_SRC html +<div id="bibliography"> + <h2>Bibliography</h2> +</div> +<table> +<!-- Citation content goes here --> +</table> +#+END_SRC + +Unless a patch is submitted, we may need to manually adjust this weird result. diff --git a/www/vincent.demeester.fr/content/sitemap.org b/www/vincent.demeester.fr/content/sitemap.org @@ -1,14 +1,8 @@ #+TITLE: content -- 2022-05-07 — [[file:index.org][Vincent Demeester]] - :PROPERTIES: - :PUBDATE: [2022-05-07 Sat] - :END: -- 2022-05-05 — [[file:posts/2022-05-05-random.org][Random thoughts after 2 years]] - :PROPERTIES: - :PUBDATE: [2022-05-05 Thu] - :END: -- 2022-04-25 — [[file:about/index.org][About me]] - :PROPERTIES: - :PUBDATE: [2022-04-25 Mon] - :END:- \ No newline at end of file +- [[file:index.org][Hi, I'm Vincent Demeester]] +- [[file:sandbox.org][Emacs org-mode sandbox]] +- posts + - [[file:posts/2022-05-05-random.org][Random thoughts after 2 years]] +- about + - [[file:about/index.org][About me]]+ \ No newline at end of file diff --git a/www/vincent.demeester.fr/css/2022.css b/www/vincent.demeester.fr/css/2022.css @@ -0,0 +1,605 @@ +/* + 2022.css is based on new.css (see https://newcss.net/) + with very small personal adjustements. +*/ +:root { + ---font-sans: sans-serif; + ---font-mono: monospace; + ---tx-1: #000000; + ---tx-2: #1A1A1A; + ---tx-3: #666666; + ---tx-4: #999999; + ---bg-1: #FFFFFF; + ---bg-2: #F6F8FA; + ---bg-3: #E5E7EB; + ---lk-1: #0070F3; + ---lk-2: #0366D6; + ---lk-tx: #FFFFFF; + ---ac-1: #79FFE1; + ---ac-tx: #0C4047; + + --content-box-padding: 0.5rem; + --aside-width: 12.5rem; +} + +@media (prefers-color-scheme: dark) { + :root { + ---tx-1: #ffffff; + ---tx-2: #eeeeee; + ---tx-3: #cccccc; + ---tx-4: #aaaaaa; + ---bg-1: #000000; + ---bg-2: #111111; + ---bg-3: #222222; + ---lk-1: #3291FF; + ---lk-2: #0070F3; + ---lk-tx: #FFFFFF; + ---ac-1: #7928CA; + ---ac-tx: #FFFFFF; + } +} + +* { + /* Reset margins and padding */ + margin: 0; + padding: 0; +} + +address, +area, +article, +aside, +audio, +blockquote, +datalist, +details, +dl, +fieldset, +figure, +form, +input, +iframe, +img, +meter, +nav, +ol, +optgroup, +option, +output, +p, +pre, +progress, +ruby, +section, +table, +textarea, +ul, +video { + /* Margins for most elements */ + margin-bottom: 1rem; +} + +html,input,select,button { + /* Set body font family and some finicky elements */ + font-family: var(---font-sans); +} + +body { + /* Center body in page */ + margin: 0 auto; + max-width: 70rem; + padding: 2rem; + border-radius: 6px; + overflow-x: hidden; + word-break: break-word; + overflow-wrap: break-word; + background: var(---bg-1); + + /* Main body text */ + color: var(---tx-2); + font-size: 1.03rem; + line-height: 1.5; +} + +::selection { + /* Set background color for selected text */ + background: var(---ac-1); + color: var(---ac-tx); +} + +h1,h2,h3,h4,h5,h6 { + line-height: 1; + color: var(---tx-1); + padding-top: .875rem; +} + +h1, +h2, +h3 { + color: var(---tx-1); + padding-bottom: 2px; + margin-bottom: 8px; + border-bottom: 1px solid var(---bg-2); +} + +h4, +h5, +h6 { + margin-bottom: .3rem; +} + +h1 { + font-size: 2.25rem; +} + +h2 { + font-size: 1.85rem; +} + +h3 { + font-size: 1.55rem; +} + +h4 { + font-size: 1.25rem; +} + +h5 { + font-size: 1rem; +} + +h6 { + font-size: .875rem; +} + +a { + color: var(---lk-1); +} + +a:hover { + color: var(---lk-2); +} + +abbr:hover { + /* Set the '?' cursor while hovering an abbreviation */ + cursor: help; +} + +blockquote { + padding: 1.5rem; + background: var(---bg-2); + border-left: 5px solid var(---bg-3); +} + +abbr { + cursor: help; +} + +blockquote *:last-child { + padding-bottom: 0; + margin-bottom: 0; +} + +header { + background: var(---bg-2); + border-bottom: 1px solid var(---bg-3); + padding: 1rem 1.5rem; + + /* This sets the right and left margins to cancel out the body's margins. It's width is still the same, but the background stretches across the page's width. */ + + margin: -2rem calc(0px - (50vw - 50%)) 2rem; + + /* Shorthand for: + + margin-top: -2rem; + margin-bottom: 2rem; + + margin-left: calc(0px - (50vw - 50%)); + margin-right: calc(0px - (50vw - 50%)); */ + + padding-left: calc(50vw - 50%); + padding-right: calc(50vw - 50%); +} + +header img#sitelogo { + margin-bottom: 0; + margin-right: 1em; +} + +header h1, +header h2, +header h3 { + padding-bottom: 0; + border-bottom: 0; +} + +header > *:first-child { + margin-top: 0; + padding-top: 0; +} + +header > *:last-child { + margin-bottom: 0; +} + +a button, +button, +input[type="submit"], +input[type="reset"], +input[type="button"] { + font-size: 1rem; + display: inline-block; + padding: 6px 12px; + text-align: center; + text-decoration: none; + white-space: nowrap; + background: var(---lk-1); + color: var(---lk-tx); + border: 0; + border-radius: 4px; + box-sizing: border-box; + cursor: pointer; + color: var(---lk-tx); +} + +a button[disabled], +button[disabled], +input[type="submit"][disabled], +input[type="reset"][disabled], +input[type="button"][disabled] { + cursor: default; + opacity: .5; + + /* Set the [X] cursor while hovering a disabled link */ + cursor: not-allowed; +} + +.button:focus, +.button:hover, +button:focus, +button:hover, +input[type="submit"]:focus, +input[type="submit"]:hover, +input[type="reset"]:focus, +input[type="reset"]:hover, +input[type="button"]:focus, +input[type="button"]:hover { + background: var(---lk-2); +} + +code, +pre, +kbd, +samp { + /* Set the font family for monospaced elements */ + font-family: var(---font-mono); +} + +code, +samp, +kbd, +pre { + /* The main preformatted style. This is changed slightly across different cases. */ + background: var(---bg-2); + border: 1px solid var(---bg-3); + border-radius: 4px; + padding: 3px 6px; +} + +kbd { + /* Makes the kbd element look like a keyboard key */ + border-bottom: 3px solid var(---bg-3); +} + +pre { + padding: 1rem 1.4rem; + max-width: 100%; + overflow: auto; +} + +pre.src { + position: relative; +} +pre.src:before { + /*display: none;*/ + position: absolute; + background-color: var(---bg-3); + /*color: #f3f4f4;*/ + top: 0; + right: 0; + padding: 0.2rem 0.5rem; +} + +pre code { + /* When <code> is in a <pre>, reset it's formatting to blend in */ + background: inherit; + font-size: inherit; + color: inherit; + border: 0; + padding: 0; + margin: 0; +} + +code pre { + /* When <pre> is in a <code>, reset it's formatting to blend in */ + display: inline; + background: inherit; + font-size: inherit; + color: inherit; + border: 0; + padding: 0; + margin: 0; +} + +details { + /* Make the <details> look more "clickable" */ + padding: .6rem 1rem; + background: var(---bg-2); + border: 1px solid var(---bg-3); + border-radius: 4px; +} + +summary { + /* Makes the <summary> look more like a "clickable" link with the pointer cursor */ + cursor: pointer; + font-weight: bold; +} + +details[open] { + /* Adjust the <details> padding while open */ + padding-bottom: .75rem; +} + +details[open] summary { + /* Adjust the <details> padding while open */ + margin-bottom: 6px; +} + +details[open]>*:last-child { + /* Resets the bottom margin of the last element in the <details> while <details> is opened. This prevents double margins/paddings. */ + margin-bottom: 0; +} + +dt { + font-weight: bold; +} + +dd::before { + /* Add an arrow to data table definitions */ + content: '→ '; +} + +hr { + /* Reset the border of the <hr> separator, then set a better line */ + border: 0; + border-bottom: 1px solid var(---bg-3); + margin: 1rem auto; +} + +fieldset { + margin-top: 1rem; + padding: 2rem; + border: 1px solid var(---bg-3); + border-radius: 4px; +} + +legend { + padding: auto .5rem; +} + +table { + /* border-collapse sets the table's elements to share borders, rather than floating as separate "boxes". */ + border-collapse: collapse; + width: 100% +} + +td, +th { + border: 1px solid var(---bg-3); + text-align: left; + padding: .5rem; +} + +th { + background: var(---bg-2); +} + +tr:nth-child(even) { + /* Set every other cell slightly darker. Improves readability. */ + background: var(---bg-2); +} + +table caption { + font-weight: bold; + margin-bottom: .5rem; +} + +textarea { + /* Don't let the <textarea> extend off the screen naturally or when dragged by the user */ + max-width: 100%; +} + +ol, +ul { + /* Replace the browser default padding */ + padding-left: 2rem; +} + +li { + margin-top: .4rem; +} + +ul ul, +ol ul, +ul ol, +ol ol { + margin-bottom: 0; +} + +mark { + padding: 3px 6px; + background: var(---ac-1); + color: var(---ac-tx); +} + +textarea, +select, +input { + padding: 6px 12px; + margin-bottom: .5rem; + background: var(---bg-2); + color: var(---tx-2); + border: 1px solid var(---bg-3); + border-radius: 4px; + box-shadow: none; + box-sizing: border-box; +} + +img { + max-width: 100%; +} + +aside { + --aside-offset: 1rem; + --aside-offset-lineheight: 1.5rem; + background-color: var(---bg-2); + padding: calc(var(--content-box-padding) * 0.5) calc(var(--content-box-padding) * 2); + padding-top: 1em; + margin-bottom: 0em; + float: right; + width: var(--aside-width); + font-size: 0.9rem; + line-height: 1.25rem; + border: 1px solid var(--bg-3); +} + +figure figcaption { + text-align: center; + color: var(---tx-2); + font-style: italic; + margin: 0 2rem; +} + +footer { + text-align: center; + color: var(---tx-4); +} + +footer a { + color: var(---tx-3); +} + +section img { + display: block; + margin-left: auto; + margin-right: auto; +} + +section img.shadow { + box-shadow: 0 28px 50px rgba(0,0,0,0.16); +} + +div.drawer:before { + content: ""; + position: absolute; + top: 0; + bottom: 0; + left: 4.4rem; + width: 1px; + background-color: #555; +} + +div.drawer { + display: flex; + padding: 0; + margin: 1rem; + padding-top: 1rem; + position: relative; + color: #555; +} + +div.drawer h6 { + box-sizing: border-box; + font-style: italic; + flex: 0 0 5rem; + margin:0; + padding:0; + align-self: center; + text-align: right; + padding-right: 1.2rem; +} + +div.drawer.info:before { + background-color: #00529B; +} +div.drawer.info { + color: #00529B; +} + +div.drawer.note:before { + background-color: #9F6000; +} +div.drawer.note { + color: #9F6000; +} +div.drawer.tip:before { + background-color: #4F8A10; +} +div.drawer.tip { + color: #4F8A10; +} +div.drawer.warning:before { + background-color: #D8000C; +} +div.drawer.warning { + color: #D8000C; +} +div.drawer.results:before { + background-color: black; +} +div.drawer.results { + font-family:monospace,monospace; + font-family: var(---font-mono); + color: black; + width: 100% !important; +} +div.drawer.results p { + display: block; + unicode-bidi: embed; + white-space: pre; + margin-top: 0; +} +div.drawer.results pre { + background-color: inherit; + border: 0; +} +div.drawer.results pre.src:before { + background-color: #eee; + color: #555; +} + +.tag { + font-family:var(---font-mono); + font-size: 1rem; +} +.tag span { + padding:.3em; + float:right; + margin-right:.5em; + border:1px solid #bbb; + border-radius:3px; + background-clip:padding-box; + color:#333; + background-color:#eee; + line-height:1rem; +} + +.todo { + font-family: monospace; color: red; +} +.done { + font-family: monospace; color: green; +} +.priority { font-family: monospace; color: orange; } +.timestamp { color: #bebebe; } +.timestamp-kwd { color: #5f9ea0; } diff --git a/www/vincent.demeester.fr/lib/publish-common.el b/www/vincent.demeester.fr/lib/publish-common.el @@ -83,7 +83,8 @@ content is the content of the drawer" (car (plist-get plist :author))))) ;; Below content will be added anyways - "<nav> + "<nav style=\"background: yellow;\">This part of the website is \"archived\", it means it is \"stuck in time\" and won't be updated/up-to-date</nav> +<nav> <img src=\"/images/favicon.ico\" id=\"sitelogo\"/> <a href='/'>home</a> / <a href='/posts/'>posts</a> (<a href='/index.xml'>rss</a>) / <a href='/articles/'>articles</a> / @@ -93,16 +94,16 @@ content is the content of the drawer" (defvar sbr-website-html-postamble "<footer> - <span class='questions'>Questions, comments ? Please use my <a href=\"https://lists.sr.ht/~vdemeester/public-inbox\">public inbox</a> by sending a plain-text email to <a href=\"mailto:~vdemeester/public-inbox@lists.sr.ht\">~vdemeester/public-inbox@lists.sr.ht</a>.</span> - <span class='opinions'>Opinions stated here are my own and do not express the views of my employer, spouse, children, pets, neighbors, secret crushes, favorite authors, or anyone else who is not me. And maybe not even me, depending on how old this is.</span> - <span class='copyright'> + <small><a href=\"/\" rel=\"history\">Index</a> • <a href=\"/sitemap.html\">Sitemap</a> • <a href=\"https://dl.sbr.pm/\">Files</a></small><br/> + <small class='questions'>Questions, comments ? Please use my <a href=\"https://lists.sr.ht/~vdemeester/public-inbox\">public inbox</a> by sending a plain-text email to <a href=\"mailto:~vdemeester/public-inbox@lists.sr.ht\">~vdemeester/public-inbox@lists.sr.ht</a>.</small><br/> + <small class='copyright'> Content and design by Vincent Demeester (<a rel='licence' href='http://creativecommons.org/licenses/by-nc-sa/3.0/'>Some rights reserved</a>) - </span><br /> - <span class='engine'> - Powered by <a href='https://www.gnu.org/software/emacs/'>Gnu Emacs</a> and <a href='https://orgmode.org'>orgmode</a> - </span> + </small><br /> </footer>") + +;; TODO: Move in about / colophon + (defvar site-attachments (regexp-opt '("jpg" "jpeg" "gif" "png" "svg" "ico" "cur" "css" "js" "woff" "html" "pdf" "otf")) diff --git a/www/vincent.demeester.fr/lib/publish.el b/www/vincent.demeester.fr/lib/publish.el @@ -17,56 +17,24 @@ :publishing-function org-html-publish-to-html :publishing-directory "./public" :exclude ,(regexp-opt '("README.org" "draft" "legacy" "articles")) + :index-filename "index.org" :auto-sitemap t :with-footnotes t :with-toc nil :with-drawers t :sitemap-filename "sitemap.org" :sitemap-title "content" - :sitemap-format-entry sbr/org-sitemap-format-entry - :sitemap-style list + ;; :sitemap-format-entry sbr/org-sitemap-format-entry + :sitemap-style tree :sitemap-sort-files anti-chronologically + :html-head-include-default-style nil + :html-head-include-scripts nil ;; :sitemap-function sbr/org-publish-sitemap - ;; :html-head-include-scripts nil - ;; :html-head-include-default-style nil ;; :html-head ,sbr-website-html-head ;; :html-preamble sbr-website-html-preamble - ;; :html-postamble ,sbr-website-html-postamble + :html-postamble ,sbr-website-html-postamble ) - ;; TODO: add rss for content - ("about" - :base-directory "content/about" - :base-extension "org" - :exclude ,(regexp-opt '("README.org" "draft")) - :index-filename "index.org" - :recursive nil - :with-footnotes t - :with-toc nil - :with-drawers t - :publishing-function org-html-publish-to-html - :publishing-directory "./public/about" - :html-head-include-scripts nil - :html-head-include-default-style nil - :html-head ,sbr-website-html-head - :html-preamble sbr-website-html-preamble - :html-postamble ,sbr-website-html-postamble) - ("index" - :base-directory "content/" - :base-extension "org" - :exclude ,(regexp-opt '("README.org" "draft")) - :index-filename "index.org" - :recursive nil - :with-footnotes t - :with-toc nil - :with-drawers t - :with-title nil - :publishing-function org-html-publish-to-html - :publishing-directory "./public" - :html-head-include-scripts nil - :html-head-include-default-style nil - :html-head ,sbr-website-html-head - :html-preamble sbr-website-html-preamble - :html-postamble ,sbr-website-html-postamble) + ;; TODO: add rss for content, from https://writepermission.com/org-blogging-rss-feed.html ("css" :base-directory "./css" :base-extension ,site-attachments @@ -151,13 +119,29 @@ :publishing-directory "./public/articles" :publishing-function org-publish-attachment :recursive t) + ("about" + :base-directory "content/legacy/about" + :base-extension "org" + :exclude ,(regexp-opt '("README.org" "draft")) + :index-filename "index.org" + :recursive nil + :with-footnotes t + :with-toc nil + :with-drawers t + :publishing-function org-html-publish-to-html + :publishing-directory "./public/about" + :html-head-include-scripts nil + :html-head-include-default-style nil + :html-head ,sbr-website-html-head + :html-preamble sbr-website-html-preamble + :html-postamble ,sbr-website-html-postamble) ("legacy" :base-directory "./content/legacy" :base-extension ,site-attachments :publishing-directory "./public/" :publishing-function org-publish-attachment :recursive t) - ("all" :components ("content" "posts" "about" "index" "articles" "articles-assets" "css" "images" "assets" "legacy" "posts-rss")))) + ("all" :components ("content" "posts" "articles" "articles-assets" "css" "images" "assets" "legacy" "posts-rss")))) (defun publish () "Build vincent.demeester.fr website" diff --git a/www/vincent.demeester.fr/templates/2022.org b/www/vincent.demeester.fr/templates/2022.org @@ -0,0 +1,8 @@ +#+AUTHOR: Vincent Demeester +#+KEYWORDS: post +#+OPTIONS: toc:nil pri:nil todo:nil d:(not "LOGBOOK") +#+EXCLUDE_TAGS: noexport +#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="/css/2022.css" /> +#+HTML_HEAD_EXTRA: <link rel="stylesheet" type="text/css" href="/css/syntax.css" /> +#+HTML_HEAD_EXTRA: <link rel='icon' type='image/x-icon' href='/images/favicon.ico'/> +#+HTML_HEAD_EXTRA: <meta name='viewport' content='width=device-width, initial-scale=1'> diff --git a/www/vincent.demeester.fr/templates/2022.post.org b/www/vincent.demeester.fr/templates/2022.post.org @@ -1,4 +0,0 @@ -#+AUTHOR: Vincent Demeester -#+KEYWORDS: post -#+OPTIONS: toc:nil pri:nil todo:nil d:(not "LOGBOOK") -#+EXCLUDE_TAGS: noexport