Introduction to MWB Minor Mode
Effective STL 笔记 -- Item 6 ~ 7: Container and Object Pointer

How to omit h1 title heading in HTML export

tubo posted @ 2014年9月03日 00:11 in 未分类 , 311 阅读
How to omit h1 title heading in HTML export

Introduce how to omit h1 title in the exported html.

Sometimes it would be better to omit h1 title in exported HTML, and there is an email discussing it. It is suggested to add customized filters to do this:

(defun rasmus/org-html-ignore-title-if-present (string backend info)
  "Strip title if it's already there for html."
  (when (and (org-export-derived-backend-p backend 'html)
             (string-match "h1 class=\"title\"" string))
    (replace-regexp-in-string "<h1 class=\"title\">.*?</h1>" "" string)))

(add-to-list 'org-export-filter-final-output-functions
             'rasmus/org-html-ignore-title-if-present)

That's it!


Author: YangYingchao

登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter