Skip to content

Commit

Permalink
Merge commit '5112e122f5f5ab100f01897dcdd8ef98fb0b27be' as 'logseq-cu…
Browse files Browse the repository at this point in the history
…stom'
  • Loading branch information
neverkas committed Oct 26, 2023
2 parents 2928447 + 5112e12 commit deef216
Show file tree
Hide file tree
Showing 25 changed files with 1,365 additions and 0 deletions.
55 changes: 55 additions & 0 deletions logseq-custom/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Created by https://www.toptal.com/developers/gitignore/api/emacs
# Edit at https://www.toptal.com/developers/gitignore?templates=emacs

### Emacs ###
# -*- mode: gitignore; -*-
*~
\#*\#
/.emacs.desktop
/.emacs.desktop.lock
*.elc
auto-save-list
tramp
.\#*

# Org-mode
.org-id-locations
*_archive

# flymake-mode
*_flymake.*

# eshell files
/eshell/history
/eshell/lastdir

# elpa packages
/elpa/

# reftex files
*.rel

# AUCTeX auto folder
/auto/

# cask packages
.cask/
dist/

# Flycheck
flycheck_*.el

# server auth directory
/server/

# projectiles files
.projectile

# directory configuration
.dir-locals.el

# network security
/network-security.data


# End of https://www.toptal.com/developers/gitignore/api/emacs
58 changes: 58 additions & 0 deletions logseq-custom/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
include utils/helper.mk
include utils/utils-unix.mk
include utils/utils.mk

DIRECTORIES=$(shell cat directories.cfg | xargs)

LOGSEQ_TEMPLATE_DIR=logseq-template
PAGES_PATH=$(LOGSEQ_TEMPLATE_DIR)/pages

TEMPLATES_PAGE_FILE=pages/Templates.org
LOGSEQ_CONFIG_FILE=logseq/config.edn

##@ Operaciones
# Nota: no utilizamos los directorios como targets, porque dejamos elegir al usuario el nombre del directorio
create-logseq-workflow: ##
@read -p "Ingrese la ruta del nuevo flujo de trabajo: " NEW_WORKFLOW_PATH; \
mkdir --parents $${NEW_WORKFLOW_PATH}; \
@read -p "Ingrese el nombre del nuevo flujo de trabajo: " NEW_WORKFLOW_NAME; \
$(RSYNC) logseq-template/ $${NEW_WORKFLOW_PATH}/

update-config-workflows: $(addsuffix /$(LOGSEQ_CONFIG_FILE).backup,$(DIRECTORIES)) $(addsuffix $(LOGSEQ_CONFIG_FILE),$(DIRECTORIES)) ##
update-templates-workflows: $(addsuffix /$(TEMPLATES_PAGE_FILE),$(DIRECTORIES)) ##

# Ejemplo de como funciona el siguiente target
# prueba: a.txt b.txt
#
# a.txt b.txt: archivo.txt
# cat $< > $@
#

# Nota: dependencia del objetivo update-template-workflows
$(addsuffix /$(TEMPLATES_PAGE_FILE),$(DIRECTORIES)): $(LOGSEQ_TEMPLATE_DIR)/$(TEMPLATES_PAGE_FILE)
@$(WHIPTAIL_CONFIRM_COPY_ACTION) \
&& echo "Copiando $@ .." && cat $< > $@ \
|| echo "Confirmación cancelada"

# - Nota: dependencia del objetivo update-config-workflows
$(addsuffix /$(LOGSEQ_CONFIG_FILE).backup,$(DIRECTORIES)): $(LOGSEQ_TEMPLATE_DIR)/$(LOGSEQ_CONFIG_FILE)
@$(WHIPTAIL_CONFIRM_COPY_ACTION) \
&& mv --verbose $(subst .backup,,$@) $@ \
|| echo "Confirmación cancelada"
#
# Otra alternativa a la acción del target anterior, pero no muy amigable a la vista..
# @echo $@ | sed s/.backup// | xargs --verbose --replace=% mv --verbose % $@

$(addsuffix $(LOGSEQ_CONFIG_FILE),$(DIRECTORIES)): $(LOGSEQ_TEMPLATE_DIR)/$(LOGSEQ_CONFIG_FILE)
@$(WHIPTAIL_CONFIRM_COPY_ACTION) \
&& echo "Copiando $@ .." && cat $< > $@ \
|| echo "Confirmación cancelada"

# Nota: podría tener una lógica similar al template file y config file,
# considero que agrega complejidad innecesaria
copy-pages-to-workflows: ##
@$(WHIPTAIL_CONFIRM_COPY_ACTION) \
&& cat directories.cfg | xargs --verbose --replace=% find % -maxdepth 0 -exec $(RSYNC) $(PAGES_PATH) % \; \
|| echo "Confirmación cancelada"

.PHONY: create-logseq-workflow update-templates-workflows update-config-workflows copy-pages-to-workflows
58 changes: 58 additions & 0 deletions logseq-custom/README.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
* Intro
#+BEGIN_QUOTE
Esta es una plantilla básica de un flujo de trabajo con Logseq + Org Mode,
que iremos actualizando a medida que aprendamos más de cada tecnología y distintas formas de documentar
#+END_QUOTE
* Modo de uso
** Configuración
- en ~directories.cfg~ agregar las rutas absolutas dónde ya habíamos creado un directorio para logseq

#+BEGIN_EXAMPLE
Ejemplo de rutas absolutas que podriamos agregar en directories.cfg

/home/jelou/Documents/git/manu-learning/aprende-clojurescript/logseq-docs
/home/jelou/Documents/git/manu-learning/aprende-clojure/logseq-docs
/home/jelou/Documents/git/manu-learning/aprende-electronica/logseq-docs
/home/jelou/Documents/git/manu-learning/aprende-bash/logseq-docs
#+END_EXAMPLE
** Ejemplo de uso
#+BEGIN_SRC shell
# - comando opcional, por si aún no creamos un directorio de logseq (con el propio programa logseq)
# - creará el directorio en la ruta absoluta que escribamos + la estructura de archivos de éste repositorio
make create-logseq-workflow

# - previamente hará una copia de respaldo del archivo de configuración logseq/config.edn de cada ruta de directories.cfg
# - copiará nuestro archivo de configuración config.edn en cada ruta de directories.cfg
make update-config-workflows

# - copiará nuestro archivo de plantillas pages/Templates.org en cada ruta de directories.cfg
make update-templates-workflows

# - comando opcional, porque podrías sólo copiar la configuración ó sólo los templates
# - copiará todos nuestros archivos .org de pages/ en cada ruta de directories.cfg
make copy-pages-to-workflows
#+END_SRC
* Referencias
** Logseq
*** Referencias Extraoficiales
1. [[https://discuss.logseq.com/tag/lesson][Logseq Lessons (discuss.logseq.com)]]
3. [[https://unofficial-logseq-docs.gitbook.io/unofficial-logseq-docs/intermediate-to-advance-features/dynamic-variables][Dynamic Variables (unofficial-logseq-docs.gitbook.io)]]
2. [[https://unofficial-logseq-docs.gitbook.io/unofficial-logseq-docs/intermediate-to-advance-features/macros][Macros (unofficial-logseq-docs.gitbook.io)]]
*** Issues
1. [[https://github.com/logseq/logseq/issues/3898][Dynamic variables is not recognized properly as property value (github.com/logseq/logseq)]]
*** Videotutoriales
1. [[https://www.youtube.com/watch?v=Xaa3mry9O5I][Logseq customise sidebar menus (by Ed Nico)]]
2. [[https://www.youtube.com/playlist?list=PLwpUQg3DhPIrx0mTZNjg3u5WdYyG0a0m4][Playlist - Logseq (by Tools on Tech)]]
3. [[https://www.youtube.com/playlist?list=PLNnZ7rjaL84J99VHDnjybypqgUTvxQ_v5][Playlist - Logseq Workflows (by CombiningMinds PKM)]]
4. [[https://www.youtube.com/playlist?list=PLHDFMoLGADVv5JGXXtKzvRbgGh5WW8k5M][Playlist - Logseq (by Edenilson L.R)]]
** Emacs + Org Mode
*** Referencias Oficiales
1. [[https://orgmode.org/guide/Properties.html][Properties Syntax (orgmode.org)]]
2. [[https://orgmode.org/manual/Properties-and-Columns.html][Properties and Columns (orgmode.org)]]
3. [[https://orgmode.org/worg/org-contrib/org-collector.html][collect properties into tables with org-collector.el (orgmode.org)]]
*** Referencias Extraoficiales
1. [[https://alphaalgorithms.github.io/2019/05/22/emacs-properties-and-columns/][Orgmode properties and columns (alphaalgorithms.github.io)]]
2. [[https://www.adventuresinwhy.com/post/org-mode-timekeeping/][Org mode timekeeping (adventuresinwhy.com)]]
3. [[https://writequit.org/articles/emacs-org-mode-generate-ids.html][How to use good header id on Emacs org mode (writequit.org)]]
*** Videotutoriales
1. [[https://www.youtube.com/watch?v=ABrv_vnVbkk][The properties (by Rainer Konig)]]
2 changes: 2 additions & 0 deletions logseq-custom/directories.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/home/jelou/Documents/git/manu-learning/aprende-clojurescript/logseq-docs
/home/jelou/Documents/git/manu-learning/aprende-clojure/logseq-docs
Empty file.
Empty file.
Loading

0 comments on commit deef216

Please sign in to comment.