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

Feature Request: Evaluate Clojure code from within Markdown #12

Open
phillc73 opened this issue Mar 5, 2016 · 1 comment
Open

Feature Request: Evaluate Clojure code from within Markdown #12

phillc73 opened this issue Mar 5, 2016 · 1 comment

Comments

@phillc73
Copy link

phillc73 commented Mar 5, 2016

I'd like the ability to evaluate Clojure from directly within a markdown page.

As an example, I'd like to generate a chart using Incanter. Rather than save the chart as an image file, and include in the markdown file in the usual way, I'd like to rather include the Clojure code to generate the chart and have that code evaluated, along with the markdown, to produce an HTML page including the chart.

An example I can point to, in a different language domain, is knitr for R. Write some markdown, include some R code, "knit" the page and output HTML.

In fact, knitr already supports Clojure code. This is a potential workaround, but it's not a particularly nice tool chain. I'd much prefer to generate a Cryogen markdown page, which also evaluated my Clojure code.

Maybe this is already possible, and I'm just too new to Clojure to intuitively understand how to achieve it. If it is already possible, it'd be great to have some documentation discussing how.

@yogthos
Copy link
Member

yogthos commented Mar 5, 2016

I think the easiest way to do this would be in the cryogen-markdown plugin. The markdown-clj library already allows adding custom transformer functions as described here. So, one option could be to create a new type of tag that would evaluate its content and return the result.

@lacarmen lacarmen transferred this issue from cryogen-project/cryogen Dec 8, 2019
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