🏡 home

Organon: development notes

Table of Contents


Features? Features! (What is working)

Live editing

Organon, Xournal and Emacs in cooperation.
Pictured: Teorema dos Extremos (Weierstrass)

Tikz diagrams and drawings!


Big changes [0/1]

Querying

If done right, querying can generalize a bunch of patterns you find in a static site. For instance, creating a list of posts with a given tag or creating a list of tags.

Syntax

The basic idea here is using affiliated keywords, more specifically backend key/value pairs, and bind expansions providing the query results in the context of its children.

HTML-formatted queries

This is probably how it should be done first.

<query select="meta route title props" from="notes" path="+" tags="blog -draft" limit="10">
<ul>
<query:result>
<li><a href="!(q:route)"><q:title /></a></li>
</query:result>
</ul>
</query>
HTML-block-formatted queries
☝️

This would require some prior changes to org-hs:

  1. Make it possible to handle backend attributes in custom ways.
  2. Interpret Ondim templates inside Org Src Blocks.

Listing blog posts:

* Blog posts

#+attr_query: :select [meta route title props] :from notes :where (in "blog" tags) :limit 10
#+begin_src html :expand t
<ul>
<query>
<li><a href="!(q:route)"><q:title /></a></li>
</query>
</ul>
#+end_src
Org-formatted queries

We could even have a pure Org preprocessor syntax (note: in fact, the expansion would happen during rendering inside Ondim).

☝️

This would require more changes to org-hs:

  1. Expansion syntax for objects (and perhaps elements), e.g. using {{{macros}}} for inlines (and something else for elements).

Creating tables:

#+attr_query: :from notes :where (in "games" tags)
| Name | Time Played | Length | Rating |
|---------------+-----------------------+------------------+------------------|
| {{{q:title}}} | {{{q:m:time-played}}} | {{{q:m:length}}} | {{{q:m:rating}}} |

Or a list:

#+attr_query: :from notes :where (in "games" tags) :where (or (in "moba" tags) (in "crpg" tags))
- {{{note:link}}}

In principle, the output of all examples above could be generated in Org beforehand with lisp, by using src blocks. But the advantage here is that they are updated automatically every time the page renders.

Implementation

References

  • Vulpea

    Vulpea DB schemata:

    (defconst vulpea-db--schemata
    '((notes
    ([(id :not-null :primary-key)
    (path :not-null)
    (level :not-null)
    (title :not-null)
    (properties :not-null)
    aliases
    tags
    meta
    links
    attach]
    (:foreign-key [path] :references files [file] :on-delete :cascade)))
    (meta
    ([(node-id :not-null)
    (prop :not-null)
    (value :not-null)]
    (:foreign-key
    [node-id]
    :references
    nodes [id]
    :on-delete
    :cascade)))
    (cache
    ([(id :not-null :primary-key
    (version :not-null))])))
    "Vulpea db schemata.")

More caching

Refactor the rendering pipeline so that more of the rendering happens when building the model. Expensive things that are not being cached:

  • Code highlighting

Minor features and fixes

  1. [ ]

    Add anchors to backlinks

    When clicking a backlink, the user should be redirected to the precise occurence in the page.


Nunhuma outra página faz referências a esta página.
Made with 📖