1
votes

I am using org mode for code doc, literate programming etc.

With recent org-mode (version>=9.1) I have noticed a change in the exported html pages:

Before: (org-mode version < 9.1) enter image description here

Now: (org-mode version >= 9.1) enter image description here

Some horizontal lines have been added.

The problem is that I find these extra lines really ugly and IMHO they make the code less readable.

My questions: is it possible to remove these lines to get a style like the old one?

To reproduce:

  • org mode:

    • version < 9.1 without horizontal lines
    • version >= 9.1 with horizontal lines
  • a minimal test.org org mode file:

#+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

From emacs use the usual C-c C-e h o to export the html page

1
since you are using styles from org website, you will experience this problems. best you can do is to go back on some web archive site to old css version you liked and copy it locally. there is not much you can "fix" in org.rsm
hmm... wait. when did you saw those horizontal lines for the first time? well.... it is for sure styles, but! org by default includes inline default styles. so what you end up is html file with two styles - one default inlined in the header of html file, second included dynamically by you from org website. i don't see any relevant changes in css file on org website. it is likely, that default org-mode style has changed with some update to newer version and is cousing those lines. SIMPLE TEST - export, then remove whole STYLE block from html file leaving only link to org website styles.rsm
you can disable including default org-mode styles using :html-head-include-default-style nil in your org project definition.rsm
@rsm I finally found the solution to my problem and its origin was not the CSS file as we initially believed but a change in ox-html.el file in org-mode v9.1. Anyway, I want to thank you for your initial suggestions. Now like the problem is solved and for a better clarity maybe you can remove your previous comments related to the css file? (this is what I have done for my comments).Picaud Vincent
I'd say that unless the comments are flat out wrong, you should leave them alone. In this instance, it's a valid avenue of investigation, so even though they were not the answer to the question, they could be the answer to a similar question.NickD

1 Answers

3
votes

Looking the source code: ox-html.el I found this customizable variable:

(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)

When using org-mode version >= 9.1 if you still want to export your code block like before (without all these horizontal lines) the solution is to customize this variable and set it to true:

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