Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrating the templates into the filter #12

Closed
ickc opened this issue Oct 9, 2016 · 4 comments
Closed

Integrating the templates into the filter #12

ickc opened this issue Oct 9, 2016 · 4 comments

Comments

@ickc
Copy link
Owner

ickc commented Oct 9, 2016

Currently the filter is not "self-contained". A few templates are distributed and are required to use together for it to function properly.

@jgm suggested in jgm/pandoc#3138:

If you include Text.Pandoc.Templates in your filter, you can use its functions to resolve your custom template, and then insert the result into header-includes.

@ickc
Copy link
Owner Author

ickc commented Nov 1, 2016

While embedding the template snippet in the filter itself makes the whole experience cleaner, it means people cannot tailor the templates, which can be important for the CSS (where the counter should be reset?).

It might also means the filter needed to be rewritten in Haskell. (Need more investigation here.) If Haskell is needed, it increases the complication of using the filter. Right now I'm working a project depending on this filter. It can potentially has a lot of contributors, meaning I need to make it easy to setup. Right now I setup this repository as a submodule of that one. No compiling or downloading is needed. Easy to setup for both human and travis.

@ickc
Copy link
Owner Author

ickc commented Nov 4, 2016

Using header-include for the templates?

Another idea is to use header-include in YAML metadata:

  • This way, "embedding" the templates using pandocfilters/panflute is possible (since pandocfilters/panflute doesn't seem to interact with Text.Pandoc.Templates).
  • In principle, this does not need to check for output format, because the template in header-include would be raw LaTeX.
    • but this will cause problems when pandoc -f markdown -t markdown is used to output markdown. Now the new markdown has a YAML frontmatter that already has the necessary amsthm environment. But the LaTeX output still requires the filter since the filter need to convert the div into LaTeX environment. i.e. It should still check if the output is LaTeX.
  • need to make sure the raw LaTeX in header-include will be parsed as raw LaTeX. (use RawInline)
  • This also means the templates requires a complete rewrite.

@ickc
Copy link
Owner Author

ickc commented Dec 2, 2016

The idea to use header-include as template-snippet won't work, see jgm/pandoc#3138.

@ickc
Copy link
Owner Author

ickc commented Jan 1, 2017

See #15. Template will not be needed in v2

@ickc ickc closed this as completed Jan 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant