Git Product home page Git Product logo

Comments (4)

sergiocorreia avatar sergiocorreia commented on July 21, 2024

We can always do this:

  1. Run pandoc --to=json ...
  2. Pipe that to panflute
  3. Have a filter that can be applied to every element, creating the output
  4. Use panflute's walk() that goes through every element
  5. Instead of dumping the data back into json, save it as a text file

That said, having a filter than parses every possible element is a lot of work, so for small changes it's always easy to piggyback on other writers.

from panflute.

ekiim avatar ekiim commented on July 21, 2024

I'm thinking about a Custom HTML writer, I can make an HTML filter (with XML tools), that fixes my output to the way I want but, I can't do that with latex, so the AST, it's the only common place I can get the document to output to HTML and Latex, this is why I'm considering having my own writer.

I know It might be heavy, but may be, a "partial writer", that takes certain formatted elements, and alters the AST in a way that Introduces the raw blocks that you need in the output for that case.
This sounds like the correct way, but also sounds kind of noisy.

May be, having another run that walks the tree, at the end of the filter application, that uses a config file that gives the matching rules for each panflute element, and the corresponding element in the output representation, that way we can write quick writers, this will limit the scope of what is doable, but still, I think It could work, just be thinking on how to implement the module, in a way that doesn't make noise the rest of the panflute functionality but that still uses the same structures.

from panflute.

burnpanck avatar burnpanck commented on July 21, 2024

I'm also interested in this. I intend to write a specific docx writer for our purposes, because the standard pandoc writer of docx is too limited. Particularly, I would like to use a template, where I insert certain metadata at the right locations. With python-docx I can handle the necessary docx pushing, and I don't want to learn haskell :-).

@sergiocorreia: It would be great if you could elaborate a little more on your proposed workaround: How would you invoke panflute and pipe the json to it? I'm new to panflute, and did not find any information how to invoke panflute in any way other than as a filter, which means it will always go through another writer at the end, right?

from panflute.

ekiim avatar ekiim commented on July 21, 2024

from panflute.

Related Issues (20)

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.