From bec0e0ae5c994de0a7f5c86fb66f70abe3e220bf Mon Sep 17 00:00:00 2001 From: Thelonius Kort Date: Mon, 23 Jan 2023 14:30:25 +0100 Subject: [PATCH] Add exporting directly to a file --- lib/outlook/internal_tree.ex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/outlook/internal_tree.ex b/lib/outlook/internal_tree.ex index a182dba..9c83e0e 100644 --- a/lib/outlook/internal_tree.ex +++ b/lib/outlook/internal_tree.ex @@ -56,8 +56,10 @@ defmodule Outlook.InternalTree do end def legacy_export(tree, translation) do - Translation.render_translation(tree, translation) + content= Translation.render_translation(tree, translation) |> garnish(%{tunits: %{class: "ttrans", "data-ttrans-status": fn n -> Map.get(n, :status) end}}) |> Html.render_doc + IO.puts "writing export.html to #{File.cwd!}" + File.write("export.html", content) end end