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

Add option to disable "default true" parameters #16

Open
maurerle opened this issue Jun 21, 2021 · 1 comment
Open

Add option to disable "default true" parameters #16

maurerle opened this issue Jun 21, 2021 · 1 comment

Comments

@maurerle
Copy link

Explain the problem.
The Reveal.js center option does not trigger, due to it being default true and its not possible to set it to false.

As explained in jgm/pandoc#7105 the centering does not trigger, when centering is set to false.
jgm said, that the template language does not support some kind to check the definedness of a value, therefore does not support this currently.

A possible fix is to add the center parameter as dont_center and then set center: !$center$.
This is counter intuitive and should be documented for anybody to find this.

I can't estimate how often such "default true" parameters happen to appear, but a better fix would of course be to add a definedness check

@jgm
Copy link
Owner

jgm commented Jun 21, 2021

I'm going to move this to doctemplates.
Meanwhile I'll do something more local in pandoc to fix the center issue.

@jgm jgm transferred this issue from jgm/pandoc Jun 21, 2021
jgm added a commit that referenced this issue Jun 23, 2021
Previously, `$if(foo)$` evaluated to false iff `foo`
would render as the empty string. This forced us to render
a boolean False value as an empty string, rather than `false`.
And this has caused various problems with templates
(#16, jgm/pandoc#7402).

This commit changes two things:

- Now, boolean False values render as `false` -- just as
  True values render as `true`.
- Conditionals are now sensitive to booleans, so
  `$if(foo)$` evaluates to false when `foo` is a boolean
  False value, even though it would render as the nonempty
  string `false`.

The README on conditionals has been updated accordingly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants