M Makefile => Makefile +1 -1
@@ 1,6 1,6 @@
.DEFAULT_GOAL := build
-TAGS := $(shell git --git-dir=./fennel/.git tag -l | grep '^[0-9]' | grep -v - | grep -v 0.0.1 | tac)
+TAGS ?= $(shell git --git-dir=./fennel/.git tag -l | grep '^[0-9]' | grep -v - | grep -v 0.0.1 | tac)
TAGDIRS := main $(foreach tag, $(TAGS), v${tag})
# which fennel/$.md files build a tag index
M see.fnl => see.fnl +15 -4
@@ 49,14 49,25 @@
;; and ensure the input textarea and output pre have the same dimensions
;; using a bunch of CSS
+(local fennel-syntax (require :syntax-table))
+
(fn highlight-fennel []
- (let [highlight (require :highlight)
- syntax-table (require :syntax-table)]
+ (let [highlight (require :highlight)]
(set fennel-highlighted.innerHTML
- (highlight.for-html syntax-table fennel-source.value))))
+ (highlight.for-html fennel-syntax fennel-source.value))))
+
+(local lua-syntax (collect [k v (pairs fennel-syntax)]
+ (if v.global? (values k v))))
+
+(each [_ k (ipairs [:and :break :do :else :elseif :end :false :for :function
+ :if :in :local :nil :not :or :repeat :return :then :true
+ :until :while :goto])]
+ (tset lua-syntax k {:special? true}))
(fn highlight-lua []
- (set lua-highlighted.innerHTML lua-source.value))
+ (let [highlight (require :highlight)]
+ (set lua-highlighted.innerHTML
+ (highlight.for-html lua-syntax lua-source.value))))
;; initial run, since there could be something left in the textarea
;; after a page refresh