pandoc README

The project's README from github.com/jgm/pandoc. As one markdown file: README.md.

Pandoc

github
release hackage
release homebrew stackage LTS
package CI
tests license pandoc-discuss on google
groups

The universal markup converter

Pandoc is a Haskell library for converting from one markup format to another, and a command-line tool that uses this library.

It can convert from

It can convert to

Pandoc can also produce PDF output via LaTeX, Groff ms, or HTML.

Pandoc’s enhanced version of Markdown includes syntax for tables, definition lists, metadata blocks, footnotes, citations, math, and much more. See the User’s Manual below under Pandoc’s Markdown.

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. Thus, adding an input or output format requires only adding a reader or writer. Users can also run custom pandoc filters to modify the intermediate AST (see the documentation for filters and Lua filters).

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. Pandoc attempts to preserve the structural elements of a document, but not formatting details such as margin size. And some document elements, such as complex tables, may not fit into pandoc’s simple document model. 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.

Installing

Here’s how to install pandoc.

Documentation

Pandoc’s website contains a full User’s Guide. It is also available here as pandoc-flavored Markdown. The website also contains some examples of the use of pandoc, a limited online demo, and a WebAssembly-based online demo.

Contributing

Pull requests, bug reports, and feature requests are welcome. Please make sure to read the contributor guidelines before opening a new issue.

License

© 2006-2024 John MacFarlane ([email protected]). Released under the GPL, version 2 or greater. This software carries no warranty of any kind. (See COPYRIGHT for full copyright and warranty notices.)

pandoc (jgm/pandoc)

Searching Database…

46.6K ·GitHub
Что это такое?Pandoc — это библиотека на Haskell для конвертации документов из одного формата разметки в другой, а также утилита командной строки, построенная на её основе, — универсальный конвертер разметки.
Это программа для командной строки или библиотека, которую я подключаю в коде?И то и другое. Она поставляется в виде утилиты командной строки для прямых конвертаций и как библиотека на Haskell, которую можно встроить в свои программы.
Устанавливается без сложностей?Да — README просто отправляет на сайт pandoc, где вы выбираете установщик для своей ОС; после этого pandoc запускается из терминала.
Стоит ли ждать, что каждая конвертация пройдёт идеально?Нет. Pandoc сохраняет структуру документа, но не детали оформления вроде размеров полей, а конвертация из форматов, которые выразительнее её Markdown, может быть с потерями.
Можно попробовать в браузере, ничего не устанавливая?Да — на сайте pandoc есть онлайн-демо на WebAssembly (рядом с ним ограниченное классическое демо), так что конвертировать можно прямо в браузере.
Сколько же там форматов?Около 50 входных форматов — включая Word docx, LaTeX, EPUB, блокноты Jupyter, MediaWiki и даже таблицы Excel — а список выходных ещё длиннее; PDF создаётся через LaTeX, Groff ms или HTML.
Чем Pandoc Markdown отличается от обычного Markdown?Его расширенный Markdown поддерживает синтаксис таблиц, списков определений, блоков метаданных, сносок, цитирований, математики и многого другого.
Как одной программе удаётся поддерживать столько форматов?Благодаря модульной архитектуре: ридеры разбирают каждый входной файл во внутреннее абстрактное синтаксическое дерево, а райдеры рендерят это дерево в целевой формат, поэтому для нового формата нужен всего один ридер или райдер.
Можно ли изменить то, что происходит между чтением и записью?Да — можно применять собственные фильтры pandoc, включая Lua-фильтры, которые изменяют промежуточное AST до того, как будет создан выходной формат.
Creator
jgm
Size
71.8 MB
Stars
46.6K
Age
16y
Commits · 90 Days