我正在尝试为Emacs模式编写一个导出后端。此模式是从ox-latex.el出口商派生出来的。我希望导出程序将所有*.css和*.js文件嵌入到生成的.html文件中。
导出程序运行但在我的函数中没有给出任何输出,因为
assoc(t (("readthedocs" ("css" "htmlize.css" "readtheorg.css") ("js" "readtheorg.js" "jquery.js" "bootstrap.js"))))
调用(来自调试器)返回零。
我在这里错过了什么?
任何帮助,请欣赏:)完整的代码可以在这里找到https://pastebin.com/N475Uk9Z
编辑:
(defconst org-static-html-themes
'(("readthedocs" . (("css" . ("htmlize.css"
"readtheorg.css"))
("js" . ("readtheorg.js"
"jquery.js"
"bootstrap.js"))))))
(defun org-static-html--build-head (info)
"Return information for the <head>..</head> of the HTML output.
INFO is a plist used as a communication channel."
(progn
(debug)
(org-element-normalize-string
(concat
(org-element-normalize-string (plist-get info :html-head))
(org-element-normalize-string (plist-get info :html-head-extra))
(org-element-normalize-string
(mapconcat (lambda (css)
(org-static-html-inline-css
(concat org-static-html-resource-path "/css/" css)))
(cdr (assoc "css"
(assoc
(plist-get info :static-html-theme)
org-static-html-themes))) "\n"))))))这个函数应该得到与相应主题相关联的所有css文件,然后返回,然后在样式标记中连接和包装。
我应该说我使用的是Emacs 27.0.50版本。
发布于 2019-04-03 23:00:01
关联列表只包含一个关联:"readthedocs"和(("css" "htmlize.css" "readtheorg.css") ("js" "readtheorg.js" "jquery.js" "bootstrap.js"))之间的关联。由于没有任何与t相关的内容,所以(assoc t ...)返回nil。
https://stackoverflow.com/questions/55505086
复制相似问题