-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocx_tei.php
More file actions
38 lines (33 loc) · 1.01 KB
/
docx_tei.php
File metadata and controls
38 lines (33 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php declare(strict_types=1);
include_once(__DIR__ . '/vendor/autoload.php');
use Psr\Log\LogLevel;
use Oeuvres\Kit\{Cliglob, Filesys, Log, Parse, Xt};
use Oeuvres\Kit\Logger\{LoggerCli};
use Oeuvres\Teinte\Format\{Docx, Tei};
class Docx2Tei extends Cliglob {
private static Docx $docx;
/** work */
static public function cli()
{
// requested destination extension
self::put('dst_ext', ".xml");
// doc for help
self::put('dst_ext', ".xml");
self::put('src_format', "DOCX");
self::put('dst_format', "XML/TEI");
self::$docx = new Docx();
Log::setLogger(new LoggerCli(LogLevel::DEBUG));
self::glob([__CLASS__, 'export']);
}
static function export($src_file, $dst_file)
{
Log::info($src_file . " > " . $dst_file);
$pars = [];
$pars['template.xml'] = self::get('t', null);
self::$docx->open($src_file);
self::$docx->teiURI($dst_file);
}
}
if (Cliglob::isCli()) {
Docx2Tei::cli();
}