diff options
| author | Jakob L. Kreuze <zerodaysfordays@sdf.lonestar.org> | 2019-05-01 11:49:27 -0400 |
|---|---|---|
| committer | Jakob L. Kreuze <zerodaysfordays@sdf.lonestar.org> | 2019-05-01 11:49:27 -0400 |
| commit | 48120565a3793e777d9370578076c3cbe4953b4b (patch) | |
| tree | 6778fddb1f5a8d91e57a5ddfdb3847ade663290e | |
| parent | fce006aa463b0ff3f4471e11354a85e79d6fc658 (diff) | |
Remove replacement for 'ox-html-src-block
| -rw-r--r-- | ox-haunt.el | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/ox-haunt.el b/ox-haunt.el index 8cbb609..b09ea94 100644 --- a/ox-haunt.el +++ b/ox-haunt.el @@ -42,7 +42,6 @@ (org-open-file (ox-haunt-export-to-html nil s v b))))))) :translate-alist '((link . ox-haunt-link) - (src-block . ox-haunt-src-block) (template . ox-haunt-template)) :options-alist '((:tags "TAGS" nil nil) @@ -74,50 +73,6 @@ valid executable." (unless (file-directory-p dest-path) (user-error "The HAUNT_BASE_DIR property must name a directory"))) -;; From the W3 HTML 5.2 Specification: -;; -;; "Authors who wish to mark <code> elements with the language used, e.g., so -;; that syntax highlighting scripts can use the right rules, can use the class -;; attribute, e.g., by adding a class prefixed with "language-" to the element." -(defun ox-haunt-src-block (src-block _contents info) - "Transcode a SRC-BLOCK element from Org to HTML." - (if (org-export-read-attribute :attr_html src-block :textarea) - (org-html--textarea-block src-block) - (let* ((lang (org-element-property :language src-block)) - (code (org-html-format-code src-block info)) - (label (let ((lbl (and (org-element-property :name src-block) - (org-export-get-reference src-block info)))) - (if lbl (format " id=\"%s\"" lbl) ""))) - (klipsify (and (plist-get info :html-klipsify-src) - (member lang '("javascript" "js" - "ruby" "scheme" "clojure" "php" "html"))))) - (if (not lang) (format "<pre><code class=\"example\"%s>\n%s</code></pre>" label code) - (format "<div class=\"org-src-container\">\n%s%s\n</div>" - ;; Build caption. - (let ((caption (org-export-get-caption src-block))) - (if (not caption) "" - (let ((listing-number - (format - "<span class=\"listing-number\">%s </span>" - (format - (org-html--translate "Listing %d:" info) - (org-export-get-ordinal - src-block info nil #'org-html--has-caption-p))))) - (format "<label class=\"org-src-name\">%s%s</label>" - listing-number - (org-trim (org-export-data caption info)))))) - ;; Contents. - (if klipsify - (format "<pre><code class=\"src language-%s\"%s%s>%s</code></pre>" - lang - label - (if (string= lang "html") - " data-editor-type=\"html\"" - "") - code) - (format "<pre><code class=\"src language-%s\"%s>%s</code></pre>" - lang label code))))))) - (defun ox-haunt-link (link desc info) "Transcode a LINK object from Org to HTML." (let* ((orig-path (org-element-property :path link)) |