Devlog

These are my daily notes and internal conversations during development. They may be helpful to understand the larger context of decisions that were made, and how I learned and explored while building.

Devlog < 2023 < February < 20

| by date | | thread: collect |

The goal for this tool (`collect`?) is to be able to parse some plain text and find instances of data types, and to then separately “do some stuff” with those collections. So we want to be able to define the structure of a collect-block, create an instance of a collect-block and associate it with group(s) and index, and then have some predefined methods for those collections (sort/reverse, take ‘x’, set intersection, is empty, next/prev property).

One weird part of this is that this tool also has templating considerations, and to some degree has overlap with collate. It would be nice to keep them separate, but not if it’s just going to be super redundant.

Define a map structure:

					^|map name|
^|p param1 param2|
^|e|
				

Define a map entry:

					^|entry map-name|
^|p param1 param2|
^|group posts 0|
^|group posts-tag 0|
^|group january 0|
^|e|
				

Is it okay that this block doesn’t have a “name”? It can only be accessed via its group/index this way. Actually, this isn’t a block, so it *shouldn’t* be accessible by name, this is just data like a string->string dictionary. We need a way to render these maps into plain text though, and I guess this it where it makes sense to stay inside collate.

					^|map-render render-name map-name|
article: ^|u param1|
	^|ui param2|
^|e|
				

Doing collection stuff with a collection:

Is this all we need? Filter a list down to some objects, then generate text from them? This would let us generate anything that is collate compatible, since it’s just text. Starting to think this would actually work better with its own syntax

Define map schemas:

					@def blog-post(title, author, content, [tag])
@def devlog(day, month, year, content, [tag])
				

Instantiate a map schema:

					@new(blog-post)
				
@group(blog-posts, 0)
@group(co, 0)
@group(january-23, 0)
				
@param(title, @{My Post})
@param(author, @{^|u author-jak|})
@param(content, $content)
				
@block-open(content)
This is the content of my blog post.
Indents will be removed(?)
@block-close
				
@end
				

Create a map renderer:

					@renderer(post-page)
@type(blog-post)
@block-open
section: @use(title)
	@use(content)
	@render(tags tag-renderer)
				
@block-close
@end
				
@renderer tag-renderer
@type literal
^|u @#-nav@not-first(-prev)@not-last{-next}@not-first{ @prev{slug}}@not-last{ @next{slug}}|
@end
				

Create a collection/query:

					@collection(recently-published-jan-posts)
	>include(blog-posts)
	>exclude(draft)
	>filter(january-23)
	>last(5)
	>reverse
@end
				
| thread: collect | | by date |