Skip to Content.
Sympa Menu

texmacs-users - Re: Export to HTML

Subject: mailing-list for TeXmacs Users

List archive

Re: Export to HTML


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

Thank you, I followed your advice: http://forum.texmacs.cn/t/export-code-listing-to-html/303

Hello,

I recommend you to cross-post this question on the official forum:
http://forum.texmacs.cn/

It is easier to read and discuss long contents and codes there (it supports
markdown, so you can highlight your codes).

Best,
Frank

于 December 15, 2020 1:40:01 PM UTC, "Pedro López-Adeva Fernández-Layos"
<address@hidden> 写到:
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