10:38 AM
Starship v1 is nearing completion. I've decided on a consistent format for drafts:
Drafts will be packaged as html snippets. Meta-information like title, tags, date, etc. are contained in a single html comment at the top of the draft file. For example:
<!-- :title Hello, World! :tag pre-release :tag updates -->
<p>Testing out Starship draft previews!</p>
Draft body content is pretty much exactly as it would appear embedded into the final pages. This packaging form also helps with summary generation; summary cutoff is noted with an [[ENDSUM]] object. Dots and readmore link are automatically generated.
For example, this draft:
...draft file. For example:</p> [[ENDSUM]] <pre class="code">...
Unfortunately, because of this, draft files can't be individually rendered raw. preview.py parses a draft file, outputting a page with both the post's summarized view and full render. This is fine though.
Roadmap
Now that draft parsing and rendering is working, publishing will be easy, especially without chunking or any of the other fancy stuff. (In fact, the draft collation script uses the same collect() system as publishing/appending will in the future, but just with one single post.)
Project structure so far:
- index.html
- style.css
- pages/ (empty)
-
build/
- preview.py
- publish.py
-
drafts/
- pre-release.html
- thoughts.html
- ...
- .artifacts/ (empty)
-
source/
- collect.py
- draft.py
- template.html
- head.html
- title.cfg
To avoid splitting and re-parsing the full rendered HTML anytime a post is published to main, .artifacts will store concatenated - but not collected - post summaries which themselves can be easily extended or stitched into index.
Also, debating whether or not to store artifacts of every processed draft & draft summary. If I do end up implementing some of my other potential ideas (like a binlifting-type page navigator) I will need to recollect all previous post artifacts to rebuild statically.
Either way, artifacts will contain for now an index.html artifact, which will be front-concatenated anytime a new post is added.
In the future, for a buffered system, artifacts will store two portions: one for the currently building sector, and one for the last built sector: in an n-length sector system, each old/ page will contain n posts, and index will contain n + overflow posts. Similar system will probably be implemented for categories.
Anyway, this will hopefully be the last draft I have to manually publish!