1

As the title suggests, this is a follow up of this question. I'm following Michal's answer, I have created the same structure suggested in the answer, created the .make4ht file and the same hello.texfile, but when I run make4ht -um publish hello.tex I recive the following message in terminal

[STATUS]  make4ht: Conversion started
[STATUS]  make4ht: Input file: hello.tex
removing maketitle
sh: 1: tidy: not found
...exmf-dist/scripts/make4ht/filters/make4ht-staticsite.lua:86: attempt to index a nil value (local 'head')

and the result is an empty date-hello.html file.

Since I'm completely new with all of that I'm not sure what I'm doing wrong.

Luis Turcio
  • 2,757
  • 3
    it is better to make your question self contained. Do it ask people to chase links trying to find what your hello.tex file is. Adding the links to the earlier questions is good. But the question itself should contain all material needed to run it. – Nasser Mar 29 '22 at 00:54
  • @Nasser Thanks for the suggestion! I’ll add the necessary information in a moment. – Luis Turcio Mar 29 '22 at 02:37
  • You need to eiher disable the tid extension, or install HTML Tidy. – michal.h21 Mar 29 '22 at 06:09

1 Answers1

2

It is hard to tell without a MWE, but if you use exact code from the question you linked, I would say that the problem is a bug in the tidy extension for make4ht. It didn't check if the string returned by the tidy command is not empty.

We can see that the problem is with tidy from this message:

sh: 1: tidy: not found
...exmf-dist/scripts/make4ht/filters/make4ht-staticsite.lua:86: attempt to index a nil value (local 'head')

You can either install Tidy, or disable it in the .make4ht configuration file:

local outdir = os.getenv "kodymirus_root" or "out"
local domfilter = require "make4ht-domfilter"

-- remove the \maketitle environment from the HTML file, title will be inserted in the template local domprocess = domfilter{function(dom) local maketitles = dom:query_selector(".maketitle") for _, el in ipairs(maketitles) do print "removing maketitle" el:remove_node() end return dom end}

filter_settings "staticsite" { site_root = outdir, map = { [".css$"] = "css/" }, header = { layout="post", date = function(parameters) return os.date("!%Y-%m-%d %T", parameters.time) end } }

Make:enable_extension "common_domfilters" if mode=="draft" then Make:htlatex {} elseif mode=="publish" then -- Make:htlatex {} Make:match("html$", domprocess) -- Make:enable_extension "tidy" Make:htlatex {} else Make:htlatex {} Make:htlatex {} Make:htlatex {} end

If you are interested in blogging with TeX4ht, see also this blog that is generated from LaTeX sources automatically by Github. Here are the sources.

michal.h21
  • 50,697