From 3cfdbc43050d98dd5841d2a9408160c48d4e1b21 Mon Sep 17 00:00:00 2001 From: Lieuwe Leene Date: Sun, 29 Aug 2021 09:24:25 +0200 Subject: [PATCH] content update regarding SVG integration. --- content/about.md | 45 ++++++++++++++---- content/posts/building-svg.md | 86 +++++++++++++++++++++++++++++++++++ content/posts/mile-stones.md | 12 +++++ 3 files changed, 134 insertions(+), 9 deletions(-) create mode 100644 content/posts/building-svg.md create mode 100644 content/posts/mile-stones.md diff --git a/content/about.md b/content/about.md index f09fa69..c049392 100644 --- a/content/about.md +++ b/content/about.md @@ -1,23 +1,50 @@ --- -title: "Welcome" +title: "Hello friend 🐱‍👤" date: 2021-08-23T17:52:07+02:00 draft: false --- -Hello friend. - -### About This Site +## About This Site This site shares a bit of informal documentation and more blog-based recod keeping. Providing commentary on design decisions should be just as useful as some of the technical documentation however included in my repositories. -### Setup +## My Setup -| Environment | Development | Production | ---- | --- | --- -| Operating System | Fedora 33 | CentOS 8 | +I mainly use RHEL flavours of linux having both CentOS and Fedora machines. Most +hosted services run on CentOS 8 at the moment abiet they are approaching +end-of-life. Overall the package repository for CentOS 7/8 is just right. I +rarely need to compile anything from source and packages are very stable. +I will eventually migrate to Fedora completely which is where I operate my +development environment. -### About Me +This is a list of my most used self-hosted services: + - Gitea: Git server with web interface for repository mirrors and personal repos + - Plex: mutlti-media hosting service for streaming movies and tv-shows + - NextCloud: Cloud storage for synchronizing and sharing files + - Cockpit: Web base administration portal managing linux boxes + - RoundCube: Web based email client + - Postfix/Dovcot: Email stack providing SMTP for my domain + - NGINX: HTTP server serving as proxy for internal web services + - Danbooru: Ruby-on-rails based image hosting and tagging service + +There are several others that I have tried but these really have been the things +I relied on the most in the past 5 years or so. I think the only thing that is +possibly missing from this list is possibly the equivilent of a centralized LDAP +service but I simply haven't had to manage more than handful of users. + +Currently I develop quite a bit of python utilities for scraping, labeling, and +managing media in an automated fashion. In part I am preparing data for one of +my long term projects which is related to image classification based on +structural decomposition rather than textural features. The main idea here is +to analyse and extract structure in an image before performing in-depth analysis +such that said analysis is most specific to its context. + +This is some of the hardware that I use: + - W10 Laptop: Intel i5-7200U CPU with 8 GB of memory + - W10 Desktop: Intel i5-7200U CPU with 8 GB of memory + +## About Me I do mixed signal circuit design and a bit of software development as a hobby. diff --git a/content/posts/building-svg.md b/content/posts/building-svg.md new file mode 100644 index 0000000..14f566e --- /dev/null +++ b/content/posts/building-svg.md @@ -0,0 +1,86 @@ +--- +title: "Building With SVG" +date: 2021-08-28T11:53:54+02:00 +draft: true +--- + +# SVG Tools and Hugo Integration + +SVG is generally the image container of choice having used it for illustrations, +chip or device specifications, and visual outputs generated by code. SVG is +plain xml that is structured with some top level object/properties followed by +standardized objects that draw lines and shapes. +The hope here is that we can call a predefined go proceedure that parses +some section of markdown source code and instantiates the corresponding svg file +under our static folder that is then referenced. + +``` go +{{/* a comment */}} +``` + +## KGT: Kate's Grammar Tool + +KGT is a pretty neat starting point to experiment with this kind of function. +It is relatively self contained and produces compact SVG objects from simple +statements. + +### Build Instructions + +Building `libfms` and `kgt` from source was not too much of a hassle although +the build / dependancy documentation could be better. This was build with my +WLS-Ubuntu environment. + +``` bash +apt install clang pmake +git clone --recursive "https://$libfsm_REPO/libfsm" +pushd libfsm; CC=clang PREFIX=$HOME pmake -r install; popd +git clone --recursive "https://$KGT_REPO/kgt" +pushd kgt/src; CC=clang PREFIX=$HOME pmake -r install; popd +``` + +The main issue is noticed +is the SVG being generated uses `path {rouded}` in its style definition which +the svg rasterizer from `librsvg2 2.40.20` complained about. Getting the latest +build however is quite involved requiring the latest cairo and proppler +libraries as well. Ideally generating pngs or rasterizing won't be needed. + +### Example + +Just to show a typical use case for making an illustration using the KGT tool, +below I generate the svg for one of the examples included by it's repository. + +``` bash +KGT_DEF=" ::= | \".\" " +echo "$KGT_DEF" | kgt -l bnf -e svg | awk -vf1="$( example_kgt.svg +``` + +The style is automatically introduced in the xml header section which is mostly +plain black. This has some legibility issues for dark themes so a short `awk` +script is used to replace the style with one that we define for this theme. + +``` awk +BEGIN{style_flag=0} +/ +``` + +The final result is shown below. + +![example_kgt.svg](/images/example_kgt.svg) diff --git a/content/posts/mile-stones.md b/content/posts/mile-stones.md new file mode 100644 index 0000000..ede69e0 --- /dev/null +++ b/content/posts/mile-stones.md @@ -0,0 +1,12 @@ +--- +title: "Mile Stones" +date: 2021-08-28T16:13:52+02:00 +draft: true +--- + +This is a list of topics that I may include at somepoint in time: +1. SSL and NGINX setup guide +2. Postfix setup guide +3. Danbooru setup guide +4. pyside notes from pyviewer project +5. other notes