Permalink
Browse files

Revert "sync with 3bmd/extensible branch"

This reverts commit eb1e810.
  • Loading branch information...
1 parent ff39511 commit 7b531a506677f75775cf7cd185d75315adf7a13c @archimag archimag committed Apr 29, 2011
Showing with 23 additions and 37 deletions.
  1. +23 −37 src/markup.lisp
View
@@ -6,11 +6,8 @@
(defvar *cliki2-compiled-grammar* nil)
-(defvar *enable-cliki-grammar* nil)
-
(defmacro with-cliki2-rules (&body body)
- `(let ((*rules* *cliki2-rules*)
- (*enable-cliki-grammar* t))
+ `(let ((*rules* *cliki2-rules*))
,@body))
(defun recompile-cliki2-grammar ()
@@ -47,9 +44,9 @@
(define-rule article-link (and (and (? #\\) "_(") (+ (and (! #\)) character)) #\))
(:destructure (start article end)
(declare (ignore start end))
- (cons :article-link (cliki2:normalize-name (text article)))))
+ (cons :article-link (cliki2:normalize-name (concat article)))))
-(defmethod 3bmd-ext:print-tagged-element ((tag (eql :article-link)) stream title)
+(defmethod 3bmd:print-tagged-element ((tag (eql :article-link)) stream title)
(write-string (cliki2.view:article-link
(list :title title
:new (null (cliki2::article-with-downcase-title (string-downcase title)))
@@ -61,9 +58,9 @@
(define-rule person-link (and "_P(" (+ (and (! #\)) character)) #\))
(:destructure (start name end)
(declare (ignore start end))
- (cons :person-link (cliki2:normalize-name (text name)))))
+ (cons :person-link (cliki2:normalize-name (concat name)))))
-(defmethod 3bmd-ext:print-tagged-element ((tag (eql :person-link)) stream name)
+(defmethod 3bmd:print-tagged-element ((tag (eql :person-link)) stream name)
(write-string (cliki2.view:person-link
(list :name name
:href (restas:genurl 'cliki2:view-person :name name)))
@@ -74,9 +71,9 @@
(define-rule hyperspec-link (and "_H(" (+ (and (! #\)) character)) #\))
(:destructure (start symbol end)
(declare (ignore start end))
- (cons :hyperspec-link (text symbol))))
+ (cons :hyperspec-link (concat symbol))))
-(defmethod 3bmd-ext:print-tagged-element ((tag (eql :hyperspec-link)) stream symbol)
+(defmethod 3bmd:print-tagged-element ((tag (eql :hyperspec-link)) stream symbol)
(write-string (cliki2.view:hyperspec-link
(list :symbol symbol
:href (clhs-lookup:spec-lookup symbol)))
@@ -87,7 +84,7 @@
(define-rule category-link (and (and (? #\\) "*(") (+ (and (! #\)) character)) #\))
(:destructure (start category end)
(declare (ignore start end))
- (cons :article-link (cliki2:normalize-name (text category)))))
+ (cons :article-link (cliki2:normalize-name (concat category)))))
;;;; code-block
@@ -101,9 +98,9 @@
"</code>")
(:destructure (start w1 code w2 end)
(declare (ignore start w1 w2 end))
- (cons :lisp-code-block (text code))))
+ (cons :lisp-code-block (concat code))))
-(defmethod 3bmd-ext:print-tagged-element ((tag (eql :lisp-code-block)) stream code)
+(defmethod 3bmd:print-tagged-element ((tag (eql :lisp-code-block)) stream code)
(write-string (cliki2.view:code-block
(list :code (colorize::html-colorization :common-lisp code)))
stream))
@@ -115,7 +112,7 @@
(define-rule category-name (and (? #\") (+ (category-char-p character)) (? #\"))
(:lambda (list)
- (text (second list))))
+ (concat (second list))))
(define-rule category-list (and (and (? #\\) "_/(")
category-name
@@ -133,7 +130,7 @@
(sanitize:with-clean-fragment (fragment
(with-output-to-string (s)
(let ((3bmd::*references* (make-hash-table)))
- (3bmd-ext:print-element (parse '3bmd-grammar::block
+ (3bmd::print-element (parse '3bmd-grammar::block
(cliki2::article-content-head article)
:junk-allowed t)
s)))
@@ -148,7 +145,7 @@
(finish))
(t (write-string text out))))))))
-(defmethod 3bmd-ext:print-tagged-element ((tag (eql :cliki2-category-list)) stream category)
+(defmethod 3bmd:print-tagged-element ((tag (eql :cliki2-category-list)) stream category)
(write-string (cliki2.view:category-content
(list :items
(iter (for article in (sort (copy-list (cliki2::articles-with-category category))
@@ -166,30 +163,19 @@
(define-rule package-link (and ":(package" (+ (or #\Tab #\Space #\Newline #\Return)) "\"" (+ (and (! #\") character)) "\")")
(:destructure (start w1 quote link end)
(declare (ignore start w1 quote end))
- (cons :package-link (text link))))
+ (cons :package-link (concat link))))
-(defmethod 3bmd-ext:print-tagged-element ((tag (eql :package-link)) stream link)
+(defmethod 3bmd:print-tagged-element ((tag (eql :package-link)) stream link)
(write-string (cliki2.view:package-link (list :href link))
stream))
;;;; cliki2 markup extensions
-(with-cliki2-rules
- (3bmd-ext:define-extension-inline *enable-cliki-grammar* inline-extensions
- (or article-link
- person-link
- hyperspec-link
- category-link
- code-block
- category-list
- package-link)
- (:before string)))
-
-;; (define-rule 3bmd-grammar:inline-extensions
-;; (or article-link
-;; person-link
-;; hyperspec-link
-;; category-link
-;; code-block
-;; category-list
-;; package-link))
+(define-rule 3bmd-grammar:inline-extensions
+ (or article-link
+ person-link
+ hyperspec-link
+ category-link
+ code-block
+ category-list
+ package-link))

0 comments on commit 7b531a5

Please sign in to comment.