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

generate Shonkier terms from Pandoc divs and spans #30

Open
pigworker opened this issue Mar 19, 2020 · 2 comments
Open

generate Shonkier terms from Pandoc divs and spans #30

pigworker opened this issue Mar 19, 2020 · 2 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers shonkier Everything related to the language

Comments

@pigworker
Copy link
Contributor

We should be able to write templates for parts of documents in pandoc markdown. If you write something like

::: {mary="foo(x)"}
This is a paragraph which uses `x`{.mary}.
:::

that should amount to the definition of a shonkier function which computes a Block from an Inline.

Invoking this with

```{.mary}
foo("a template")
```

should amount to generating the paragraph block

This is a paragraph which uses a template.

Implementing this will involve building a ToTerm class whose instances specify how to turn values in various pandoc types into pandoc terms, splicing in fenced shonkier terms as you go.

@pigworker pigworker added enhancement New feature or request good first issue Good for newcomers shonkier Everything related to the language labels Mar 19, 2020
@gallais gallais self-assigned this Apr 9, 2020
@gallais
Copy link
Member

gallais commented Apr 9, 2020

The current solution only captures code blocks that are variables.
The obvious next step is to allow arbitrary shonkier code to be spliced
in there (thus empowering us to write recursive or even handler templates).

pigworker added a commit that referenced this issue Apr 10, 2020
[ re #30 ] Allow shonkier programs in pandoc divs
@gallais
Copy link
Member

gallais commented May 2, 2020

Given that the current strategy does not really work (cf. enum.mary failing
to generate an itemised list), we may want to add support for a simple
templating engine like mustache.

This library claims to implement the spec. The AST is fairly simple so we
could have the same deep integration we have for div & dot and be able to
run scopechecking on the quoted template.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers shonkier Everything related to the language
Projects
None yet
Development

No branches or pull requests

2 participants