v0.8.0: Markdown + Code + Diff rendering module

Add cl-tui.markdown package with:
- Markdown parser: headings, paragraphs, bold, italic, inline-code, links,
  code blocks, blockquotes, lists, thematic breaks
- Syntax highlighting: Lisp, Python, JavaScript, Bash with keyword,
  builtin, comment, number, function coloring
- Diff renderer: colorized unified diff (+/-/@ lines)
- Terminal renderer: ANSI escape sequences via backend-style functions
- 67 tests, 100% passing
- All parser helpers use values returns (not cons) for multiple-value-bind

ASDF: v0.7.0 -> v0.8.0, new markdown module + test suite
This commit is contained in:
Hermes
2026-05-11 18:26:34 +00:00
parent e96c338a57
commit 9648c72b85
5 changed files with 1461 additions and 5 deletions

View File

@@ -0,0 +1,65 @@
;;; markdown-package.lisp — Package definition for cl-tui.markdown
(defpackage :cl-tui.markdown
(:use :cl :fiveam)
(:export
;; Data structures
#:make-md-node
#:md-node-p
#:md-node-text
;; Parsing
#:parse-blocks
#:parse-inline
;; Highlighting
#:*syntax-highlighters*
#:highlight-code
;; Diff
#:classify-diff-line
;; Rendering
#:render-md
#:render-md-node
#:render-markdown
#:render-inline
;; Styles
#:apply-style
#:apply-styles
;; Tests (exported test symbols for ASDF integration)
#:heading-parsing
#:heading-levels
#:heading-with-inline-formatting
#:paragraph-parsing
#:paragraph-multi-line
#:bold-parsing
#:italic-parsing
#:bold-italic-combined
#:inline-code-parsing
#:link-parsing
#:code-block-parsing
#:code-block-unknown-language
#:blockquote-parsing
#:list-item-parsing
#:ordered-list-parsing
#:thematic-break-parsing
#:highlight-lisp-keyword
#:highlight-lisp-builtin
#:highlight-unknown-language
#:highlight-comment
#:classify-diff-added
#:classify-diff-removed
#:classify-diff-hunk
#:classify-diff-context
#:render-heading-output
#:render-paragraph-output
#:render-thematic-break-output
#:render-code-block-output
#:render-diff-block-output
#:markdown-integration
#:render-markdown-string
;; Internal (for testability)
#:classify-line
#:split-string-into-lines
#:find-closing-marker
#:string-prefix-p
#:tokenize-line
#:apply-highlight-token
#:apply-highlight-style))