Spiega documentation
- Knowledge sharing
- Portfolio
present documentation
work with tech
present this documentation
The documentation is made with mardown and .org files. We need to convert those files into a public documentation. For portfolio creation look at portfolio creation. First of all we need to include the header template in every file with the command [C-t h] which reads header_org.org.
.org files are really versatile and can export to many other formats.
- using LaTeX or postscript
- html
- with different exporting options
- html reveal
- mainly using reveal.js with reveal_custom.css
- html slides
- my custom scripts slide.js and slide.css
slides
Here we use two main libraries
- reveal
- reveal.js example org to reveal
- custom
reveal
There are multiple options to turn org files into reveal slides
create animations
Blender has its own scripting tab but it doesn’t fit in my workflow where I use python REPL and LLMs to test the commands.
Blender has an addon called blender-mcp which allows to access blender methods from outside.
So I need to run the mcp server with transport http:
cd ~/lav/src/blender_twin/deploy/mcp_client/
#bash ./blender_local_client.sh &
cd $HOME/lav/src/blender_twin/deploy/mcp_client/blender_mcp_example_code/mcp/blmcp/
#python3 -m blmcp
uv --directory $HOME/lav/src/blender_twin/deploy/mcp_client/blender_mcp_example_code/mcp run blender-mcp --transport http --port 9191 &
I then need a container as defined in docker_compose.yml to create a bridge between the host and the containers within docker network.
blender-mcp-bridge:image: alpine/socat:latestcontainer_name: blender-mcp-bridgenetwork_mode: "host"command: TCP-LISTEN:19191,fork,reuseaddr TCP:127.0.0.1:9191restart: unless-stopped
I can then work on a script create_animation.py or let an LLM test the blender code without exiting the container.
Mermaid produces svg files which are loaded in blender apart from text which is not recognized. For that we created a script text2svg.py to load each text tag, load a font and create a path around that text. We apply as well some grouping logic so the import in blender is smoother.
cd ~/lav/src/spiega/script/
python3 text2svg.py ~/lav/siti/f/f_twin/arch_diagram.svg
mv output.svg ~/VideoProd/in_prog/graph/arch_dia.svg
File processed: /home/sabeiro/lav/siti/f/f_twin/arch_diagram.svgresults in output.svg
voice over
To speed up voice over we use some tools like
cd ~/VideoProd/in_prog/graph/
#pip install auto-editor
auto-editor
mv output.svg ~/VideoProd/in_prog/graph/arch_dia.svg
exporting
We started with many tools and we tried to minimize the dependencies so over time I removed the dependencies from tools like `markdown` and `pandoc`. I rather use my own header and footer templates In emacs.el we define most of the configurations and load the libraries. In reveal_config.org we have the additional configurations for export.
conversion scripts
export options
We can visualize the current export options with:
[C-c C-e t]
#+TITLE: the title to be shown (default is the buffer name)#+AUTHOR: the author (default taken from user-full-name)#+DATE: a date, an Org timestamp120, or a format string for format-time-string#+EMAIL: his/her email address (default from user-mail-address)#+DESCRIPTION: the page description, e.g. for the XHTML meta tag#+KEYWORDS: the page keywords, e.g. for the XHTML meta tag#+LANGUAGE: language for HTML, e.g. ‘en’ (org-export-default-language)#+TEXT: Some descriptive text to be inserted at the beginning.#+TEXT: Several lines may be given.#+OPTIONS: H:2 num:t toc:t \n:nil @:t ::t |:t ^:t f:t TeX:t ...#+BIND: lisp-var lisp-val, e.g.: org-export-latex-low-levels itemizeYou need to confirm using these, or configure org-export-allow-BIND#+LINK_UP: the ``up'' link of an exported page#+LINK_HOME: the ``home'' link of an exported page#+LATEX_HEADER: extra line(s) for the LaTeX header, like \usepackage{xyz}#+EXPORT_SELECT_TAGS: Tags that select a tree for export#+EXPORT_EXCLUDE_TAGS: Tags that exclude a tree from export#+XSLT: the XSLT stylesheet used by DocBook exporter to generate FO file
The options we have are:
H: set the number of headline levels for exportnum: turn on/off section-numberstoc: turn on/off table of contents, or set level limit (integer)\n: turn on/off line-break-preservation (DOES NOT WORK)@: turn on/off quoted HTML tags:: turn on/off fixed-width sections|: turn on/off tables^: turn on/off TeX-like syntax for sub- and superscripts. Ifyou write "^:{}", a_{b} will be interpreted, butthe simple a_b will be left as it is.-: turn on/off conversion of special strings.f: turn on/off footnotes like this[1].todo: turn on/off inclusion of TODO keywords into exported texttasks: turn on/off inclusion of tasks (TODO items), can be nil to removeall tasks, todo to remove DONE tasks, or list of kwds to keeppri: turn on/off priority cookiestags: turn on/off inclusion of tags, may also be not-in-toc<: turn on/off inclusion of any time/date stamps like DEADLINES*: turn on/off emphasized text (bold, italic, underlined)TeX: turn on/off simple TeX macros in plain textLaTeX: configure export of LaTeX fragments. Default autoskip: turn on/off skipping the text before the first headingauthor: turn on/off inclusion of author name/email into exported fileemail: turn on/off inclusion of author email into exported filecreator: turn on/off inclusion of creator info into exported filetimestamp: turn on/off inclusion creation time into exported filed: turn on/off inclusion of drawers
A typical syntax:
#+OPTIONS: H:2 num:t toc:t \n:nil @:t ::t |:t ^:t f:t TeX:t ...
(org-insert-export-options-template)
export scripts
We use multiple scripts to export, convert and publish the org files into slides, blog articles and pages: org-export.
html compatibility
html css
We can add css style in the page
publish
References ref1, ref2, ref3, ref4, ref5, ref6, ref7
.org files allow the publishing option as defined in emacs.el where I can set a project and the publishing directory. All the .org files in the `base-directory` will be converted into the `publishing-directory` and the pictures will be copied.
(setq org-publish-project-alist
`(("pages"
:base-directory "~/lav/src/spiega/blender_twin/"
:publishing-directory "~/lav/siti/blender_twin/a/"
:publishing-function roam-publication-wrapper
:recursive t
:html-head "<link rel=\"stylesheet\" href=\"static_html//css/org.css\" type=\"text/css\"/>\n"
)
("static"
:base-directory "~/lav/src/spiega/static/blender_twin/"
:base-extension "jpg\\|gif\\|png\\|svg\\|css\\|js"
:recursive t
:publishing-directory "~/lav/siti/blender_twin/"
:publishing-function org-publish-attachment)
("blender_twin" :components ("pages" "static"))))
(org-publish "blender_twin" t)
In case run a webserver
cd ~/lav/siti/blender_twin
python3 -m http.server
thumbnail
Copy default thumbnail if no other is provided
cd ~/lav/siti/f/f_stage
for i in ~/lav/src/spiega/article/* ;
do
titN1=${i%.org}
titN=${titN1##*/}
thumbF=thumb_$titN.png
if [ ! -f $thumbF ]; then
echo $titN
cp thumb_spiega.png $thumbF
fi
done
activation.htmladmin_tool.htmlagent_compensation.htmlagent_instructionagent_naming.htmlantani_concept.htmlantani_infra.htmlantani_integration.htmlantani_kpi.htmlantani_overview.htmlapp.htmlaudio_mixer.htmlbackup_syncbibliography.bibbib.texblindtest.htmlcausality.htmlcloud_provider.htmlcoiler.htmlcommercial.htmlcompany_tools.htmlcompetences.csvcompetences.htmlcontact_channel.htmlcplusplus.htmlcreative_coding.htmlcustomer_lifetime.htmldata_compliance.htmldata_modeling.htmldata_platform.htmldata_storage.htmldata_viz.htmldeployment.htmldocumentation.htmldsp.htmlemacs_llmexperience.htmlfeature_relevance.htmlfilatto_infra.htmlflute.htmlgenerative.htmlgeo_admingeomadi_graph.htmlgeo.htmlgo.htmlindex.htmlinterview.csvjavascript.htmllagged_metrics.htmllernia_feature.htmllernia.htmlllm_providerlocation.htmllogs_proc.htmlmachine_learning.htmlmallink_engine.htmlmanagement_leadmc_amp.htmlmessaging.htmlmiddleware.htmlmidi_hub.htmlmidiRecord.txtmini_hub.htmlml_basics.htmlml_eng.htmlmodel.glbmonte_carlo.htmlmotion.htmlmotorway.htmlmusic_composition.htmlmusic_entropy.htmlmusic_evaluation.htmlneural_networks.htmlnodejs.htmlnode.htmlno_key_board.htmloffer_segmentation.htmlorg_creatoroverview.htmlpersonal_profile.ymlpiezo_buffer.htmlportfolio.ymlpraxis.htmlprediction.htmlprediction_telemetry.htmlproductivity_toolsprogramming_praxis.htmlpython.htmlqueries.htmlredgreen_repeatrestaurant.htmlresume.ymlride.htmlR.htmlroute.htmlroutific.htmlscheduler.htmlsecurity.htmlseries_prod.htmlskills.ymlspark.htmlspatial_data.htmlsql.htmlsynth.htmlteam_compositiontech.htmltech_stack.htmltelemetry_data_quality.htmltelemetry_data_sets.htmltelemetry_forecast.htmltelemetry_prediction.htmltelemetry_quality.htmltelemetry_spatial.htmltesting.htmltest_table.datatext_gen.htmltraffic_motorway.htmltrain_mapping.htmltrain_reference.htmltriangulation.htmlvideo_production.htmlwebserver.htmlwebsites.html
emacs reveal slides
Emacs has many packages to convert .org into html + reveal.js, the most common is org-reveal but I tested org-re-reveal, emacs-reveal, oer-reveal, ox-reveal and they all cause headaches.
I had to pick manually select files from reveal.js and put them in the same order in the folder reveal/ with the same relative paths.
I tend to prefer `org-reveal` which has least dependencies.
TODO export file
I need to figure out how to change filename (add _slide) and how to move it to another directory
script
We use one command to export this file to reveal.js and move it to the final folder.
(org-reveal-export-to-html)
;;(org-re-reveal-export-to-html)
;;; xml-rpc-autoloads.el --- automatically extracted autoloads (do not edit) -*- lexical-binding: t -*-;; Generated by the `loaddefs-generate' function.;; This file is part of GNU Emacs.;;; Code:(provide 'xml-rpc-autoloads);; Local Variables:;; version-control: never;; no-byte-compile: t;; no-update-autoloads: t;; no-native-compile: t;; coding: utf-8-emacs-unix;; End:;;; xml-rpc-autoloads.el ends here;;; writegood-mode-autoloads.el --- automatically extracted autoloads (do not edit) -*- lexical-binding: t -*-;; Generated by the `loaddefs-generate' function.;; This file is part of GNU Emacs.;;; Code:(provide 'writegood-mode-autoloads);; Local Variables:;; version-control: never;; no-byte-compile: t;; no-update-autoloads: t;; no-native-compile: t;; coding: utf-8-emacs-unix;; End:;;; writegood-mode-autoloads.el ends here;;; metaweblog-autoloads.el --- automatically extracted autoloads (do not edit) -*- lexical-binding: t -*-;; Generated by the `loaddefs-generate' function.;; This file is part of GNU Emacs.;;; Code:(provide 'metaweblog-autoloads);; Local Variables:;; version-control: never;; no-byte-compile: t;; no-update-autoloads: t;; no-native-compile: t;; coding: utf-8-emacs-unix;; End:;;; metaweblog-autoloads.el ends here;;; org2blog-autoloads.el --- automatically extracted autoloads (do not edit) -*- lexical-binding: t -*-;; Generated by the `loaddefs-generate' function.;; This file is part of GNU Emacs.;;; Code:(provide 'org2blog-autoloads);; Local Variables:;; version-control: never;; no-byte-compile: t;; no-update-autoloads: t;; no-native-compile: t;; coding: utf-8-emacs-unix;; End:;;; org2blog-autoloads.el ends here
mv documentation_present.html ~/lav/siti/spiega/a/documentation_present_slide.html
#firefox http://localhost/spiega/a/documentation_present_slide.html
TODO oer package
Here we test the oer package
(use-package oer-reveal-publish)
(oer-reveal-setup-submodules t)
(oer-reveal-generate-include-files t)
(oer-reveal-publish-setq-defaults)
(setq oer-reveal-publish-babel-languages '((dot . t) (emacs-lisp . t))
org-publish-project-alist
(list (list "img"
:base-directory "~/lav/siti/blender_twin/"
:base-extension "png"
:publishing-function 'org-publish-attachment
:publishing-directory "~/lav/siti/f/f_twin/")))
| img | :base-directory | ~/lav/siti/blender_twin/ | :base-extension | png | :publishing-function | org-publish-attachment | :publishing-directory | ~/lav/siti/f/f_twin/ |
wrap in tags
(use-package wrap-region)
(wrap-region-add-wrapper "<div class=\"r-stack\">" "</div>")
(lambda (arg) (interactive p) (wrap-region-trigger arg <div class=“r-stack”>))
slide generation from .org and .html
emacs has a lot of publishing options but in some cases I need a really custom design and therefore I strip header and footer from the html and append my own. We have a bash file for that convert_slide.sh. I need as well to convert the mermaid svg graph into a format blender can import which means first of all to convert the plain text into path which is accomplished by text2svg. This script tries as well to rename path ids to allow easier grouping into blender.
cd $HOME/lav/src/spiega/script/
bash ./convert.sh
#bash ./text2svg.sh
### /home/sabeiro/lav/src/spiega/article//documentation_present.org
open graph
We want to create open graph descriptions and
<!-- Open Graph --><meta property="og:title" content="technical blog"><meta property="og:description" content="technical blog, a collection of articles/post written during 17y of career spanning over 3k3 source code files and 2k images"><meta property="og:url" content="https://intertino.it/spiega/a/spiega.html"><meta property="og:image" content="https://intertino.it/f/f_stage/module_library_small.png">
cd ~/lav/siti/f/f_stage/
for i in ~/lav/src/spiega/markdown/*.org;
do
titN1=${i%.org}
titN=${titN1##*/}
cp module_library_small.png thumb_$titN.png
done
references
There are multiple guides with many different outcomes:
convert folder
We mainly use following script to convert the documentation.
(org-publish-current-project)
#rm ~/lav/siti/spiega/a/*
#rm ~/lav/siti/scritti/p/*
cd $HOME/lav/src/spiega
bash ./script/convert.sh
elogio noia /home/sabeiro/lav/siti/scritti//a/elogio_noia.html