Giter VIP home page Giter VIP logo

Comments (13)

postylem avatar postylem commented on June 16, 2024 1

Try release 1.1.15 for the preliminary Quarto support.

I have been considering for a while whether it is worth changing the rendering engine of this application and / or creating a new one that supports a greater number of formats using pandoc

I just wanted to chime in again and say thanks in release 1.0.15 .qmd files are looking pretty good :). Personally I'm a user of pandoc-style markdown in general, so it would be lovely to have some more of those features supported; if switching the rendering engine is something you're considering that would be great, but it's quite usable as it is. Thanks for putting this tool out there!

from qlmarkdown.

sbarex avatar sbarex commented on June 16, 2024

Hi,
I took a look at the Quarto. I see it uses pandoc as its rendering engine which offers some markdown features not supported by cmark-gfm.

I have been considering for a while whether it is worth changing the rendering engine of this application and / or creating a new one that supports a greater number of formats using pandoc.

In the meantime I ask you for some clarifications:

  • which editor do you use for Quarto files?
  • from the Terminal what is the output of this command?
mdls -name kMDItemContentTypeTree -name kMDItemContentType  PATH_OF_AN_EXISTS_QUARTO_FILES

from qlmarkdown.

postylem avatar postylem commented on June 16, 2024

Hi there, I stumbled upon this and as another Quarto and QLMarkdown user I thought I could answer for myself:

  • I use neovim for editing .qmd files, just like any (pandoc-flavor) .md file (with vim-pandoc), but I imagine RStudio would be a common editor people use with Quarto, and any other text editor too (live previewing HTML in a broswer with a terminal command quarto preview myfile.qmd).
  • for me the output of the command mdls -name kMDItemContentTypeTree -name kMDItemContentType myfile.qmd is
kMDItemContentType     = "dyn.ah62d4rv4ge81c5pe"
kMDItemContentTypeTree = (
   "public.item",
   "dyn.ah62d4rv4ge81c5pe",
   "public.data"
)

from qlmarkdown.

mattwarkentin avatar mattwarkentin commented on June 16, 2024

Hi @sbarex,

Indeed, Quarto is built on top of Pandoc, and Pandoc Markdown is an extended version of standard Markdown. I have been using Pandoc extensively for a number of years, so if I can provide any further insights that would be helpful, please let me know.

To add a little context, Quarto is quite new. It has only been public-facing since a few months ago, and it hasn't yet had its "formal" public release, which, as I understand it, is planned to coincide with the release of Quarto 1.0 which will be showcased at the RStudio Conference this coming July.

  • All that being said, I personally use VS Code and the RStudio IDE for my own editing of both Rmd and qmd files. However, Quarto does provide extensions and support for Jupyter, Emacs, Vim/Neovim, and Sublime Text. Qmd files are just plain-text files so any text editor will work, though.
mdls -name kMDItemContentTypeTree -name kMDItemContentType  index.qmd
kMDItemContentType     = "dyn.ah62d4rv4ge81c5pe"
kMDItemContentTypeTree = (
    "public.item",
    "dyn.ah62d4rv4ge81c5pe",
    "public.data"
)

Hope this helps.

from qlmarkdown.

sbarex avatar sbarex commented on June 16, 2024

Hi @mattwarkentin and @postylem,
Thanks for the info.
I note that for now no editor explicitly defines the qmd format (the linked user is dynamic: dyn.ah62d4rv4ge81c5pe).

I did some small tests with pandoc. The executable weighs quite a lot (over 90mb for the intel version and I haven't found a precompiled version for apple silicon). It also seems to me that it has longer execution times than the current solution.

It has a number of advantages such as the ability to run scripts to change the output.

So I'm not sure whether to use it or not ...

Try release 1.1.15 for the preliminary Quarto support.

from qlmarkdown.

mattwarkentin avatar mattwarkentin commented on June 16, 2024

Ah, yes. Admittedly, I use QLMarkdown to view my markdown files in source format with syntax highlighting, so the rendering challenge wasn't at the top of my mind.

The preliminary Quarto support works well for me in 1.0.15.

I note that syntax highlighting for fenced code blocks isn't working for me for any markdown format. Is this a me issue?

from qlmarkdown.

mattwarkentin avatar mattwarkentin commented on June 16, 2024

Note the php code block.

Screen Shot 2022-04-06 at 8 54 27 AM

from qlmarkdown.

mattwarkentin avatar mattwarkentin commented on June 16, 2024

Ahh, I see now that the syntax highlighting only happens when you render the source code.

A few general notes:

  • I thought the syntax highlighting would work even when not rendering source code. I guess there are really two types of highlighting: 1. Markdown highlighting of the source doc, and 2. Code highlighting of fenced code blocks.
  • I found it counter-intuitive that when you check the box for Render source code, it actually disables the source code rendering
  • Toggling between source mode and rendered mode resets any syntax highlight themes I have selected
  • More generally, the preferences/configurations are not inherited across new versions of QLMarkdown, as far as I can tell. Perhaps a YAML/JSON/some other file could be saved to disk and inherited across versions. Thoughts?

from qlmarkdown.

sbarex avatar sbarex commented on June 16, 2024

Hi,

  • I thought the syntax highlighting would work even when not rendering source code
  • If you check "render source code" in the advanced options, the markdonw file will not be formatted but its highlighted source code will be shown. (In your screenshot the advanded "render source code" is on).
  • For the syntax highlighting to be displayed in the formatted markdown file you must check "syntax highlight" in the basic settings and unset the "render source code" in the advanced options
  • I found it counter-intuitive that when you check the box for Render source code, it actually disables the source code rendering
  • I probably should have used a clearer term
  • Toggling between source mode and rendered mode resets any syntax highlight themese
    More generally, the preferences/configurations are not inherited across new versions of QLMarkdown, as far as I can tell. Perhaps a YAML/JSON/some other file could be saved to disk and inherited across versions. Thoughts?
  • Very strange, in my version the preferences are kept

from qlmarkdown.

mattwarkentin avatar mattwarkentin commented on June 16, 2024

Thanks for the response, @sbarex.

I think maybe I am still confused about the terminology. When you say "source code" are you referring to the Markdown document, or code chunks within the Markdown document?

I was under the assumption that source code referred to the source Markdown document itself.

It seems to me that there are two levels of syntax highlighting. One at the file-level (i.e. Markdown highlighting) and one at the code chunk-level (i.e. based on whatever language is detected).

Is it possible to not render the source code, but still have Markdown and code chunk highlighting?

from qlmarkdown.

sbarex avatar sbarex commented on June 16, 2024

I think maybe I am still confused about the terminology. When you say "source code" are you referring to the Markdown document, or code chunks within the Markdown document?

Advanced options / render source code: if checked do not format the markdown but shows the source file highlightning the markup code and ignore all other settings (it is a function that is only needed in very rare cases, otherwise it must ALWAYS be deactivated)
Basic options / Syntax highlight: if checked the fenced code blocks are highlighted

When you change a settings the preview will be updated, so you can see the result

Is it possible to not render the source code, but still have Markdown and code chunk highlighting?

  • Basic options / Syntax highlight: ON
  • Advanced options / render source code: OFF

from qlmarkdown.

mattwarkentin avatar mattwarkentin commented on June 16, 2024

Thanks again for the response, @sbarex. It seems like I am not able to do what I was hoping (i.e. highlighting the markup code of the source file, and also highlighting the fenced code blocks). No worries, this tool is still very helpful.

from qlmarkdown.

sbarex avatar sbarex commented on June 16, 2024

I am sorry but it is an unsupported feature and it is beyond the capabilities of the rendering engines I am using.

from qlmarkdown.

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.