aboutsummaryrefslogtreecommitdiff
path: root/_filter.qmd
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2025-05-26 15:06:51 +0200
committerJonas Smedegaard <dr@jones.dk>2025-05-26 15:06:51 +0200
commit54ccba54a75cf05b800efac1fa63e9a450a71afa (patch)
tree7d3d35159deabbd760251e247db1f5cd16cd8d3e /_filter.qmd
parent0ebd5db4526e1112a2d2752b23ca1af8fca83af9 (diff)
misc content updates
Diffstat (limited to '_filter.qmd')
-rw-r--r--_filter.qmd45
1 files changed, 25 insertions, 20 deletions
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*