Цифровой садик - приветственная

Цифровой садик - приветственная | Полный список всего, что тут есть | RSS | Подписаться через follow.it

19.03.2023

pandoc

Вытащила то, до чего давно не доходили руки, по случаю занятных ссылок.

Полезная штука для конвертирования разной разметки.

Основное, что по мне надо знать про pandoc, чтоб не ждать слишком много:

Pandoc has a modular design: it consists of a set of readers, which parse text in a given format and produce a native representation of the document (an abstract syntax tree or AST), and a set of writers, which convert this native representation into a target format… Because pandoc’s intermediate representation of a document is less expressive than many of the formats it converts between, one should not expect perfect conversions between every format and every other… While conversions from pandoc’s Markdown to all formats aspire to be perfect, conversions from formats more expressive than pandoc’s Markdown can be expected to be lossy.

pandoc -o имя_выходного_файла имя_входного_файла

If no input-file is specified, input is read from stdin. Otherwise, the input-files are concatenated (with a blank line between each) and used as input. Output goes to stdout by default (though output to stdout is disabled for the odt, docx, epub, and epub3 output formats). For output to a file, use the -o option.

pandoc -f html -t org --no-wrap filename.html | xclip

Сконвертировали, получили в буфер обмена вполне приличный org, c частью непереваренной разметки в блоках #+BEGIN_HTML … #+END_HTML )

xargs -I'{}' -a Contents.txt -d '' pandoc -t latex -o '{}'.tex '{}'

Cкормить харгсу список файлов для конвертирования в latex. Это я с пенфлипа уходила, похоже.

pandoc --smart --wrap preserve --toc --toc-depth=6 --self-contained -f latex -t html $file когда пыталаcь превращать латеховые странички в блог. Слишком бедно, как я уже написала выше.

–smart
преобразует тире, кавычки, многоточия (pandoc will produce typographically correct output, converting straight quotes to curly quotes, — to em-dashes, – to en-dashes, and … to ellipses. Nonbreaking spaces are inserted after certain abbreviations, such as "Mr." Note: if your LaTeX template or any included header file call for the csquotes package, pandoc will detect this automatically and use \enquote{...} for quoted text.)
–wrap=none
не разбивать строки в исходнике.
(no term)
https://github.com/mittelmark/pantcl - конвертилка много чего, в том числе с участием pandoc. Document conversion with Tcl based filters using pandoc or Tcl only.

Если у вас есть мысли, комментарии, предложения или отклики по поводу этой страницы или этого цифрового сада в целом, напишите мне сообщение на agnessa@agnessa.pp.ru. Мне ооочень интересно!

Задонатить.


An IndieWeb Webring 🕸💍