1
0
mirror of https://tildegit.org/sbgodin/HtmGem.git synced 2023-08-25 13:53:12 +02:00
HtmGem/tests/cli/translate_to_gemtext.php

12 lines
359 B
PHP
Raw Normal View History

2021-03-24 10:53:12 +01:00
<?php if (empty(@$_SERVER['SHELL']) or count($argv)<2) die();
$fileName = $argv[1];
require_once dirname(__FILE__)."/../../lib-htmgem.inc.php";
require_once dirname(__FILE__)."/../../lib-io.inc.php";
2021-03-24 10:53:12 +01:00
$text = file_get_contents($fileName);
\htmgem\io\convertToUTF8($text);
2021-03-25 19:08:57 +01:00
$gt_gemtext = new \htmgem\GemtextTranslate_gemtext($text);
2021-03-24 10:53:12 +01:00
echo strval($gt_gemtext);