From 54ccba54a75cf05b800efac1fa63e9a450a71afa Mon Sep 17 00:00:00 2001
From: Jonas Smedegaard <dr@jones.dk>
Date: Mon, 26 May 2025 15:06:51 +0200
Subject: misc content updates

---
 _filter.qmd | 45 +++++++++++++++++++++++++--------------------
 1 file changed, 25 insertions(+), 20 deletions(-)

(limited to '_filter.qmd')

diff --git a/_filter.qmd b/_filter.qmd
index 051ef18..af38d88 100644
--- a/_filter.qmd
+++ b/_filter.qmd
@@ -7,32 +7,26 @@ either an import extension or a filter for its AST.
 This project chose the latter approach,
 which may initially seem unusual.
 
-*TODO: About the approach of parsing as Markdown and adjust the fallout,
-instead of writing an import extension.*
-
 As described in @sec-improve,
 of priority for this project is to improve existing tools
 rather than implement parallel competing ones,
 despite the latter potentially being easier to do
 or leading to a simpler product.
 Pandoc offers an API specifically for custom-implementing a source format
-(see @sec-pandoc-apis).
-In @sec-pandoc-complex
+described in @sec-pandoc-apis,
+but as pointed out in @sec-pandoc-filter-versatile,
+that interface limits uses of the implementation
+when combined with other extensions,
+notably those provided with the Quarto framework.
 
-*FIXME: tie pieces together, and continue from there
-with the consequence of it was actually tackled.
+Markdown leniently tolerates broken markup (see @sec-spirit) --
+what the parser cannot recognize as markup is simply treated as content.
+This project abuses that feature of Markdown
+to deliberately misparse Semantic Markdown as CommonMark at first,
+and then parse the misparsed content again using the filter API,
+adjusting to the extended syntax.
 
-<!--
-The easiest way to implement a derivation of Markdown
-is likely by writing a Pandoc import filter,
-but that would limit its usefulness with larger frameworks like Quarto.
-Although they do support alternative source languages,
-important features such as citation handling are far better streamlined
-when using the main and best-supported source format.
-This project therefore implements its deviation of Markdown
-by reading the deviant source as if it were Markdown,
-and then applying a filter to adjust the AST after the deliberate misparsing.
--->
+*TODO: More details...*
 
 ## The choice of Lua
 
@@ -65,9 +59,20 @@ than the legacy JSON-based interface.
 
 ## Parsing tasks
 
-*TODO: First parse Namespace blocks, then AnnotationWords*
+The filter traverses the AST several times.
+First it processes PrefixDefinition blocks,
+and then sifts through all inline content
+cleanup up misparsed KeyWords.
+
+For this Minimum Viable Product (see @sec-phase1),
+dropping unneeded block-level elments before processing inline ones
+is slightly simpler and slightly more efficient.
+More importantly, however,
+is that for future planned works (see @sec-rdf)
+information gathered from PrefixDefinition
+is needed for processing KeyWords.
 
 ## Keeping track of enclosure states
 
-*TODO: Details of parsing AnnotationWords
+*TODO: Details of cleaning up KeyWords
 through correlating Pandoc AST with 4 enclosure states*
-- 
cgit v1.2.3

