v0.8.0: tangle to XDG (~/.local/share/cl-tty/), remove stale memex .lisp files
This commit is contained in:
@@ -11,7 +11,7 @@ and diff rendering. Self-contained in ~cl-tty.markdown~ package.
|
||||
|
||||
** Package
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../src/components/markdown-package.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/src/components/markdown-package.lisp
|
||||
(defpackage :cl-tty.markdown
|
||||
(:use :cl)
|
||||
(:export
|
||||
@@ -30,7 +30,7 @@ comment indicating the file's purpose. This block is the first to
|
||||
target ~markdown.lisp~ and thus overwrites any previous content;
|
||||
all subsequent blocks append.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../src/components/markdown.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/src/components/markdown.lisp
|
||||
;;; markdown.lisp — Markdown + Code + Diff rendering for cl-tty
|
||||
|
||||
(in-package :cl-tty.markdown)
|
||||
@@ -51,7 +51,7 @@ symbol and optional keyword arguments for ~children~, ~properties~,
|
||||
~content~, and ~url~. Only non-nil slots are stored, keeping the
|
||||
plist compact.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../src/components/markdown.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/src/components/markdown.lisp
|
||||
(defun make-md-node (type &key children properties content url)
|
||||
(let ((node (list :type type)))
|
||||
(when children (setf (getf node :children) children))
|
||||
@@ -67,7 +67,7 @@ Predicate that checks whether a value is an AST node by verifying it
|
||||
is a list and has a ~:type~ property. This uses plist access which
|
||||
bypasses the need for ~typep~ or class-based dispatch.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../src/components/markdown.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/src/components/markdown.lisp
|
||||
(defun md-node-p (thing)
|
||||
(and (listp thing) (getf thing :type)))
|
||||
#+END_SRC
|
||||
@@ -80,7 +80,7 @@ node tree. The ~:link~ type formats as ~text (url)~; ~:text~ and
|
||||
concatenate their children's text. This is useful for summarisation
|
||||
and testing.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../src/components/markdown.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/src/components/markdown.lisp
|
||||
(defun md-node-text (node)
|
||||
(let ((type (getf node :type)))
|
||||
(cond ((eql type :text) (or (getf node :content) ""))
|
||||
@@ -107,7 +107,7 @@ Handles ~CRLF~, ~LF~, and missing trailing newline uniformly.
|
||||
Returns a ~vector~ for fast indexed access by line number during
|
||||
parsing. Returns an empty vector for ~nil~ input.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../src/components/markdown.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/src/components/markdown.lisp
|
||||
(defun split-string-into-lines (string)
|
||||
(unless string (return-from split-string-into-lines (coerce nil 'vector)))
|
||||
(let ((result nil) (start 0))
|
||||
@@ -130,7 +130,7 @@ markers, unordered/ordered list items, diff headers, diff lines, and
|
||||
fenced code-block starts — and returns a ~(cons type data)~ pair.
|
||||
Everything else is treated as a paragraph continuation line.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../src/components/markdown.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/src/components/markdown.lisp
|
||||
(defun classify-line (line)
|
||||
(cond
|
||||
((string= line "") (cons :blank nil))
|
||||
@@ -188,7 +188,7 @@ Scans for a literal marker string starting from position ~start~,
|
||||
escaping backslash-escaped markers. This is shared by inline
|
||||
emphasis, code span, and link parsing. Returns the position or ~nil~.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../src/components/markdown.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/src/components/markdown.lisp
|
||||
(defun find-closing-marker (text start marker)
|
||||
(let ((marker-len (length marker)) (len (length text)))
|
||||
(loop for j from start to (- len marker-len)
|
||||
@@ -206,7 +206,7 @@ into a single ~:paragraph~ node. Stops at a blank line or any
|
||||
non-paragraph classification. Lines are joined with spaces before
|
||||
inline parsing.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../src/components/markdown.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/src/components/markdown.lisp
|
||||
(defun parse-paragraph (lines start)
|
||||
(let ((text-parts nil) (i start))
|
||||
(loop while (< i (length lines))
|
||||
@@ -233,7 +233,7 @@ Like ~parse-paragraph~ but collects ~:blockquote~ lines and strips the
|
||||
leading ~>~ marker. The collected text is then inline-parsed to
|
||||
support bold, italic, code, and links inside quotes.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../src/components/markdown.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/src/components/markdown.lisp
|
||||
(defun parse-blockquote (lines start)
|
||||
(let ((text-parts nil) (i start))
|
||||
(loop while (< i (length lines))
|
||||
@@ -262,7 +262,7 @@ loose lists), but a blank line followed by a non-list line terminates
|
||||
the list. Returns multiple nodes because each top-level list item
|
||||
becomes its own ~:list-item~ or ~:ordered-item~ node.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../src/components/markdown.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/src/components/markdown.lisp
|
||||
(defun parse-list (lines start)
|
||||
(let ((items nil) (i start))
|
||||
(loop while (< i (length lines))
|
||||
@@ -297,7 +297,7 @@ match in character and be at least as long. The language (if any) is
|
||||
taken from the info string on the opening fence. Produces a single
|
||||
~:code-block~ node.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../src/components/markdown.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/src/components/markdown.lisp
|
||||
(defun parse-code-block (lines start lang)
|
||||
(let ((code-lines nil)
|
||||
(i (1+ start))
|
||||
@@ -333,7 +333,7 @@ single ~:diff-block~ node. The raw lines are preserved in a ~:lines~
|
||||
property for coloured rendering later. Diff blocks are delimited by
|
||||
blank lines.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../src/components/markdown.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/src/components/markdown.lisp
|
||||
(defun parse-diff-block (lines start)
|
||||
(let ((diff-lines nil) (i start))
|
||||
(loop while (< i (length lines))
|
||||
@@ -363,7 +363,7 @@ Handles blank lines, thematic breaks, headings, paragraphs,
|
||||
blockquotes, lists, code blocks, and diff blocks. Returns ~nil~ for
|
||||
~nil~ input.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../src/components/markdown.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/src/components/markdown.lisp
|
||||
(defun parse-blocks (text)
|
||||
(unless text (return-from parse-blocks nil))
|
||||
(let ((lines (split-string-into-lines text)) (nodes nil) (i 0))
|
||||
@@ -416,7 +416,7 @@ triggers inline code; ~[~ triggers links; everything else is
|
||||
accumulated as plain ~:text~ nodes. Consecutive plain text is merged
|
||||
into single nodes for efficiency.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../src/components/markdown.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/src/components/markdown.lisp
|
||||
(defun parse-inline (text)
|
||||
(unless (and text (> (length text) 0)) (return-from parse-inline nil))
|
||||
(let ((nodes nil) (i 0) (len (length text)))
|
||||
@@ -462,7 +462,7 @@ node, otherwise it falls back to single-star ~:italic~. If neither
|
||||
closes, returns ~nil~ to let the caller treat the character as literal
|
||||
text.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../src/components/markdown.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/src/components/markdown.lisp
|
||||
(defun parse-star-emphasis (text i len)
|
||||
(when (>= i len) (return-from parse-star-emphasis (values nil i)))
|
||||
(if (and (< (1+ i) len) (char= (char text (1+ i)) #\*))
|
||||
@@ -486,7 +486,7 @@ opens after whitespace or at the start of text, and single-underscore
|
||||
italic only closes before whitespace or punctuation. This avoids false
|
||||
positives in identifiers like ~foo_bar~.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../src/components/markdown.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/src/components/markdown.lisp
|
||||
(defun parse-underscore-emphasis (text i len)
|
||||
(when (>= i len) (return-from parse-underscore-emphasis (values nil i)))
|
||||
(when (and (> i 0) (not (find (char text (1- i)) " \t\n\r")))
|
||||
@@ -512,7 +512,7 @@ Parses backtick-delimited inline code spans. Supports up to three
|
||||
backticks as delimiters (so single backticks inside double-backtick
|
||||
spans work). The matched pair's backtick count must be equal.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../src/components/markdown.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/src/components/markdown.lisp
|
||||
(defun parse-inline-code (text i len)
|
||||
(when (or (>= i len) (not (char= (char text i) #\`)))
|
||||
(return-from parse-inline-code (values nil i)))
|
||||
@@ -534,7 +534,7 @@ matching via ~find-closing-marker~. The text portion is inline-parsed
|
||||
to support formatting inside link text. Returns ~nil~ if the syntax
|
||||
is incomplete, letting the caller render the ~[~ as literal text.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../src/components/markdown.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/src/components/markdown.lisp
|
||||
(defun parse-link (text i len)
|
||||
(when (or (>= i len) (not (char= (char text i) #\[)))
|
||||
(return-from parse-link (values nil i)))
|
||||
@@ -568,7 +568,7 @@ the caller to fall back to plain rendering. The assoc list uses
|
||||
~string=~ for matching on the language tag, and each entry uses a
|
||||
dotted-pair format ~(\"language\" . plist)~.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../src/components/markdown.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/src/components/markdown.lisp
|
||||
(defun get-highlighter (lang)
|
||||
(cdr (assoc lang
|
||||
'(("lisp" . (:comment (";" "#|" ";;") :string ("\"")
|
||||
@@ -665,7 +665,7 @@ provides the patterns for comment delimiters, string delimiters,
|
||||
keywords, and builtins. Words immediately followed by ~(~ are
|
||||
classified as ~:function~ calls.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../src/components/markdown.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/src/components/markdown.lisp
|
||||
(defun tokenize-line (line highlighter)
|
||||
(let ((tokens nil) (i 0) (len (length line))
|
||||
(comment-chars (getf highlighter :comment))
|
||||
@@ -742,7 +742,7 @@ returns a flat list of ~(token . category)~ pairs with newline
|
||||
separators between lines. Returns ~nil~ for empty input or a single
|
||||
~:plain~ pair if no highlighter is found for the language.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../src/components/markdown.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/src/components/markdown.lisp
|
||||
(defun highlight-code (code language)
|
||||
(unless code (return-from highlight-code nil))
|
||||
(let ((highlighter (get-highlighter (and language (string-downcase language)))))
|
||||
@@ -763,7 +763,7 @@ category. Keywords get colour 33 (yellow), builtins 36 (cyan),
|
||||
functions 34 (blue), comments 2 (dim), strings 32 (green), numbers
|
||||
35 (magenta). Unrecognised categories render as plain text.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../src/components/markdown.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/src/components/markdown.lisp
|
||||
(defun apply-highlight-token (token category)
|
||||
(let ((code (case category
|
||||
(:keyword "33") (:builtin "36")
|
||||
@@ -778,7 +778,7 @@ Coerces an adjustable character vector (accumulated during line
|
||||
rendering) back into a string. This is a thin wrapper that exists
|
||||
for potential future customisation of style application.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../src/components/markdown.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/src/components/markdown.lisp
|
||||
(defun apply-highlight-style (char-vector)
|
||||
(coerce char-vector 'string))
|
||||
#+END_SRC
|
||||
@@ -793,7 +793,7 @@ colourised output.
|
||||
Utility predicate that checks whether ~string~ starts with ~prefix~.
|
||||
Avoids reimplementing this inline in multiple diff classifiers.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../src/components/markdown.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/src/components/markdown.lisp
|
||||
(defun string-prefix-p (prefix string)
|
||||
(and (>= (length string) (length prefix))
|
||||
(string= prefix (subseq string 0 (length prefix)))))
|
||||
@@ -806,7 +806,7 @@ Classifies a single diff line into a semantic category: ~:file-header~
|
||||
(for ~+~ lines), ~:removed~ (for ~-~ lines), or ~:context~ (for
|
||||
everything else). This powers colourised diff rendering.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../src/components/markdown.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/src/components/markdown.lisp
|
||||
(defun classify-diff-line (line)
|
||||
(cond ((string-prefix-p "+++ " line) :file-header)
|
||||
((string-prefix-p "--- " line) :file-header)
|
||||
@@ -830,7 +830,7 @@ string. Supports both keyword (e.g. ~:bold~) and string (e.g.
|
||||
bold, italic, dim, code, link, underline, and the full set of 16
|
||||
terminal colours. Unrecognised styles return the text unchanged.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../src/components/markdown.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/src/components/markdown.lisp
|
||||
(defun apply-style (style text)
|
||||
(let ((code (cond
|
||||
((eql style :bold) "1") ((eql style :italic) "3")
|
||||
@@ -870,7 +870,7 @@ Renders a list of inline child nodes into a single string. Handles
|
||||
types. Links render the text styled as link followed by the URL in
|
||||
parentheses styled as url.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../src/components/markdown.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/src/components/markdown.lisp
|
||||
(defun render-inline (children)
|
||||
(if (null children) ""
|
||||
(with-output-to-string (s)
|
||||
@@ -897,7 +897,7 @@ level determines the number of ~#~ characters (capped at 6) and the
|
||||
colour: level 1 uses bright-cyan, level 2 uses bright-yellow, and
|
||||
deeper levels use bright-white.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../src/components/markdown.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/src/components/markdown.lisp
|
||||
(defun render-heading (node)
|
||||
(let* ((level (or (getf (getf node :properties) :level) 1))
|
||||
(prefix (make-string (min level 6) :initial-element #\#))
|
||||
@@ -912,7 +912,7 @@ deeper levels use bright-white.
|
||||
Renders a paragraph node by inline-rendering its children. The
|
||||
result is a single-element list containing the rendered text.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../src/components/markdown.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/src/components/markdown.lisp
|
||||
(defun render-paragraph (node)
|
||||
(list (render-inline (getf node :children))))
|
||||
#+END_SRC
|
||||
@@ -922,7 +922,7 @@ result is a single-element list containing the rendered text.
|
||||
Renders a blockquote node with a dimmed ~> ~ prefix before the
|
||||
inline-rendered content.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../src/components/markdown.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/src/components/markdown.lisp
|
||||
(defun render-blockquote (node)
|
||||
(list (apply-style :dim (concatenate 'string "> " (render-inline (getf node :children))))))
|
||||
#+END_SRC
|
||||
@@ -934,7 +934,7 @@ highlighter supports it, the code is syntax-highlighted with ANSI
|
||||
colours. Otherwise it is rendered in plain ~:code~ style. A dimmed
|
||||
language header line is shown when a language is present.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../src/components/markdown.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/src/components/markdown.lisp
|
||||
(defun render-code-block (node)
|
||||
(let* ((language (or (getf (getf node :properties) :language) ""))
|
||||
(content (or (getf node :content) ""))
|
||||
@@ -971,7 +971,7 @@ colour: added lines in green (32), removed in red (31), hunk headers
|
||||
in cyan (36), file headers in bold-cyan (1;36), and context lines
|
||||
unstyled.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../src/components/markdown.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/src/components/markdown.lisp
|
||||
(defun render-diff-block (node)
|
||||
(let* ((lines (getf (getf node :properties) :lines)) (result nil))
|
||||
(dolist (line (or lines
|
||||
@@ -993,7 +993,7 @@ unstyled.
|
||||
Renders a thematic break as a dimmed horizontal rule using
|
||||
Unicode box-drawing characters.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../src/components/markdown.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/src/components/markdown.lisp
|
||||
(defun render-thematic-break (node)
|
||||
(declare (ignore node))
|
||||
(list (apply-style :dim "──────────────────────────────────────────────")))
|
||||
@@ -1004,7 +1004,7 @@ Unicode box-drawing characters.
|
||||
Renders a list item node. Ordered items get ~ 1.~ prefix,
|
||||
unordered items get ~ * ~ prefix. The content is inline-rendered.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../src/components/markdown.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/src/components/markdown.lisp
|
||||
(defun render-list-item (node)
|
||||
(list (concatenate 'string
|
||||
(if (eql (getf node :type) :ordered-item) " 1." " * ")
|
||||
@@ -1017,7 +1017,7 @@ Dispatcher function that routes a single AST node to the correct
|
||||
renderer based on its ~:type~. Each type-specific renderer returns a
|
||||
list of strings (multiple lines), which ~render-md~ concatenates.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../src/components/markdown.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/src/components/markdown.lisp
|
||||
(defun render-md-node (node)
|
||||
(let ((type (getf node :type)))
|
||||
(case type
|
||||
@@ -1038,7 +1038,7 @@ Renders a list of AST nodes (the output of ~parse-blocks~) into a
|
||||
flat list of output lines by calling ~render-md-node~ on each node
|
||||
and concatenating the results.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../src/components/markdown.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/src/components/markdown.lisp
|
||||
(defun render-md (nodes)
|
||||
(let ((lines nil))
|
||||
(dolist (node nodes) (setf lines (nconc lines (render-md-node node))))
|
||||
@@ -1051,7 +1051,7 @@ Top-level convenience function that parses a Markdown string and
|
||||
renders it to a single output string with newline-separated lines.
|
||||
Returns an empty string for ~nil~ input.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../src/components/markdown.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/src/components/markdown.lisp
|
||||
(defun render-markdown (text)
|
||||
(unless text (return-from render-markdown ""))
|
||||
(let ((nodes (parse-blocks text)) (parts nil))
|
||||
@@ -1077,7 +1077,7 @@ This block must be first because ~tests/markdown-tests.lisp~ does not
|
||||
exist yet — the tangle script creates it by writing this block's content.
|
||||
All later blocks append.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../tests/markdown-tests.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/tests/markdown-tests.lisp
|
||||
;;; markdown-tests.lisp — Tests for cl-tty.markdown
|
||||
|
||||
(defpackage :cl-tty-markdown-test
|
||||
@@ -1098,7 +1098,7 @@ Edge cases guard against crashes on ~nil~ input, very long lines, blank-only
|
||||
input, and unclosed fenced blocks. These come first because they exercise the
|
||||
defensive gate checks at the top of each parsing function.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../tests/markdown-tests.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/tests/markdown-tests.lisp
|
||||
|
||||
;; ─── Parser edge cases ─────────────────────────────────────────
|
||||
|
||||
@@ -1183,7 +1183,7 @@ defensive gate checks at the top of each parsing function.
|
||||
ATX headings from level 1 through 6, including headings with inline
|
||||
formatting inside the heading text.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../tests/markdown-tests.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/tests/markdown-tests.lisp
|
||||
|
||||
;; ─── Parser tests ─────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -1215,7 +1215,7 @@ formatting inside the heading text.
|
||||
Single-line and multi-line paragraphs. Multi-line paragraphs are joined
|
||||
with spaces before inline parsing.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../tests/markdown-tests.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/tests/markdown-tests.lisp
|
||||
|
||||
(def-test paragraph-parsing ( )
|
||||
(let* ((result (parse-blocks "This is a paragraph.")) (node (first result)))
|
||||
@@ -1231,7 +1231,7 @@ with spaces before inline parsing.
|
||||
Bold, italic, combined bold+italic, inline code, and link parsing. Each
|
||||
test verifies both structure (node types) and content (text/url values).
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../tests/markdown-tests.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/tests/markdown-tests.lisp
|
||||
|
||||
(def-test bold-parsing ( )
|
||||
(let* ((children (parse-inline "hello **world** here"))
|
||||
@@ -1275,7 +1275,7 @@ test verifies both structure (node types) and content (text/url values).
|
||||
Fenced code blocks with and without a language annotation. Verifies the
|
||||
presence/absence of the ~:language~ property on the resulting node.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../tests/markdown-tests.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/tests/markdown-tests.lisp
|
||||
|
||||
(def-test code-block-parsing ( )
|
||||
(let* ((lines '("```lisp" "(defun hello ())" " (print \"hi\")" "```"))
|
||||
@@ -1299,7 +1299,7 @@ Verifies that blockquote markers, unordered list items, ordered list
|
||||
items, and thematic breaks (---) are correctly classified and produce
|
||||
the expected node types.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../tests/markdown-tests.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/tests/markdown-tests.lisp
|
||||
|
||||
(def-test blockquote-parsing ( )
|
||||
(let* ((result (parse-blocks "> This is a quote")) (node (first result)))
|
||||
@@ -1323,7 +1323,7 @@ the expected node types.
|
||||
Tests ~classify-diff-line~ with each diff line variant: added (+),
|
||||
removed (-), hunk header (@@), and context (neither).
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../tests/markdown-tests.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/tests/markdown-tests.lisp
|
||||
|
||||
;; ─── Diff tests ───────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -1346,7 +1346,7 @@ Verifies that ~highlight-code~ returns categorised tokens for Lisp
|
||||
keywords, builtins, comments, and falls back to plain tokens for
|
||||
unknown languages.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../tests/markdown-tests.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/tests/markdown-tests.lisp
|
||||
|
||||
;; ─── Syntax highlighting tests ────────────────────────────────────────────────
|
||||
(def-test highlight-lisp-keyword ( )
|
||||
@@ -1377,7 +1377,7 @@ Verifies that each node type produces output via ~render-md-node~.
|
||||
Heading, paragraph, thematic-break, code-block, and diff-block are
|
||||
all exercised to ensure the render dispatcher routes correctly.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../tests/markdown-tests.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/tests/markdown-tests.lisp
|
||||
|
||||
;; ─── Render tests ─────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -1422,7 +1422,7 @@ A full parse-and-render integration test exercises the pipeline end-to-end.
|
||||
The ~md-node-text~ utility tests verify both simple and nested node
|
||||
traversal.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ../tests/markdown-tests.lisp
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/tests/markdown-tests.lisp
|
||||
|
||||
;; ─── Integration tests ────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
Reference in New Issue
Block a user