Age | Commit message (Collapse) | Author | Files | Lines |
|
+ Add sandbox feature for readers. When this option is used,
readers and writers only have access to input files (and
other files specified directly on command line). This restriction
is enforced in the type system.
+ Filters, PDF production, custom writers are unaffected. This
feature only insulates the actual readers and writers, not
the pipeline around them in Text.Pandoc.App.
+ Note that when `--sandboxed` is specified, readers won't have
access to the resource path, nor will anything have access to
the user data directory.
+ Add module Text.Pandoc.Class.Sandbox, defining
`sandbox`. Exported via Text.Pandoc.Class. [API change]
Closes #5045.
|
|
|
|
|
|
* Use implicit Prelude
The previous behavior was introduced as a fix for #4464. It seems that
this change alone did not fix the issue, and `stack ghci` and `cabal
repl` only work with GHC 8.4.1 or newer, as no custom Prelude is loaded
for these versions. Given this, it seems cleaner to revert to the
implicit Prelude.
* PandocMonad: remove outdated check for base version
Only base versions 4.9 and later are supported, the check for
`MIN_VERSION_base(4,8,0)` is therefore unnecessary.
* Always use custom prelude
Previously, the custom prelude was used only with older GHC versions, as
a workaround for problems with ghci. The ghci problems are resolved by
replacing package `base` with `base-noprelude`, allowing for consistent
use of the custom prelude across all GHC versions.
|
|
* Extract CommonState into submodule
* Extract PandocMonad into submodule
* PandocMonad: ensure all functions have Haddock documentation
|
|
All warnings are either fixed or, if more appropriate, HLint is
configured to ignore them. HLint suggestions remain.
* Ignore "Use camelCase" warnings in Lua and legacy code
* Fix or ignore remaining HLint warnings
* Remove redundant brackets
* Remove redundant `return`s
* Remove redundant as-pattern
* Fuse mapM_/map
* Use `.` to shorten code
* Remove redundant `fmap`
* Remove unused LANGUAGE pragmas
* Hoist `not` in Text.Pandoc.App
* Use fewer imports for `Text.DocTemplates`
* Remove redundant `do`s
* Remove redundant `$`s
* Jira reader: remove unnecessary parentheses
|
|
* Avoid duplicating the dash case
* Pull common functions out of case branches
* Make sure list lengths are only calculated once
* Use unless
* Simplify parseURIReference' and avoid an unnecessary call to length
* Use <$> instead of reimplementing it
* Use swap instead of reimplementing it
* Remove eta-expansion that's been unnecessary since 90f5dd8
* Use tailDef instead of reimplementing it
* Use second instead of fmap, per @tarleb
|
|
* Text.Pandoc.Templates [API change]
+ Add Monad wrappers `WithDefaultPartials` and `WithPartials`.
Wrapping these around an instance of `PandocMonad` gives
us different instances of `TemplateMonad`, with different
search behavior in retrieving partials.
To compile a template and limit partial search to pandoc's
data files, use `runWithDefaultPartials (compileTemplate ...)`.
To compile a template and allow partials to be found locally
(either on the file system or via HTTP, in the event that
the main template has an absolute URL), ue
`runWithPartials (compileTemplate ...)`.
+ Export `getTemplate`, which seeks a template locally,
or via HTTP if the template has an absolute URL, falling
back to the data files if not found.
+ Export `compileDefaultTemplate` -- does `getDefaultTemplate`
and compiles the result, raising an error on failure.
* Text.Pandoc.Class [API change]
+ Remove `TemplateMonad` instances for `PandocIO` and `PandocPure`.
These were too limiting and caused a bug whereby a local
partial could be used even when the default template was requested.
We now rely on instances provided in the Templates module.
Text.Pandoc.App.OutputSettings
+ Simplify template retrieval code.
|
|
PR #5884.
+ Use pandoc-types 1.20 and texmath 0.12.
+ Text is now used instead of String, with a few exceptions.
+ In the MediaBag module, some of the types using Strings
were switched to use FilePath instead (not Text).
+ In the Parsing module, new parsers `manyChar`, `many1Char`,
`manyTillChar`, `many1TillChar`, `many1Till`, `manyUntil`,
`mantyUntilChar` have been added: these are like their
unsuffixed counterparts but pack some or all of their output.
+ `glob` in Text.Pandoc.Class still takes String since it seems
to be intended as an interface to Glob, which uses strings.
It seems to be used only once in the package, in the EPUB writer,
so that is not hard to change.
|
|
|
|
+ Remove Text.Pandoc.Pretty; use doclayout instead. [API change]
+ Text.Pandoc.Writers.Shared: remove metaToJSON, metaToJSON'
[API change].
+ Text.Pandoc.Writers.Shared: modify `addVariablesToContext`,
`defField`, `setField`, `getField`, `resetField` to work with
Context rather than JSON values. [API change]
+ Text.Pandoc.Writers.Shared: export new function `endsWithPlain` [API
change].
+ Use new templates and doclayout in writers.
+ Use Doc-based templates in all writers.
+ Adjust three tests for minor template rendering differences.
+ Added indentation to body in docbook4, docbook5 templates.
The main impact of this change is better reflowing of content
interpolated into templates. Previously, interpolated variables
were rendered independently and intepolated as strings, which could lead
to overly long lines. Now the templates interpolated as Doc values
which may include breaking spaces, and reflowing occurs
after template interpolation rather than before.
|
|
* Require recent doctemplates. It is more flexible and
supports partials.
* Changed type of writerTemplate to Maybe Template instead
of Maybe String.
* Remove code from the LaTeX, Docbook, and JATS writers that looked in
the template for strings to determine whether it is a book or an
article, or whether csquotes is used. This was always kludgy and
unreliable. To use csquotes for LaTeX, set `csquotes` in your
variables or metadata. It is no longer sufficient to put
`\usepackage{csquotes}` in your template or header includes.
To specify a book style, use the `documentclass` variable or
`--top-level-division`.
* Change template code to use new API for doctemplates.
|
|
Move up the pattern match to be reachable, closes #5517.
Previously `file:/` URLs were handled wrongly and pandoc attempted
to make HTTP requests, which failed.
|
|
The previous built-in reference doc had only title and content
layouts. Add in a section-header slide and a two-content slide, so
users can more easily modify it to build their own templates.
Golden files needed to be regenerated. Checked on MS PowerPoint 2013.
|
|
|
|
These are paths beginning `//?/UNC/...`. Closes #5127.
|
|
The haddock module header contains essentially the
same information, so the boilerplate is redundant and
just one more thing to get out of sync.
|
|
|
|
So far, we don't actually write any custom properties,
but we have the infrastructure to add this.
See #3034.
|
|
|
|
This removes a compiler warning.
There is no need for the old network-uri flag, since
network 2.6 was released in 2014.
|
|
Closes #4613.
Needs testing on Windows.
|
|
If we do not catch these errors, any malformed entry in a media bag
could cause the loss of a whole document output. An example of
malformed entry is an entry with an empty file path.
|
|
This avoids writing things like `file%20one.png` to the file system.
|
|
This is no longer necessary since we no longer support ghc 7.8.
|
|
This seems to be necessary if we are to use our custom Prelude
with ghci.
Closes #4464.
|
|
|
|
|
|
|
|
|
|
This forces uses to interact with it using
`insertInFileTree` and `getFileInfo`, which normalize
file names.
|
|
Otherwise we can't find the data files when compiled
with -embed_data_files.
|
|
Also added slide2 to the default pptx, and reordered
the data files in pandoc.cabal.
|
|
|
|
This gives a pure way to insert an ersatz file into a FileTree.
In addition, we normalize paths both on insertion and on
lookup, so that "foo" and "./foo" will be judged equivalent.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!! warning
-- info
|
|
Now all the guts of openURL have been put into openURL from
Class. openURL is now sensitive to stRequestHeaders in CommonState
and will add these custom headers when making a request.
It no longer looks at the USER_AGENT environment variable,
since you can now set the `User-Agent` header directly.
|
|
|
|
|
|
Removed `writerSourceURL` from `WriterOptions` (API change).
Added `stSourceURL` to `CommonState`.
It is set automatically by `setInputFiles`.
Text.Pandoc.Class now exports `setInputFiles`, `setOutputFile`.
The type of `getInputFiles` has changed; it now returns `[FilePath]`
instead of `Maybe [FilePath]`.
Functions in Class that formerly took the source URL as a parameter
now have one fewer parameter (`fetchItem`, `downloadOrRead`,
`setMediaResource`, `fillMediaBag`).
Removed `WriterOptions` parameter from `makeSelfContained` in
`SelfContained`.
|
|
|