Skip to content

Commit

Permalink
WIP: improve org-roam and note-taking experience (#12)
Browse files Browse the repository at this point in the history
* improve org-roam and note-taking experience
  • Loading branch information
mtrsk authored Jul 7, 2024
1 parent fede48d commit 8d9763f
Show file tree
Hide file tree
Showing 14 changed files with 210 additions and 54 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,6 @@ hugo.linux

# Extra
content/
ltximg
*env*
*zip
2 changes: 2 additions & 0 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ An Org-based personal page and blog.

** Usage

This project uses the

*** Development

#+BEGIN_SRC bash
Expand Down
1 change: 0 additions & 1 deletion blog/notes.org
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

7 changes: 5 additions & 2 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,18 @@ 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"]

[permalinks]
blog = '/blog/:year/:slug/'
notes = '/notes/:year/:slug/'

[author]
name = "Marcos Benevides"

[mediaTypes."application/atom+xml"]
suffixes = ["xml"]
Expand Down
71 changes: 71 additions & 0 deletions content-org/content.org
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#+bibliography: ./refs.bib
#+HUGO_BASE_DIR: ../
#+HUGO_PAIRED_SHORTCODES: alert image
#+OPTIONS: broken-links:mark
#+AUTHOR: Marcos Benevides

* Pages
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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"
14 changes: 14 additions & 0 deletions content-org/refs.bib
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
@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},
year={2023},
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},
Expand Down
23 changes: 21 additions & 2 deletions export.el
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -45,14 +64,14 @@ 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)
(moderncv basic)
(html csl)
(t csl)))

(ox-hugo/export-all "content-org" t)
(ox-hugo/export-all content-dir t)

;;; export.el ends here
40 changes: 36 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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; [
Expand All @@ -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";
};
Expand Down
4 changes: 3 additions & 1 deletion layouts/partials/nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
width="128"
height="128"
/>
<h1>{{ site.Title }}</h1>
<div>
<h1>{{ site.Title }}</h1><p>{{ site.Params.subtitle }}</p>
</div>
<ul>
<li><a href="/">Home</a></li>
<li><a href="/blog">Blog</a></li>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
:PROPERTIES:
:ID: 9a03d556-ded4-4096-9a8c-c2147dee70a5
:ROAM_ALIASES: "Algebra"
:END:
#+TITLE: Algebraic Models for Accounting Systems
#+STARTUP: latexpreview
Expand Down Expand Up @@ -29,7 +30,7 @@ Algebraic Models for Accouting Systems
** The values of an account

Let there be given a set R together with two binary operations on R called
addition and multiplication, denoted in the usual way, such that the following
ddition and multiplication, denoted in the usual way, such that the following
rules hold for all elements $a, b, c \in R$:

\begin{align*}
Expand Down
44 changes: 4 additions & 40 deletions notes/20240619114451-erlang.org
Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,7 @@
Resources:

+ [[https://github.com/oreillymedia/etudes-for-erlang][Etudes for Erlang]]
+ [[https://www.amazon.com.br/Introducing-Erlang-Simon-St-Laurent/dp/1449331769][Introducing Erlang]]

* Chapter 1: Getting Comfortable

** Numbers in Erlang

#+BEGIN_QUOTE
If you need to do calculations on integers using a base other than 10, you can use
Base#Value notation.
#+END_QUOTE

** Seeing Your Bound Variables

~b()~ shows all bound variables in the current erlang shell.

#+BEGIN_SRC shell
> b().
N = 1
Number = 5
#+END_SRC

** Clearing Bound Variables in the Shell

#+BEGIN_SRC shell
> f(N).
> f().
#+END_SRC

* Chapter 2: Functions and Modules

** Defining Modules

#+BEGIN_SRC erlang
-module(drop).
-export([fall_velocity/1, mps_to_mph/1, mps_to_kph/1]).

fall_velocity(Distance) -> math:sqrt(2 * 9.8 * Distance).
mps_to_mph(Mps) -> 2.23693629 * Mps.
mps_to_kph(Mps) -> 3.6 * Mps.
#+END_SRC
+ [cite:@laurent2017]: Notes from [[id:f5e7bb90-792d-406a-8c40-2b072db63a13][Introducing Erlang]]
+ [cite:@armstrong2013]: Notes from [[id:1daea4ea-40bc-406d-8d03-906c7f9ec343][Programming Erlang]]

#+print_bibliography:
7 changes: 7 additions & 0 deletions notes/20240706213027-programming_erlang.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
:PROPERTIES:
:ID: 1daea4ea-40bc-406d-8d03-906c7f9ec343
:ROAM_REFS: "Programming Erlang"
:END:
#+TITLE: Programming Erlang


Loading

0 comments on commit 8d9763f

Please sign in to comment.