组织模式9.1,html代码块导出,如何删除水平线?

时间:2017-09-15 16:04:41

标签: html emacs org-mode

我正在使用org模式进行代码doc,文字编程等。

使用最近的org-mode(版本> = 9.1)我注意到导出的html页面发生了变化:

之前:(组织模式版本< 9.1) enter image description here

现在:(组织模式版本> = 9.1) enter image description here

添加了一些水平线。

问题在于我发现这些额外的行非常难看,而且他们使代码的可读性降低。

我的问题:是否有可能删除这些行以获得旧样式?

要重现:

  • 组织模式:

    • 版本< 9.1没有水平线
    • 版本> =带水平线的9.1
  • 最小test.org组织模式文件:

#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="http://orgmode.org/worg/style/worg.css"/>
#+HTML_HEAD: <style type="text/css">body{ max-width:80%; }</style>

* Some code
#+BEGIN_SRC cpp :eval never
template <typename ELEMENT_TYPE, typename DERIVED>
class Memory_Interface : public StaticInterface_Base<DERIVED>
{
 public:
  using SelfType = Memory_Interface;
  using StaticInterface_Base<DERIVED>::impl;

  // ...
};
#+END_SRC

从emacs使用通常的C-c C-e h o导出html页面

1 个答案:

答案 0 :(得分:3)

查看源代码:ox-html.el我找到了这个可自定义的变量:

(defcustom org-html-keep-old-src nil
  "When non-nil, use <pre class=\"\"> instead of <pre><code class=\"\">."
  :group 'org-export-html
  :package-version '(Org . "9.1")
  :type 'boolean)

当使用 org-mode version&gt; = 9.1 时,如果您仍想像以前一样导出代码块(没有所有这些水平线)解决方案是自定义此变量并设置它 true

(setq org-html-keep-old-src t)