GithubHelp home page GithubHelp logo

Comments (3)

apas avatar apas commented on August 28, 2024 2

This is interesting. Since Visdown embeds a YAML code block within a Markdown file and athena uses Pandoc to convert markdown to HTML I think the best approach would be to write a Pandoc filter. What's not clear to me about Visdown is when and how the conversion happens; from what I understand (?) it's on page load via Javascript and DOM manipulation.

Issues with this approach: when athena loads a page it's already in HTML. Ergo, whatever conversion happens needs to occur prior to page load. A "look for vis code blocks, convert to HTML, embed the generated HTML in Markdown, and then convert Markdown to HTML again" approach is at minimum problematic. Hence, the need I think for a Pandoc filter. (If I understand Visdown's mechanics correctly.)

I contacted the author and he mentioned something about a Python package; let's see.

If Visdown can be expressed as a Pandoc filter I'm open to enable it as a flag in athena. Otherwise, I don't see how I can support this.

from athena.

cuchoi avatar cuchoi commented on August 28, 2024

That's amazing, thank you.

Also thank you for writing athena, it is a really cool static blog generator :).

from athena.

cuchoi avatar cuchoi commented on August 28, 2024

I am reading about pandoc filters, they look promising! I am still not sure how they work. Is there a way to do something like this?

Write the following markdown:
[altair](dir/to/json/graph.json)
Then is could be embedded in vega-embed: https://vega.github.io/vega-lite/usage/embed.html. This seems like the one least likely to cause problems since the user only need to provide the json and athena would only need to render that. But I don't know how easy is to add the javascript dependencies and the javascript code to the final output.

Another alternative is that the Markdown could be Altair code (https://altair-viz.github.io/index.html) and then the code is passed through eval(), exported as html and then iframed.

from athena.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.