Skip to Content.
Sympa Menu

texmacs-users - Export to HTML

Subject: mailing-list for TeXmacs Users

List archive

Export to HTML


Chronological Thread 
  • From: Pedro López-Adeva Fernández-Layos <address@hidden>
  • To: address@hidden
  • Subject: Export to HTML
  • Date: Tue, 15 Dec 2020 14:40:01 +0100

Hi everyone,


I'm a first time user and I'm trying to move my blog to Texmacs and I need to export to HTML with code listings. The code in particular is Julia and so I don't have syntax highlighting but I don't mind it a lot. The problem is the way it is converted to HTML. More exactly, everything that falls inside the <code> environment is converted as a list of paragraphs with teletype font (ok) but with lot of line interspacing (wrong) and without indentation (very wrong). For example:

This:


struct Factorization
    user_embeddings
    item_embeddings
    item_bias
end


is converted like this:


<p style="margin-top: 0.5em">
      <tt><div style="text-indent: 0em">
        <div class="compact-block">
          <p>
            struct Factorization
          </p>
        </div>
      </div></tt>
</p>

<p>
      <tt><div style="text-indent: 0em">
        <div class="compact-block">
          <p>
            user_embeddings
          </p>
        </div>
      </div></tt>
</p>


etc...


I would prefer to change the conversion and just output the code inside <pre></pre> tags.

I have some basic knowledge of scheme and I had a look at $TEXMACS_PATH/progs/convert/html/tmhtml.scm and in particular the function tmhtml-verbatim where I can more or less see how everything is converted. My attempts at forcing verbatim-pre instead of verbatim-tt to be called have failed because Texmacs gets stuck at 100% CPU (infinite loop?) and I have to kill it. So here are my questions:

- Is there some way of writing my document such that the code listing is exported to HTML as a single block inside <pre> tags?

- How to approach developing and debugging the converter scheme code? How to run tests, set breakpoints, output info, inspect... that kind of things.


Thanks in advance!




Archive powered by MHonArc 2.6.19.

Top of Page