Code Monkey home page Code Monkey logo

Comments (3)

svilupp avatar svilupp commented on June 24, 2024 1

Apologies! I've beefed up the original post with some references and an introduction.

from literate.jl.

fredrikekre avatar fredrikekre commented on June 24, 2024

Can you link to some description of what Quarto markdown flavor is?

from literate.jl.

svilupp avatar svilupp commented on June 24, 2024

Findings from a quick investigation: we get most of the functionality with the existing blocks, the only challenge I found is parsing the modifying attributes like #| echo:false that need to be inside of code blocks.

Goal: producing a .qmd file that corresponds to Quarto specs

I've created a gist here with:

  • target file quarto_jl.qmd that we would like to produce
  • source file quarto.jl that we feed to Literate.jl

Code pipeline (from REPL):

using Literate
Literate.markdown("quarto.jl",flavor = Literate.CommonMarkFlavor(),codefence="```{julia}" => "```")
mv("quarto.md","quarto.qmd")
run(`quarto render quarto.qmd --to html`)

The only challenge I found was how to create a cell like this with #| echo:false-like statements

```{julia}
#| echo: false
#| output: false
using Pkg; Pkg.activate(".")

Proposal

  • I think we could easily add a new flavour of markdown with its codefence here
  • Writing the result to the right filename, probably use the keyword literate_outputfile in the config - EDIT: that doesn't work, but perhaps we could just suffix quarto markdown with .qmd
  • ? How to pass the code-block arguments? I think the rule that's not working is that a comment expects a space (eg, ## Comment), so this regex doesn't get triggered

I'm happy to open the PR but I'm not sure how to best tackle the 3rd bullet - any ideas?
Maybe adding an optional | symbol after the # to the regex to be still treated like a comment?

from literate.jl.

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.