From 8d9763fd38ff6e7d322c303e4f5de7e54500b416 Mon Sep 17 00:00:00 2001 From: Marcos Benevides Date: Sat, 6 Jul 2024 23:29:00 -0300 Subject: [PATCH] WIP: improve org-roam and note-taking experience (#12) * improve org-roam and note-taking experience --- .github/workflows/build.yml | 4 +- .gitignore | 1 + README.org | 2 + blog/notes.org | 1 - config.toml | 7 +- content-org/content.org | 71 +++++++++++++++++++ content-org/refs.bib | 14 ++++ export.el | 23 +++++- flake.nix | 40 +++++++++-- layouts/partials/nav.html | 4 +- ...lgebraic_models_for_accounting_systems.org | 3 +- notes/20240619114451-erlang.org | 44 ++---------- notes/20240706213027-programming_erlang.org | 7 ++ notes/20240706222446-introducing_erlang.org | 43 +++++++++++ 14 files changed, 210 insertions(+), 54 deletions(-) create mode 100644 notes/20240706213027-programming_erlang.org create mode 100644 notes/20240706222446-introducing_erlang.org diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 847fc24..e30fc18 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,15 +2,13 @@ name: Build on: pull_request: - branches: [ master ] - workflow_dispatch: permissions: contents: write jobs: - deploy: + pr-build: runs-on: ubuntu-latest steps: - name: Checkout code diff --git a/.gitignore b/.gitignore index d08e708..c87101c 100644 --- a/.gitignore +++ b/.gitignore @@ -64,5 +64,6 @@ hugo.linux # Extra content/ +ltximg *env* *zip diff --git a/README.org b/README.org index d463582..410502f 100644 --- a/README.org +++ b/README.org @@ -6,6 +6,8 @@ An Org-based personal page and blog. ** Usage +This project uses the + *** Development #+BEGIN_SRC bash diff --git a/blog/notes.org b/blog/notes.org index 8b13789..e69de29 100644 --- a/blog/notes.org +++ b/blog/notes.org @@ -1 +0,0 @@ - diff --git a/config.toml b/config.toml index 1d939d6..44e7424 100644 --- a/config.toml +++ b/config.toml @@ -5,6 +5,11 @@ languageCode = "en-us" pygmentsUseClasses = true assetDir = "static" +[params] + subtitle = "\"Writing is nothing more than a guided dream.\"" + [params.author] + name = "Marcos Benevides" + [outputs] section = ["HTML", "ATOM"] @@ -12,8 +17,6 @@ assetDir = "static" blog = '/blog/:year/:slug/' notes = '/notes/:year/:slug/' -[author] - name = "Marcos Benevides" [mediaTypes."application/atom+xml"] suffixes = ["xml"] diff --git a/content-org/content.org b/content-org/content.org index 94835bd..d6dcebd 100644 --- a/content-org/content.org +++ b/content-org/content.org @@ -2,6 +2,7 @@ #+bibliography: ./refs.bib #+HUGO_BASE_DIR: ../ #+HUGO_PAIRED_SHORTCODES: alert image +#+OPTIONS: broken-links:mark #+AUTHOR: Marcos Benevides * Pages @@ -58,6 +59,36 @@ This page is a rendered version of my [[https://en.wikipedia.org/wiki/OPML][OPML #+INCLUDE: "../blog/notes.org" +** Abelian Group +:PROPERTIES: +:EXPORT_FILE_NAME: abelian-group +:EXPORT_DATE: 2023-10-07 +:EXPORT_HUGO_CUSTOM_FRONT_MATTER: :slug abelian-group +:CUSTOM_ID: abelian-group +:END: + +#+INCLUDE: "../notes/20231007164540-abelian_group.org" + +** Algebraic Models for Accouting Systems +:PROPERTIES: +:EXPORT_FILE_NAME: algebraic-models-for-accouting-systems +:EXPORT_DATE: 2023-10-05 +:EXPORT_HUGO_CUSTOM_FRONT_MATTER: :slug algebraic-models-for-accouting-systems +:CUSTOM_ID: algebraic-models-for-accouting-systems +:END: + +#+INCLUDE: "../notes/20231005194145-algebraic_models_for_accounting_systems.org" + +** Commutative Ring +:PROPERTIES: +:EXPORT_FILE_NAME: commutative-ring +:EXPORT_DATE: 2023-10-07 +:EXPORT_HUGO_CUSTOM_FRONT_MATTER: :slug commutative-ring +:CUSTOM_ID: commutative-ring +:END: + +#+INCLUDE: "../notes/20231007164648-commutative_ring.org" + ** Distributed Systems :PROPERTIES: :EXPORT_FILE_NAME: distributed-systems @@ -68,6 +99,36 @@ This page is a rendered version of my [[https://en.wikipedia.org/wiki/OPML][OPML #+INCLUDE: "../notes/20211202213813-distributed_systems.org" +** Erlang +:PROPERTIES: +:EXPORT_FILE_NAME: erlang +:EXPORT_DATE: 2024-06-19 +:EXPORT_HUGO_CUSTOM_FRONT_MATTER: :slug erlang +:CUSTOM_ID: erlang +:END: + +#+INCLUDE: "../notes/20240619114451-erlang.org" + +** Introducing Erlang: Getting Started in Functional Programming +:PROPERTIES: +:EXPORT_FILE_NAME: introducing-erlang +:EXPORT_DATE: 2024-07-06 +:EXPORT_HUGO_CUSTOM_FRONT_MATTER: :slug introducing-erlang +:CUSTOM_ID: introducing-erlang +:END: + +#+INCLUDE: "../notes/20240706222446-introducing_erlang.org" + +** Programming Erlang: Software for a Concurrent World +:PROPERTIES: +:EXPORT_FILE_NAME: programming-erlang-software-for-a-concurrent-world +:EXPORT_DATE: 2024-07-06 +:EXPORT_HUGO_CUSTOM_FRONT_MATTER: :slug programming-erlang-software-for-a-concurrent-world +:CUSTOM_ID: programming-erlang-software-for-a-concurrent-world +:END: + +#+INCLUDE: "../notes/20240706213027-programming_erlang.org" + ** History of Logic: From Aristotle to Taski :PROPERTIES: :EXPORT_FILE_NAME: history-of-logic-from-aristotle-to-taski @@ -117,3 +178,13 @@ This page is a rendered version of my [[https://en.wikipedia.org/wiki/OPML][OPML :END: #+INCLUDE: "../notes/20231008214945-monoid.org" + +** R-Module Homomorphism +:PROPERTIES: +:EXPORT_FILE_NAME: r-module-homomorphism +:EXPORT_DATE: 2023-10-07 +:EXPORT_HUGO_CUSTOM_FRONT_MATTER: :slug r-module-homomorphism +:CUSTOM_ID: r-module-homomorphism +:END: + +#+INCLUDE: "../notes/20231007182834-r_module_homomorphism.org" diff --git a/content-org/refs.bib b/content-org/refs.bib index f9c5077..048e8fe 100644 --- a/content-org/refs.bib +++ b/content-org/refs.bib @@ -1,3 +1,10 @@ +@article{armstrong2013, + title={Programming Erlang: software for a concurrent world}, + author={Armstrong, Joe}, + year={2013}, + publisher={The Pragmatic Bookshelf} +} + @book{horstman2023effective, title={The Effective Manager: Completely Revised and Updated}, author={Horstman, Mark and Braun, Kate and Sentes, Sarah}, @@ -5,6 +12,13 @@ @book{horstman2023effective publisher={John Wiley \& Sons} } +@book{laurent2017, + title={Introducing Erlang: getting started in functional programming}, + author={Laurent, Simon St}, + year={2017}, + publisher={" O'Reilly Media, Inc."} +} + @book{metzger1996, author = {Metzger, Philip W. and Boddie, John}, title = {Managing a programming project (3rd ed.): processes and people}, diff --git a/export.el b/export.el index fc3291d..496c9dd 100644 --- a/export.el +++ b/export.el @@ -5,7 +5,26 @@ (require 'org) (require 'oc-csl) (require 'citeproc) +(require 'find-lisp) +;; Configuration Variables: +(setq content-dir (concat (getenv "PWD") "/content-org")) + +;; Don't ask for confirmation before evaluating a code block +(setq org-confirm-babel-evaluate nil) +;;(setq org-export-use-babel t) +(setq org-export-with-broken-links t) + +;; This makes it easier to export my notes into something that +;; ox-hugo will easily pick links and generate markdowns. +;; https://www.orgroam.com/manual.html#Overriding-the-default-link-creation-function +(defun org-roam-custom-link-builder (node) + (let ((file (org-roam-node-file node))) + (concat (file-name-base file) ".html"))) + +(setq org-roam-graph-link-builder 'org-roam-custom-link-builder) + +;; Functions (defun ox-hugo/export-all (&optional org-files-root-dir dont-recurse) "Export all Org files (including nested) under ORG-FILES-ROOT-DIR. @@ -45,7 +64,7 @@ Example usage in Emacs Lisp: (ox-hugo/export-all \"~/org\")." (setq cnt (1+ cnt)))) (message "Done!"))))) -;; regular posts +;; Regular posts (setq org-id-locations-file ".orgids" org-src-preserve-indentation t org-cite-export-processors '((latex biblatex) @@ -53,6 +72,6 @@ Example usage in Emacs Lisp: (ox-hugo/export-all \"~/org\")." (html csl) (t csl))) -(ox-hugo/export-all "content-org" t) +(ox-hugo/export-all content-dir t) ;;; export.el ends here diff --git a/flake.nix b/flake.nix index 83adcbc..9ee6d8b 100644 --- a/flake.nix +++ b/flake.nix @@ -29,6 +29,27 @@ just hugo ]; + + texenv = pkgs.texlive.combine { + inherit (pkgs.texlive) + accsupp + collection-basic + collection-fontsextra + collection-fontsrecommended + collection-langenglish + collection-langportuguese + collection-latexextra + collection-mathscience + extsizes + etoolbox + hyphen-portuguese + latexmk + paracol + pdfx + ragged2e + scheme-medium + ; + }; customEmacs = (pkgs.emacsPackagesFor pkgs.emacs-nox).emacsWithPackages (epkgs: with epkgs.melpaPackages; [ @@ -40,21 +61,32 @@ in { # `nix develop .#ci` - # reduce the number of packages to the bare minimum needed for CI + # Reduce the number of packages to the bare minimum needed for CI, + # by removing LaTeX and not using my own Emacs configuration, but + # a custom package with just enough tools to generate the markdown + # for org-roam. ci = pkgs.mkShell { + HUGO_ENVIRONMENT="production"; buildInputs = [ customEmacs ] ++ tooling; }; - # `nix develop` + # `nix develop --impure` + # This is the development shell, meant to be used as an impure + # shell, so no custom Emacs here, just use your global package + # switch back to the CI shell for builds. default = devenv.lib.mkShell { inherit inputs pkgs; modules = [ ({ pkgs, lib, ... }: { - packages = [ customEmacs ] ++ tooling; + packages = [ customEmacs ] ++ [ texenv ] ++ tooling; + + env = { + HUGO_ENVIRONMENT="development"; + }; scripts = { build.exec = "just build"; - publish.exec = "just publish"; + publish.exec = "just public"; run.exec = "just run"; clean.exec = "just clean"; }; diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html index 43a386d..436b504 100644 --- a/layouts/partials/nav.html +++ b/layouts/partials/nav.html @@ -5,7 +5,9 @@ width="128" height="128" /> -

{{ site.Title }}

+
+

{{ site.Title }}

{{ site.Params.subtitle }}

+