2013-04-15 05:41:33 +02:00
|
|
|
Contributing to pandoc
|
|
|
|
======================
|
|
|
|
|
2020-11-27 18:13:02 +01:00
|
|
|
Welcome to pandoc! Very soon after its beginnings in 2006, pandoc
|
|
|
|
has been influenced, improved, and modified, by users, devs, and
|
|
|
|
newcomers alike. The project thrives on its active community. It is
|
|
|
|
great to have you here.
|
|
|
|
|
|
|
|
How can I help?
|
|
|
|
---------------
|
|
|
|
|
|
|
|
There are many ways in which you can support pandoc. Here are a few
|
|
|
|
ideas:
|
|
|
|
|
|
|
|
* Participate in online discussions. The [pandoc-discuss] mailing
|
|
|
|
list is a good place for this. This gives valuable input and
|
|
|
|
makes it easier to improve the program.
|
|
|
|
|
|
|
|
* Help with questions. Every request that is answered by the wider
|
|
|
|
community frees time for programming contributors. This will
|
|
|
|
speed up development of new features and issue fixes. Don't
|
|
|
|
underestimate your knowledge, please share it!
|
|
|
|
|
|
|
|
Good places to help are the [pandoc-discuss] mailing list, Q/A
|
|
|
|
sites like StackOverflow, community forums (e.g.
|
|
|
|
[RStudio][RStudio Community], [Zettlr][Zettlr Forum]), and, for
|
|
|
|
technical questions, the GitHub [issue tracker].
|
|
|
|
|
|
|
|
* Write or improve documentation. If you ran into a problem which
|
|
|
|
took more time to figure out than expected, please consider to
|
|
|
|
save other users from the same experience. People writing the
|
2020-12-18 18:59:19 +01:00
|
|
|
documentation tend to lack an outside view, so please help
|
2020-11-27 18:13:02 +01:00
|
|
|
provide one. Good documentation is both difficult and extremely
|
|
|
|
important.
|
|
|
|
|
|
|
|
The official docs are not the only place for documentation.
|
|
|
|
Pandoc also has a [Wiki][pandoc wiki]. Private blogs can serve
|
|
|
|
as documentation just as the official manual can.
|
|
|
|
|
|
|
|
* Contribute code. No matter whether it's a small fix in a format
|
|
|
|
template or a huge lump of Haskell code: help is welcome. It's
|
|
|
|
usually a good idea to talk about the plans early, as this can
|
|
|
|
prevent unnecessary work. See below for more information.
|
|
|
|
|
|
|
|
* Last but not least: consider funding the development and
|
|
|
|
maintenance of pandoc financially. You can find sponsor buttons
|
|
|
|
on the [pandoc website] and the [GitHub repository][GitHub
|
|
|
|
repo].
|
|
|
|
|
|
|
|
A rich ecosystem of libraries, editors, filters, and templates has
|
|
|
|
developed around pandoc; conversely, pandoc builds and depends on a
|
|
|
|
large number of libraries. Contributing to any of these projects is
|
|
|
|
another way that can help to ensure stability, and to keep pushing
|
|
|
|
the boundaries of what is possible with pandoc.
|
|
|
|
|
|
|
|
[RStudio Community]: https://community.rstudio.com/
|
|
|
|
[Zettlr Forum]: https://forum.zettlr.com/
|
|
|
|
[pandoc wiki]: https://github.com/jgm/pandoc/wiki
|
|
|
|
[pandoc website]: https://pandoc.org
|
|
|
|
[GitHub repo]: https://github.com/jgm/pandoc
|
|
|
|
|
2017-02-26 00:12:08 +01:00
|
|
|
Have a question?
|
|
|
|
----------------
|
|
|
|
|
|
|
|
Ask on [pandoc-discuss].
|
|
|
|
|
|
|
|
|
2013-04-15 05:41:33 +02:00
|
|
|
Found a bug?
|
|
|
|
------------
|
|
|
|
|
2020-08-01 19:19:32 +02:00
|
|
|
Bug reports are welcome! Please report all bugs on pandoc's GitHub
|
2013-04-15 05:41:33 +02:00
|
|
|
[issue tracker].
|
|
|
|
|
2017-10-27 02:55:16 +02:00
|
|
|
Before you submit a bug report, search the [open issues] *and* [closed issues]
|
|
|
|
to make sure the issue hasn't come up before. Also, check the [User's Guide] and
|
|
|
|
[FAQs] for anything relevant.
|
2013-04-15 05:41:33 +02:00
|
|
|
|
2020-07-02 17:51:38 +02:00
|
|
|
Make sure you can reproduce the bug with the [latest released
|
|
|
|
version] of pandoc---or, even better, the development version,
|
|
|
|
since the bug may have been fixed since the last release.
|
|
|
|
[Nightly builds] are available, so you don't need to compile
|
2020-08-01 19:19:32 +02:00
|
|
|
from source to test against the development version.
|
2020-07-02 17:51:38 +02:00
|
|
|
(To fetch a nightly, visit the link, click the topmost "Nightly"
|
|
|
|
in the table, then choose your platform under "Artifacts." Note
|
|
|
|
that you must be logged in with a GitHub account.)
|
2013-04-15 05:41:33 +02:00
|
|
|
|
2016-11-24 10:02:36 +01:00
|
|
|
Your report should give detailed, *reproducible* instructions, including
|
2013-04-15 05:41:33 +02:00
|
|
|
|
2016-11-24 10:02:36 +01:00
|
|
|
* the pandoc version (check using `pandoc -v`)
|
2013-04-15 05:41:33 +02:00
|
|
|
* the exact command line used
|
|
|
|
* the exact input used
|
|
|
|
* the output received
|
|
|
|
* the output you expected instead
|
|
|
|
|
|
|
|
A small test case (just a few lines) is ideal. If your input is large,
|
2016-11-24 10:02:36 +01:00
|
|
|
try to whittle it down to a *minimum working example*.
|
2013-04-15 05:41:33 +02:00
|
|
|
|
2015-08-09 00:18:31 +02:00
|
|
|
Out of scope?
|
|
|
|
-------------
|
|
|
|
|
|
|
|
A less than perfect conversion does not necessarily mean there's
|
2016-07-20 14:12:57 +02:00
|
|
|
a bug in pandoc. Quoting from the MANUAL:
|
2015-08-09 00:18:31 +02:00
|
|
|
|
2017-10-27 02:55:45 +02:00
|
|
|
> Because pandoc's intermediate representation of a document is less
|
2015-08-09 00:18:31 +02:00
|
|
|
> 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,
|
2017-10-27 02:55:45 +02:00
|
|
|
> 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
|
2015-08-09 00:18:31 +02:00
|
|
|
> Markdown can be expected to be lossy.
|
|
|
|
|
2017-10-27 02:56:28 +02:00
|
|
|
For example, both `docx` and `odt` formats can represent margin size, but
|
|
|
|
because pandoc's internal document model does not contain a representation of
|
2015-08-09 00:18:31 +02:00
|
|
|
margin size, this information will be lost on converting from docx
|
2017-10-27 07:25:37 +02:00
|
|
|
to `odt`. (You can, however, customize margin size using `--reference-doc`.)
|
2015-08-09 00:18:31 +02:00
|
|
|
|
|
|
|
So before submitting a bug report, consider whether it might be
|
2017-10-27 07:26:55 +02:00
|
|
|
"out of scope." If it concerns a feature of documents that isn't
|
2015-08-09 00:18:31 +02:00
|
|
|
representable in pandoc's Markdown, then it very likely is.
|
2017-10-27 02:55:16 +02:00
|
|
|
(If in doubt, you can always ask on [pandoc-discuss].)
|
2015-08-09 00:18:31 +02:00
|
|
|
|
2015-01-03 16:37:25 +01:00
|
|
|
Fixing bugs from the issue tracker
|
|
|
|
----------------------------------
|
|
|
|
|
2015-01-04 01:03:30 +01:00
|
|
|
Almost all the bugs on the issue tracker have one or more associated
|
2016-12-14 22:11:27 +01:00
|
|
|
tags. These are used to indicate the *complexity* and *nature* of a
|
2015-01-04 01:03:30 +01:00
|
|
|
bug. There is not yet a way to indicate priority. An up to date
|
2017-10-27 02:55:16 +02:00
|
|
|
summary of issues can be found on [GitHub labels].
|
2015-01-04 01:03:30 +01:00
|
|
|
|
2018-01-28 20:17:26 +01:00
|
|
|
* [good first issue] — The perfect starting point for new contributors. The
|
2016-12-14 22:11:27 +01:00
|
|
|
issue is generic and can be resolved without deep knowledge of the code
|
|
|
|
base.
|
2016-11-24 10:02:36 +01:00
|
|
|
* [enhancement] — A feature which would be desirable. We recommend
|
2015-01-04 01:03:30 +01:00
|
|
|
you discuss any proposed enhancement on pandoc-discuss before
|
|
|
|
writing code.
|
2016-11-24 10:02:36 +01:00
|
|
|
* [bug] — A problem which needs to be fixed.
|
2016-12-14 22:11:27 +01:00
|
|
|
* [complexity:low] — The fix should only be a couple of lines.
|
|
|
|
* [complexity:high] — The fix might require structural changes or in depth
|
|
|
|
knowledge of the code base.
|
|
|
|
* [new:reader] — A request to add a new input format.
|
|
|
|
* [new:writer] — A request to add a new output format.
|
2017-03-01 15:00:53 +01:00
|
|
|
* [docs] — A discrepancy, or ambiguity in the documentation.
|
2016-12-14 22:11:27 +01:00
|
|
|
* [status:in-progress] — Someone is actively working on or planning to work on the
|
2015-01-04 01:03:30 +01:00
|
|
|
ticket.
|
2016-12-14 22:11:27 +01:00
|
|
|
* [status:more-discussion-needed] — It is unclear what the correct approach
|
2015-01-04 01:03:30 +01:00
|
|
|
to solving the ticket is. Before starting on tickets such as this it
|
|
|
|
would be advisable to post on the ticket.
|
2016-12-14 22:11:27 +01:00
|
|
|
* [status:more-info-needed] — We require more information from a user before
|
2015-01-04 01:03:30 +01:00
|
|
|
we can classify a report properly.
|
2015-01-03 16:37:25 +01:00
|
|
|
|
2016-12-14 22:11:27 +01:00
|
|
|
Issues related to a specific format are tagged accordingly, e.g. feature request
|
|
|
|
or bug reports related to Markdown are labelled with [format:markdown].
|
|
|
|
|
2013-04-15 05:41:33 +02:00
|
|
|
Have an idea for a new feature?
|
|
|
|
-------------------------------
|
|
|
|
|
2017-10-27 02:55:16 +02:00
|
|
|
First, search [pandoc-discuss] and the issue tracker (both [open issues] *and*
|
|
|
|
[closed issues]) to make sure that the idea has not been discussed before.
|
2013-04-15 07:11:19 +02:00
|
|
|
|
|
|
|
Explain the rationale for the feature you're requesting. Why would this
|
|
|
|
feature be useful? Consider also any possible drawbacks, including backwards
|
|
|
|
compatibility, new library dependencies, and performance issues.
|
2013-04-15 05:41:33 +02:00
|
|
|
|
2020-11-27 18:13:02 +01:00
|
|
|
Features are very rarely "implement and forget", as all code must be
|
|
|
|
maintained. This is especially relevant for large or complex
|
|
|
|
contributions. It is helpful to be sympathetic to that fact, and to
|
|
|
|
communicate future plans and availability clearly.
|
|
|
|
|
|
|
|
Any potential new feature is best discussed on [pandoc-discuss]
|
2013-04-15 05:41:33 +02:00
|
|
|
before opening an issue.
|
|
|
|
|
|
|
|
Patches and pull requests
|
|
|
|
-------------------------
|
|
|
|
|
2013-04-15 07:11:19 +02:00
|
|
|
Patches and pull requests are welcome. Before you put time into a nontrivial
|
|
|
|
patch, it is a good idea to discuss it on [pandoc-discuss], especially if it is
|
|
|
|
for a new feature (rather than fixing a bug).
|
|
|
|
|
|
|
|
Please follow these guidelines:
|
2013-04-15 05:41:33 +02:00
|
|
|
|
2013-04-15 07:11:19 +02:00
|
|
|
1. Each patch (commit) should make a single logical change (fix a bug, add
|
2013-04-15 05:41:33 +02:00
|
|
|
a feature, clean up some code, add documentation). Everything
|
|
|
|
related to that change should be included (including tests and
|
|
|
|
documentation), and nothing unrelated should be included.
|
|
|
|
|
2013-04-15 07:11:19 +02:00
|
|
|
2. The first line of the commit message should be a short description
|
|
|
|
of the whole commit (ideally <= 50 characters). Then there should
|
|
|
|
be a blank line, followed by a more detailed description of the
|
|
|
|
change.
|
|
|
|
|
|
|
|
3. Follow the stylistic conventions you find in the existing
|
|
|
|
pandoc code. Use spaces, not tabs, and wrap code to 80 columns.
|
2013-04-15 05:41:33 +02:00
|
|
|
Always include type signatures for top-level functions.
|
2014-04-09 15:45:08 +02:00
|
|
|
Consider installing [EditorConfig], this will help you to follow the
|
|
|
|
coding style prevalent in pandoc.
|
2013-04-15 05:41:33 +02:00
|
|
|
|
2013-04-15 07:11:19 +02:00
|
|
|
4. Your code should compile without warnings (`-Wall` clean).
|
2013-04-15 05:41:33 +02:00
|
|
|
|
2013-04-15 07:11:19 +02:00
|
|
|
5. Run the tests to make sure your code does not introduce new bugs.
|
|
|
|
(See below under [Tests](#tests).) All tests should pass.
|
2013-04-15 05:41:33 +02:00
|
|
|
|
2013-04-15 07:11:19 +02:00
|
|
|
6. It is a good idea to add test cases for the bug you are fixing. (See
|
|
|
|
below under [Tests](#tests).) If you are adding a new writer or reader,
|
2013-04-15 05:41:33 +02:00
|
|
|
you must include tests.
|
|
|
|
|
2017-10-27 02:56:28 +02:00
|
|
|
7. If you are adding a new feature, include updates to `MANUAL.txt`.
|
2013-04-15 05:41:33 +02:00
|
|
|
|
|
|
|
8. All code must be released under the general license governing pandoc
|
|
|
|
(GPL v2).
|
|
|
|
|
|
|
|
9. It is better not to introduce new dependencies. Dependencies on
|
|
|
|
external C libraries should especially be avoided.
|
|
|
|
|
2019-03-27 19:38:24 +01:00
|
|
|
10. We aim for compatibility with ghc versions from 8.0 to the
|
2015-08-15 18:43:14 +02:00
|
|
|
latest release. All pull requests and commits are tested
|
2020-09-01 12:00:38 +02:00
|
|
|
automatically on GitHub Actions.
|
2015-08-15 18:43:14 +02:00
|
|
|
|
2013-04-15 05:41:33 +02:00
|
|
|
Tests
|
|
|
|
-----
|
|
|
|
|
|
|
|
Tests can be run as follows:
|
|
|
|
|
2016-02-05 21:21:45 +01:00
|
|
|
cabal install --only-dependencies --enable-tests
|
2013-04-15 05:41:33 +02:00
|
|
|
cabal configure --enable-tests
|
|
|
|
cabal build
|
|
|
|
cabal test
|
|
|
|
|
2016-02-06 01:58:29 +01:00
|
|
|
or, if you're using [stack],
|
|
|
|
|
2016-10-25 16:51:26 +02:00
|
|
|
stack setup
|
2016-02-06 01:58:29 +01:00
|
|
|
stack test
|
|
|
|
|
2017-02-25 10:31:40 +01:00
|
|
|
The test program is `test/test-pandoc.hs`.
|
2013-04-15 05:41:33 +02:00
|
|
|
|
2019-07-19 18:23:18 +02:00
|
|
|
To run particular tests (pattern-matching on their names), use
|
|
|
|
the `-p` option:
|
|
|
|
|
|
|
|
cabal install pandoc --enable-tests
|
|
|
|
cabal test --test-options='-p markdown'
|
|
|
|
|
|
|
|
Or with stack:
|
|
|
|
|
|
|
|
stack test --test-arguments='-p markdown'
|
|
|
|
|
|
|
|
It is often helpful to add `-j4` (run tests in parallel)
|
|
|
|
and `--hide-successes` (don't clutter output with successes)
|
|
|
|
to the test arguments as well.
|
|
|
|
|
|
|
|
If you add a new feature to pandoc, please add tests as well, following
|
|
|
|
the pattern of the existing tests. The test suite code is in
|
|
|
|
`test/test-pandoc.hs`. If you are adding a new reader or writer, it is
|
|
|
|
probably easiest to add some data files to the `test` directory, and
|
|
|
|
modify `test/Tests/Old.hs`. Otherwise, it is better to modify the module
|
|
|
|
under the `test/Tests` hierarchy corresponding to the pandoc module you
|
2019-07-19 18:24:31 +02:00
|
|
|
are changing. Alternatively, you may add a "command test" to
|
|
|
|
the `/test/command/` hierarchy, following the pattern of the tests there.
|
2019-10-16 12:44:30 +02:00
|
|
|
These test files should have a meaningful name, which can include the issue
|
|
|
|
number and/or the feature that's being tested. For example, `5474-tables.md`
|
|
|
|
refers to both issue and feature.
|
2019-07-19 18:23:18 +02:00
|
|
|
|
2019-07-19 18:29:10 +02:00
|
|
|
You can rebuild the golden tests in `tests/` by passing
|
|
|
|
`--accept` to the test script. (If you're using stack, `stack
|
|
|
|
test --test-arguments "--accept"`; or `make TESTARGS=--accept`).
|
|
|
|
Then check the changed golden files for accuracy, and
|
|
|
|
commit the changes. For docx or pptx tests, open the files in Word
|
|
|
|
or Powerpoint to ensure that they weren't corrupted and that
|
|
|
|
they had the expected result, and mention the Word/Powerpoint
|
|
|
|
version and OS in your commit comment.
|
2019-07-19 18:23:18 +02:00
|
|
|
|
2020-11-16 15:55:21 +01:00
|
|
|
Code style
|
|
|
|
----------
|
|
|
|
|
|
|
|
Pandoc uses [hlint] to identify opportunities for code improvements
|
|
|
|
like redundant brackets or unnecessary `Language` extensions.
|
|
|
|
However, sometimes there are cases where there are good reasons to
|
|
|
|
use code different from what hlint proposes. In these cases, the
|
|
|
|
respective warning should be disabled in the file `.hlint.yaml`.
|
|
|
|
|
|
|
|
There should be no errors when running `hlint .`; this is checked by
|
|
|
|
the continuous integration (CI) setup. It is recommended that
|
|
|
|
contributors check their code with a local hlint installation, but
|
|
|
|
relying on the CI is fine, too.
|
|
|
|
|
|
|
|
A good way to ensure no new warnings are introduced is to use a Git
|
|
|
|
[pre-commit hook] which runs hlint on all updated Haskell files
|
|
|
|
before creating a commit:
|
|
|
|
|
|
|
|
#!/bin/sh
|
2020-12-18 21:18:23 +01:00
|
|
|
git diff --diff-filter=MA --cached --name-only | grep '\.hs$' | \
|
|
|
|
xargs hlint --hint .hlint.yaml
|
2020-11-16 15:55:21 +01:00
|
|
|
|
|
|
|
Saving this to `.git/hooks/pre-commit`, and making the script
|
|
|
|
executable, will prevent accidental introduction of potentially
|
|
|
|
problematic code.
|
|
|
|
|
2016-02-06 01:58:29 +01:00
|
|
|
Benchmarks
|
|
|
|
----------
|
|
|
|
|
|
|
|
To run benchmarks with cabal:
|
|
|
|
|
|
|
|
cabal configure --enable-benchmarks
|
|
|
|
cabal build
|
|
|
|
cabal bench
|
|
|
|
|
|
|
|
With stack:
|
|
|
|
|
|
|
|
stack bench
|
2013-04-15 07:11:19 +02:00
|
|
|
|
2019-09-06 02:34:47 +02:00
|
|
|
You can also build `weigh-pandoc` (`stack build pandoc:weigh-pandoc`)
|
|
|
|
to get some statistics on memory usage. (Eventually this should
|
|
|
|
be incorporated into the benchmark suite.)
|
2016-12-10 23:41:20 +01:00
|
|
|
|
2015-07-15 21:13:51 +02:00
|
|
|
Using the REPL
|
|
|
|
--------------
|
|
|
|
|
|
|
|
With a recent version of cabal, you can do `cabal repl` and get
|
2016-02-06 01:58:29 +01:00
|
|
|
a ghci REPL for working with pandoc. With [stack], use
|
2018-08-22 05:37:15 +02:00
|
|
|
`stack ghci`.
|
2016-02-06 01:58:29 +01:00
|
|
|
|
|
|
|
We recommend using the following `.ghci` file (which can be
|
|
|
|
placed in the source directory):
|
2015-07-15 21:13:51 +02:00
|
|
|
|
2020-11-27 18:13:02 +01:00
|
|
|
:set -fobject-code
|
|
|
|
:set -XTypeSynonymInstances
|
|
|
|
:set -XScopedTypeVariables
|
|
|
|
:set -XOverloadedStrings
|
2015-07-15 21:13:51 +02:00
|
|
|
|
2016-12-10 22:29:30 +01:00
|
|
|
Profiling
|
|
|
|
---------
|
|
|
|
|
2018-04-23 21:02:59 +02:00
|
|
|
To diagnose a performance issue with parsing, first try using
|
|
|
|
the `--trace` option. This will give you a record of when block
|
|
|
|
parsers succeed, so you can spot backtracking issues.
|
|
|
|
|
2016-12-10 22:29:30 +01:00
|
|
|
To use the GHC profiler with cabal:
|
|
|
|
|
|
|
|
cabal clean
|
|
|
|
cabal install --enable-library-profiling --enable-executable-profiling
|
|
|
|
pandoc +RTS -p -RTS [file]...
|
|
|
|
less pandoc.prof
|
|
|
|
|
|
|
|
With stack:
|
|
|
|
|
|
|
|
stack clean
|
|
|
|
stack install --profile
|
|
|
|
pandoc +RTS -p -RTS [file]...
|
|
|
|
less pandoc.prof
|
|
|
|
|
2017-02-20 21:07:59 +01:00
|
|
|
Templates
|
|
|
|
---------
|
2013-04-15 07:11:19 +02:00
|
|
|
|
2017-02-20 21:07:59 +01:00
|
|
|
The default templates live in `data/templates`, which is a git
|
|
|
|
subtree linked to <https://github.com/jgm/pandoc-templates.git>.
|
|
|
|
The purpose of maintaining a separate repository is to allow
|
|
|
|
people to maintain variant templates as a fork.
|
2013-04-15 07:11:19 +02:00
|
|
|
|
2017-02-20 21:07:59 +01:00
|
|
|
You can modify the templates and submit patches without worrying
|
|
|
|
much about this: when these patches are merged, we will
|
|
|
|
push them to the main templates repository by doing
|
2013-04-15 07:11:19 +02:00
|
|
|
|
2017-02-20 21:07:59 +01:00
|
|
|
git subtree push --prefix=data/templates templates master
|
2013-04-15 07:11:19 +02:00
|
|
|
|
2017-02-20 21:07:59 +01:00
|
|
|
where `templates` is a remote pointing to the templates
|
|
|
|
repository.
|
2013-04-15 07:11:19 +02:00
|
|
|
|
2017-02-20 21:07:59 +01:00
|
|
|
The code
|
|
|
|
--------
|
2013-04-15 07:11:19 +02:00
|
|
|
|
2017-02-20 21:07:59 +01:00
|
|
|
Pandoc has a publicly accessible git repository on
|
2020-08-01 19:19:32 +02:00
|
|
|
GitHub: <http://github.com/jgm/pandoc>. To get a local copy of the source:
|
2013-04-15 07:11:19 +02:00
|
|
|
|
2017-02-20 21:07:59 +01:00
|
|
|
git clone https://github.com/jgm/pandoc.git
|
2013-04-15 07:11:19 +02:00
|
|
|
|
|
|
|
The source for the main pandoc program is `pandoc.hs`. The source for
|
|
|
|
the pandoc library is in `src/`, the source for the tests is in
|
2017-02-25 10:31:40 +01:00
|
|
|
`test/`, and the source for the benchmarks is in `benchmark/`.
|
2013-04-15 07:11:19 +02:00
|
|
|
|
|
|
|
The modules `Text.Pandoc.Definition`, `Text.Pandoc.Builder`, and
|
2015-04-18 16:05:30 +02:00
|
|
|
`Text.Pandoc.Generic` are in a separate library `pandoc-types`. The code can
|
2017-10-27 02:56:28 +02:00
|
|
|
be found in <http://github.com/jgm/pandoc-types>.
|
2013-04-15 07:11:19 +02:00
|
|
|
|
|
|
|
To build pandoc, you will need a working installation of the
|
|
|
|
[Haskell platform].
|
|
|
|
|
|
|
|
The library is structured as follows:
|
|
|
|
|
|
|
|
- `Text.Pandoc` is a top-level module that exports what is needed
|
|
|
|
by most users of the library. Any patches that add new readers
|
|
|
|
or writers will need to make changes here, too.
|
|
|
|
- `Text.Pandoc.Definition` (in `pandoc-types`) defines the types
|
|
|
|
used for representing a pandoc document.
|
|
|
|
- `Text.Pandoc.Builder` (in `pandoc-types`) provides functions for
|
2018-07-02 17:51:51 +02:00
|
|
|
building pandoc documents programmatically.
|
2013-04-15 07:11:19 +02:00
|
|
|
- `Text.Pandoc.Generics` (in `pandoc-types`) provides functions allowing
|
|
|
|
you to promote functions that operate on parts of pandoc documents
|
|
|
|
to functions that operate on whole pandoc documents, walking the
|
|
|
|
tree automatically.
|
|
|
|
- `Text.Pandoc.Readers.*` are the readers, and `Text.Pandoc.Writers.*`
|
|
|
|
are the writers.
|
|
|
|
- `Text.Pandoc.Biblio` is a utility module for formatting citations
|
|
|
|
using citeproc-hs.
|
|
|
|
- `Text.Pandoc.Data` is used to embed data files when the `embed_data_files`
|
|
|
|
cabal flag is used. It is generated from `src/Text/Pandoc/Data.hsb` using
|
|
|
|
the preprocessor [hsb2hs].
|
|
|
|
- `Text.Pandoc.Highlighting` contains the interface to the
|
2016-12-24 01:31:10 +01:00
|
|
|
skylighting library, which is used for code syntax highlighting.
|
2013-04-15 07:11:19 +02:00
|
|
|
- `Text.Pandoc.ImageSize` is a utility module containing functions for
|
|
|
|
calculating image sizes from the contents of image files.
|
|
|
|
- `Text.Pandoc.MIME` contains functions for associating MIME types
|
|
|
|
with extensions.
|
|
|
|
- `Text.Pandoc.Options` defines reader and writer options.
|
|
|
|
- `Text.Pandoc.PDF` contains functions for producing a PDF from a
|
|
|
|
LaTeX source.
|
|
|
|
- `Text.Pandoc.Parsing` contains parsing functions used in multiple readers.
|
|
|
|
- `Text.Pandoc.Pretty` is a pretty-printing library specialized to
|
|
|
|
the needs of pandoc.
|
|
|
|
- `Text.Pandoc.SelfContained` contains functions for making an HTML
|
|
|
|
file "self-contained," by importing remotely linked images, CSS,
|
2017-03-01 15:00:53 +01:00
|
|
|
and JavaScript and turning them into `data:` URLs.
|
2013-04-15 07:11:19 +02:00
|
|
|
- `Text.Pandoc.Shared` is a grab-bag of shared utility functions.
|
2013-07-02 05:47:26 +02:00
|
|
|
- `Text.Pandoc.Writers.Shared` contains utilities used in writers only.
|
2013-04-15 07:11:19 +02:00
|
|
|
- `Text.Pandoc.Slides` contains functions for splitting a markdown document
|
2016-07-20 14:12:57 +02:00
|
|
|
into slides, using the conventions described in the MANUAL.
|
2013-04-15 07:11:19 +02:00
|
|
|
- `Text.Pandoc.Templates` defines pandoc's templating system.
|
|
|
|
- `Text.Pandoc.UTF8` contains functions for converting text to and from
|
|
|
|
UTF8 bytestrings (strict and lazy).
|
2013-04-24 05:00:58 +02:00
|
|
|
- `Text.Pandoc.Asciify` contains functions to derive ascii versions of
|
|
|
|
identifiers that use accented characters.
|
2013-04-15 07:11:19 +02:00
|
|
|
- `Text.Pandoc.UUID` contains functions for generating UUIDs.
|
|
|
|
- `Text.Pandoc.XML` contains functions for formatting XML.
|
2013-04-15 05:41:33 +02:00
|
|
|
|
2018-09-08 01:33:38 +02:00
|
|
|
Lua filters
|
|
|
|
-----------
|
|
|
|
|
|
|
|
If you've written a useful pandoc [lua filter](lua-filters.html),
|
|
|
|
you may want to consider submitting a pull request to the
|
|
|
|
[lua-filters repository](https://github.com/pandoc/lua-filters).
|
|
|
|
|
2017-10-27 02:55:16 +02:00
|
|
|
[open issues]: https://github.com/jgm/pandoc/issues
|
|
|
|
[closed issues]: https://github.com/jgm/pandoc/issues?q=is%3Aissue+is%3Aclosed
|
|
|
|
[latest released version]: https://github.com/jgm/pandoc/releases/latest
|
2020-07-02 17:51:38 +02:00
|
|
|
[Nightly builds]: https://github.com/jgm/pandoc/actions?query=workflow%3ANightly
|
2013-04-15 05:41:33 +02:00
|
|
|
[pandoc-discuss]: http://groups.google.com/group/pandoc-discuss
|
|
|
|
[issue tracker]: https://github.com/jgm/pandoc/issues
|
2016-07-20 14:12:57 +02:00
|
|
|
[User's Guide]: http://pandoc.org/MANUAL.html
|
2015-06-09 22:22:58 +02:00
|
|
|
[FAQs]: http://pandoc.org/faqs.html
|
2014-04-09 15:45:08 +02:00
|
|
|
[EditorConfig]: http://editorconfig.org/
|
2013-04-15 07:11:19 +02:00
|
|
|
[Haskell platform]: http://www.haskell.org/platform/
|
2020-11-16 15:55:21 +01:00
|
|
|
[hlint]: https://hackage.haskell.org/package/hlint
|
2013-04-15 07:11:19 +02:00
|
|
|
[hsb2hs]: http://hackage.haskell.org/package/hsb2hs
|
2020-11-16 15:55:21 +01:00
|
|
|
[pre-commit hook]: https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks
|
2017-10-27 02:55:16 +02:00
|
|
|
[GitHub labels]: https://github.com/jgm/pandoc/labels
|
2018-01-28 20:17:26 +01:00
|
|
|
[good first issue]:https://github.com/jgm/pandoc/labels/good%20first%20issue
|
2015-01-04 01:03:30 +01:00
|
|
|
[enhancement]: https://github.com/jgm/pandoc/labels/enhancement
|
|
|
|
[bug]: https://github.com/jgm/pandoc/labels/bug
|
2016-12-14 22:11:27 +01:00
|
|
|
[complexity:low]: https://github.com/jgm/pandoc/labels/complexity:low
|
|
|
|
[complexity:high]: https://github.com/jgm/pandoc/labels/complexity:high
|
2015-01-03 16:37:25 +01:00
|
|
|
[docs]: https://github.com/jgm/pandoc/labels/docs
|
2016-12-14 22:11:27 +01:00
|
|
|
[format:markdown]: https://github.com/jgm/pandoc/labels/format:markdown
|
|
|
|
[new:reader]: https://github.com/jgm/pandoc/labels/new:reader
|
|
|
|
[new:writer]: https://github.com/jgm/pandoc/labels/new:writer
|
|
|
|
[status:in-progress]: https://github.com/jgm/pandoc/labels/status:in-progress
|
|
|
|
[status:more-discussion-needed]: https://github.com/jgm/pandoc/labels/status:more-discussion-needed
|
|
|
|
[status:more-info-needed]: https://github.com/jgm/pandoc/labels/status:more-info-needed
|
2016-02-06 01:58:29 +01:00
|
|
|
[stack]: https://github.com/commercialhaskell/stack
|