Org-Mode 9.1,html 代码块导出,如何去除水平线?
Org-Mode 9.1, html code block export, how to remove horizontal lines?
我正在使用组织模式来编写代码文档、文学编程等
使用最近的组织模式(版本>=9.1),我注意到导出的 html 页面发生了变化:
之前:(组织模式版本 < 9.1)
现在:(组织模式版本 >= 9.1)
添加了一些水平线。
问题是我发现这些额外的行真的很难看,恕我直言,它们降低了代码的可读性。
我的问题:是否可以删除这些行以获得与旧行一样的样式?
重现:
组织模式:
- 版本 < 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 页面
查看源代码: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 版本 >= 9.1 如果你仍然想像以前一样导出你的代码块(没有所有这些水平线)解决方案是自定义此变量并将其设置为 true:
(setq org-html-keep-old-src t)
我正在使用组织模式来编写代码文档、文学编程等
使用最近的组织模式(版本>=9.1),我注意到导出的 html 页面发生了变化:
之前:(组织模式版本 < 9.1)
现在:(组织模式版本 >= 9.1)
添加了一些水平线。
问题是我发现这些额外的行真的很难看,恕我直言,它们降低了代码的可读性。
我的问题:是否可以删除这些行以获得与旧行一样的样式?
重现:
组织模式:
- 版本 < 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 页面
查看源代码: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 版本 >= 9.1 如果你仍然想像以前一样导出你的代码块(没有所有这些水平线)解决方案是自定义此变量并将其设置为 true:
(setq org-html-keep-old-src t)