Code Monkey home page Code Monkey logo

quarto-cli's Introduction

Quarto

Quarto is an open-source scientific and technical publishing system built on Pandoc. Quarto documents are authored using markdown, an easy to write plain text format.

In addition to the core capabilities of Pandoc, Quarto includes:

  1. Embedding code and output from Python, R, Julia, and JavaScript via integration with Jupyter, Knitr, and Observable.

  2. A variety of extensions to Pandoc markdown useful for technical writing including cross-references, sub-figures, layout panels, hoverable citations and footnotes, callouts, and more.

  3. A project system for rendering groups of documents at once, sharing options across documents, and producing aggregate output like websites and books.

  4. Authoring using a wide variety of editors and notebooks including JupyterLab, RStudio, and VS Code.

  5. A visual markdown editor that provides a productive writing interface for composing long-form documents.

Learn more about Quarto at https://quarto.org.

Development Version

To install the development version of the Quarto CLI, clone the quarto-cli repository then run the configure script for your platform (configure.sh for Linux/macOS or configure.cmd for Windows). For example:

git clone https://github.com/quarto-dev/quarto-cli
cd quarto-cli
./configure.sh

The ./configure.sh script should add a symlink to quarto to your path. You can also run quarto by running package/dist/bin/quarto.

To update to the latest development version, run git pull from the local repo directory:

cd quarto-cli
git pull

Running Tests

To run all unit tests, execute the script in the test directory.

cd tests
./run-tests.sh

To run a specific unit test, specify the script name.

cd tests
./run-tests.sh smoke/extensions/extension-render-doc.test.ts
./run-tests.sh smoke/extensions/

License

Quarto is open source software available under the MIT license (https://opensource.org/license/mit/).

quarto-cli's People

Contributors

batpigandme avatar bobby1030 avatar cderv avatar coatless avatar cscheid avatar cwickham avatar dragonstyle avatar eitsupi avatar giabaio avatar github-actions[bot] avatar gjirokastrelbasanit34 avatar gordonwoodhull avatar hamelsmu avatar jcheng5 avatar jjallaire avatar jkrumbiegel avatar jmbuhr avatar knuesel avatar mcanouil avatar mhellmund avatar mohammadrizki avatar mslynch avatar rcannood avatar rich-iannone avatar salim-b avatar softwarenerd avatar thomasballinger avatar wch avatar willgiang avatar yihui avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

quarto-cli's Issues

Render revealjs with configured slide numbers

According to the revealjs docs on slide numbering (https://revealjs.com/slide-numbers/), I should be able to use the slideNumbers variable with any of these values:

Value Description
h.v Horizontal . Vertical slide number (default)
h/v Horizontal / Vertical slide number
c Flattened slide number, including both horizontal and vertical slides
c/t Flattened slide number / total slides

I can set it to true / false without problems, but using any string like these results in invisible render behavior? See video:

Screen.Recording.2021-07-19.at.4.48.59.PM.mov

Here is my YAML:

---
title: "A slide deck"
author: "Alison Hill"
format: 
  revealjs:
    slideNumber: 'c/t'
---

Multiple Python environments in the same project

I'm currently working on a project that tentatively will have many contributors and each chapter will probably use its own python environment. Right now Quarto uses the active environment to render the final output and I wonder if there is a way that Quarto can be environment aware, i.e. each chapter or sub directory could have a .python-version that can be activated by Quarto (Conda or pyenv). It will be up to the users to install these environments, Quarto will only activate them to render the output.

Where do we ask questions about Quarto?

I am very sorry if I missed this - but where is the best place to ask support-like questions about Quarto? Is that here? Or somewhere else?

We've very interested in Quarto for an R / Python book we are writing, but I couldn't immediately see how to execute code before knitr rendering, for each book chapter - a nice feature of Bookdown.

@stefanv is my book co-author, and pointed me to Quarto.

`render` list not respected in project

I noticed that Quarto seems to ignore my list of documents to render:

# _quarto.yml
project:
  render:
    - index.qmd
    - about.qmd

I also have a document another.qmd in the same directory, and I get the following output from quarto render .:

[1/3] index.qmd
[2/3] another.qmd
[3/3] about.qmd

I was expecting, from the docs, that Quarto would ignore another.qmd. Is that not so?

Vertically align search in top navbar with text

With a navbar defined by:

https://github.com/pommevilla/incog-workbench/blob/cb6673c6647518e54d33f903fd851777f801a328/_quarto.yml#L17-L26

  navbar:
    search: true
    logo: images/RStudio-ball.svg
    right:
      - text: "Rstudio.com"
        url: 'https://www.rstudio.com/'
      - text: "Release Notes"
        url: "https://support.rstudio.com/hc/en-us/articles/200716783-RStudio-Release-History"
      - text: "Help"
        url: "https://support.rstudio.com/hc/en-us"

We see:
Screen Shot 2021-07-19 at 2 56 25 PM

It would look more streamlined to have the text aligned vertically with the search box.

Related issue: https://github.com/rstudio/rstudio-pro/issues/2747

TOC covers wide text

Given a Quarto project with a single index.md:

---
title: widelink
---

## level two

we will give a link to the `shiny_prerendered_app` function: <https://github.com/rstudio/rmarkdown/blob/1ea35758871f6246ace35dc87a7879153deea380/R/shiny_prerendered.R#L2-L3>

* a link to `html_dependency_highlightjs`: <https://github.com/rstudio/rmarkdown/blob/1ea35758871f6246ace35dc87a7879153deea380/R/html_dependencies.R#L411-L419>

  * a sublist with the same link: <https://github.com/rstudio/rmarkdown/blob/1ea35758871f6246ace35dc87a7879153deea380/R/html_dependencies.R#L411-L419>
project:
  type: site

site:
  title: "wide link list"
  sidebar:
    contents:
      - index.md

format:
  html:
    theme: darkly
    toc: true

The rendered site shows the long links, presents it as wrapped, but some of the long-line text is hidden by the TOC box. Sometimes (depending on indenting), that text can flow to the far right-hand side (past the TOC box):

image

This example is using the darkly theme to make the text truncation more obvious.

I saw this display problem because one of my Markdown documents had a bare link; I can avoid it by using [text](url) instead. I don't know if it happens with other text that can overflow.

Is there a way of specifying another `_quarto.yml` file on command line?

Please forgive my endless questions, but

Is there a way of specifying the configuration that is usually in _quarto.yml - on the command line? As in:

quarto render . --config=alternative_quarto.yml

Our use-case is that we want to build the site as GFM, in order to resolve things like citations and execute any r macros, before post-processing into notebooks, but building in GFM is forbidden for the book type, which is the type specified in our standard _quarto.yml file.

Not evaluating inline code consistently

When rendering the following example.rmd I ran into some inconsistencie regarding evaluation of inline code:

--- 
title: "RStudio Workbench"
date: "`r Sys.Date()`"
---

One plus two is `r 1 + 2`.

Today's date is `r Sys.Date()`.

When I knit example.rmd in Rstudio, I get the expected output:

image

Calling quarto render example.rmd gives:

image

When I label it as example.qmd and render it from RStudio, I get this:

image

Calling quarto render example.qmd gives:

image

This was on the most recent dev release of quarto-cli.

Installing via Conda

Dear all,
I have just discovered Quarto and I am very excited by it, in particular as a way to enable students to render well formatted reports directly from notebooks, and as a way to work on scientific papers with a relatively simple way to pass journal templates to the project for rendering ( something to explore).

I am wondering whether it is possible to make sure the python environment used ( conda) is the same one where quarto executes, by having quarto install from conda ( forge). Do you plan to release under conda forge? Or is there a way to specify this, for instance through the nested pip install from github (as in https://stackoverflow.com/questions/19042389/conda-installing-upgrading-directly-from-github) .

Thanks,
Martin

Figure caption error with multibyte characters and non-English locale

I found the follwing error when I render a qmd file which contains multibyte characters in fig.cap under non-English locale (jp_JP.utf8, Ubuntu 20.04 on WSL2).

quarto render reprex.qmd

...

Error in yaml::yaml.load(yaml, eval.expr = TRUE):
  Scanner error: while scanning a quoted scalar at line 1, column 10 found unexpected end of stream at line 1, column 12
Calls: .main ... parse_block -> partition_yaml_options -> <Anonymous>
Execution halted

reprex.qmd is like this.

---
title: "Untitled"
format:
  html:
    theme: default
---

```{r}
#| fig.cap: "α"
plot(1)
```

I can avoid this error by executing LOCALE=en_US.utf8 quarto render .... in the terminal. But it's inconvenient on RStudio.

NOTE: Pandoc's native syntax (like ![Elephant](elephant.png)) doesn't return error.

"Error" messages when refreshing during `quarto serve`

When you're editing documents while using quarto serve on the command line, you get these "error" messages upon saving changes to any files:

image

Is there a way we can change this message so a less experienced user doesn't get worried by all the "error" messages? Or is this just something we'll have to bring to the user's attention in the docs?

suggestion: site/book creation should .gitignore _site/_book

The _site/_book directories should be added to the .gitignore when initializing a new website/book.

quarto create-project my-site --type site
echo _site >> my-site/.gitignore

quarto create-project my-book --type book
echo _book >> my-book/.gitignore

One or more notebooks embedded in page

This is just to tell you about a use-case that we have, that might be of interest.

Summary

We want to separate the idea of a 'page' and a 'notebook', so that a page can contain one or more notebooks.

Detail

We (@stefanv and I) are writing a new edition of a book on probability and statistics.

For the book format, it makes most sense to us to have chapters, and pages, that are relatively long. These chapters will have several examples. Often we want to have separate notebooks for the students to interact with for each example.

This in turn means we would like to change from the standard "Download / run this page as a notebook" idiom, that works really well in JupyterBook - to an idiom where, at any point in a page, there is a 'Download / run this part of the page as a notebook'.

At the moment we are doing that with an awful hack, where we use macros like r begin_notebook('first_example') and r end_notebook() to drop comments into the built .Rmd page, and then post-process to extract the notebooks. But this is just to wonder out loud whether there is a better way to do this - and whether this is an interesting way of thinking about the relationship of pages to notebooks.

v2 Google Fonts API?

It looks like the embedded bootswatch themes currently use the v1 Google Fonts API that doesn't support variable fonts:

$web-font-path: "https://fonts.googleapis.com/css?family=Neucha|Cabin+Sketch&display=swap" !default;

It doesn't seem to impact behavior of themes now, but something to be aware of is the v2 Google Fonts API uses a different base URL, see:
https://developers.google.com/fonts/docs/css2

`quarto install -lt` errors on Windows

In powershell

❯ quarto --version
v0.1.250
❯ quarto install -lt
ERROR TypeError: Error parsing args: serde_v8 error: ExpectedString

-lt is indicated as the shorter form of --list-tools which works.

code blocks have wrapping

Quarto version: 0.1.296

Using a Markdown document with very-long-line code block:

---
title: wrapping
---

A very long fixed-font block.

```bash
export SOME_VERY_LONG_VARIABLE="https://${SOME_VERY_LONG_SERVER_NAME}:${SOME_VERY_LONG_PORT}/"
```

Rendering this document:

quarto render index.md

Produces the layout (on Safari):

image

The export is on a separate line than the variable definition.

Additionally, the scrollable region has the following appearance when scrolled to the right:

image

The code-block text bleeds out of the grey box is is supposed to be contained in.

On hover:

image

The copy button stays with the box, which means it is to the left of the end of the text.

small typo in command line help

When I type quarto serve help, I get a bunch of information including: Serve but don't open a browser: quarto serve --no-browser. But when I actually try the command, I'm told that the option is --no-browse (note the lack of 'r').

Update Sass theme format to reflect new sass::sass_layer()

The format is inspired by the current version of sass::sass_layer()

/*-- scss:declarations --*/
@function colorToRGB ($color) {
  @return "rgb(" + red($color) + ", " + green($color) + ", " + blue($color)+ ")";
}

/*-- scss:variables --*/
$h2-font-size:          1.6rem !default;
$headings-font-weight:  500 !default;
$body-color:            $gray-700 !default;

/*-- scss:rules --*/
h1, h2, h3, h4, h5, h6 {
  text-shadow: -1px -1px 0 rgba(0, 0, 0, .3);
}

We'll likely be deprecating the concept of declarations in favor of functions and mixins (rstudio/sass#80), which will allow variable defaults to make use of functions

/*-- scss:functions --*/
@function color-contrast($color) {
  @return if(
    red($color) * 0.299 + green($color) * 0.587 + blue($color) * 0.114 > 186,
    black, white
  );
}

/*-- scss:variables --*/
$body-color:            color-contrast($body-bg) !default;

/*-- scss:mixins --*/
@mixin body-color {
  color: $body-color
}

/*-- scss:rules --*/
body {
  @include body-color;
}

`quarto serve` saying that directory is not a project

I created a small page using Quarto and Github Pages (repo, page). I first wrote an Rmd and a R script, made sure they were working as desired, then called quarto create-project in that directory. A minimal _quarto.yml is created and the related quarto statements are added to .gitignore.

When I call quarto render, I get the expected html. However, when I call quarto serve, I get this error:
image

I deleted _quarto.yml, .quarto/, and the output created by quarto and then rendered everything without those quarto files. I got the same html document that I did with the quarto.yml in my directory. I also reproduced this error on other repos.

I think this also has to do with a problem I was having with changing output-dir in _quarto.yml. I tried setting _quarto.yml: docs, but the output directory never showed up. It looks like quarto serve isn't seeing _quarto.yml for some reason.

Steps to reproduce

  1. git clone https://github.com/pommevilla/friendly-dollop.git
  2. cd friendly-dollop
  3. quarto serve

Error

  • See picture above.

System:

  • Windows 10

What should a file within a project look like?

In looking through the existing docs (cc @pommevilla @rich-iannone), I realized I never see an example of what goes inside a .qmd, .Rmd, etc. file within a chapter. I know the option to have a shared YAML, but I assumed that meant an individual item's YAML would override that.

In an existing Quarto book project, we have several chapters, with this YAML at the top as an example:

---
title: Importing data for the first time
---

## Introduction
some text here

When I render this, the level 2 header (## Introduction) is the chapter title. I would expect the title in the YAML to show up though instead. To get this outcome, we had to do:

---
title: Importing data for the first time
---

# Importing data for the first time

## Introduction
some text here

But even more surprising, if I have a bunch of text at the top then a header down below:

---
title: Importing data for the first time
---

lines and lines of text here
lines and lines of text here
lines and lines of text here
lines and lines of text here
lines and lines of text here

## Introduction

more text here

The same thing happens- the first ## Introduction header becomes the chapter title, and the placeholder between lines and lines of text here and more text here is gone. This appears to happen with the first header I provide, regardless of the level header (I tested up to level 5), and regardless of placement (as in, it could be paragraphs into the chapter and still get transported up to the chapter title).

  1. Are project files intended to have their own YAML, and if so, which options are valid there?
  2. If I'm not supposed to put the title in the YAML, will the chapter title always be the first header (regardless of level and placement)?

Navbar doesn't render logo and title at the same time

I updated the Quarto version in the Workbench Docker file to 0.2.34 and navbar title is no longer being printed out.

Here is the navbar render with v0.2.28:

image

And the navbar rendered with v0.2.34:

image

The yaml is the same between each render. If I comment out the logo in quarto-yml, then the navbar title will appear:

image

To reproduce

  • clone https://github.com/pommevilla/quarto-navbar-issue
  • quarto serve - the logo shows up in the navbar but the title doesn't
  • Comment out the logo line in _quarto.yml - the site title reappears.

Consider removing button focus effect on sidebar navigation?

When you click on a top-level item in the sidebar navigation, a blue box shadow shows up.

Screen Shot 2021-04-23 at 12 30 40 PM

Maybe considering removing the box shadow here?

.btn-check:focus + .btn, .btn:focus {
	outline: 0;
	/* box-shadow: 0 0 0 .25rem rgba(39,128,227,.25); */
}

Navbar right only works if left also present

My YAML:

site:
  navbar:
    type: light
    right:
      - text: "Home"
        file: index.Rmd
      - text: why

Looks like:
Screen Shot 2021-04-23 at 1 41 35 PM

If I add any left element:

site:
  navbar:
    type: light
    left: 
      - text: on your left
    right:
      - text: "Home"
        file: index.Rmd
      - text: why

Then the other elements correctly move to the right.
Screen Shot 2021-04-23 at 1 44 15 PM

code blocks without language tags have no visible bounding box

Using a development Quarto build (a53ce3b).

The Markdown file:

---
title: "commands and logs"
---

Let's celebrate Wilco, shall we?

```bash
for i in yankee hotel foxtrot ; do echo $(date) $i ; done > data.log
```

Your `data.log` file should now look like:

```
Wed Jun 30 13:01:08 EDT 2021 yankee
Wed Jun 30 13:01:08 EDT 2021 hotel
Wed Jun 30 13:01:08 EDT 2021 foxtrot
```

That's quite nice, no?

The quarto render log.md command produces HTML that does not have any sort of visible bounding box around the second code block (which has no language tag).

image

Compare to result produced by rmarkdown::render("log.md"):

image

Visually, the R Markdown version is nicer, as it marks the fixed-font region apart from the surrounding text.

I can appreciate that some fixed-font blocks won't want framing (background or border), but there doesn't appear to be a way of marking this as "program output" without giving it a language tag, which has additional baggage (syntax highlighting).

Workaround is to declare a custom highlighting syntax definition, making this look like a language when it isn't.

The modified Markdown:

---
title: "commands and logs"
syntax-definition: log.xml
---

...

```log
Wed Jun 30 13:01:08 EDT 2021 yankee
Wed Jun 30 13:01:08 EDT 2021 hotel
Wed Jun 30 13:01:08 EDT 2021 foxtrot
```

The syntax definition:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<language name="LOG Files" section="Configuration" extensions="*.log" mimetype="" version="10" kateversion="5.0" author="Jan Janssen ([email protected])" license="LGPL">

<highlighting>
  <contexts>
    <context name="log" attribute="Normal Text" lineEndContext="#pop">
    </context>
</contexts>
</highlighting>

</language>

Given this, the rendering becomes:

image

Advice for formatting according to output

Can I ask for advice about how to replicate some formatting we developed in Bookdown?

We were using the kableExtra package to tweak the formatting of tables, so it differed in HTML and PDF output. Specifically, we were using a custom table output function like this:

ketable <- function(df, caption) {
    rt <- kableExtra::kable(df, caption = caption, booktabs = T)
    if (knitr::is_latex_output()) {
        return(kableExtra::kable_styling(rt, latex_options = 'scale_down'))
    }
    # See https://cran.r-project.org/web/packages/kableExtra/vignettes/awesome_table_in_html.html
    # Update table-style.html to match
    kableExtra::kable_paper(rt,
                            lightable_options = c("striped", "hover"),
                            latex_options = c("striped", "scale_down"),
                            full_width = F,
                            position = "center"
    )
}

with some custom CSS to make our HTML tables look nice. Is there an equivalent way to tweak table formatting in Quarto? How can we make it differ according to output format (HTML or PDF)?

suggestion: emit directory links rather than "./index.html" links

Given a site defined by:

project:
  type: site

site:
  title: "self-linking"
  navbar:
    left:
      - href: index.md
        text: Home

and a single Markdown file:

---
title: self-linking
---

this is a link to [me](./).

The rendered content has a directory reference as its link:

<p>this is a link to <a href="./">me</a>.</p>

However, the navbar links are generated as file references to index.html. Here's one example:

  <a class="navbar-brand" href="./index.html">
    self-linking
  </a>

In comparison, a very similar mkdocs site (with a docs/index.md file):

site_name: self-linking

nav:
  - "home": index.md

produces navbar links like:

<a class="navbar-brand" href=".">self-linking</a>

This avoids leaking index.html into URLs.

Tweak anchored sidebar overflow CSS

With an anchored sidebar, the CSS shows:

.overflow-scroll {
	overflow: scroll !important;
}

I think this is causing the horizontal bar at the bottom of the sidebar here:
Screen Shot 2021-04-23 at 10 26 33 AM

Changing this to:

.overflow-scroll {
	overflow-y: scroll !important;
	overflow-x: auto;
}

Keeps the y axis scroll but (I believe) will only keep the x axis scroll if someone enters text that is too long:

Screen Shot 2021-04-23 at 10 29 22 AM

Quarto and R packages on Windows: different user lib depending on shell used

I tested Quarto this morning on Windows with various shells and stumbled again on an old issue regarding using R in terminal on Windows. This caused me pain with Quarto not finding the R packages depending on where it is used. Best thing would be to show you but in short: R user's lib path is not the same depending on the shell used ! It seems crazy but I think it relies on the HOME folder not being the same either. 

With an R Session on RStudio and cmd, lib path will be inside Documents

> Sys.getenv("R_LIBS_USER")
[1] "C:\\Users\\chris\\Documents/R/win-library/4.1"
> path.expand('~')
[1] "C:\\Users\\chris\\Documents"

but with Powershell or minGW, user lib path will be elsewhere, inside user directory.

> Sys.getenv("R_LIBS_USER")
[1] "C:\\Users\\chris/R/win-library/4.1"
> path.expand('~')
[1] "C:\\Users\\chris"

As I am an R users using mainly RStudio, my packages are installed in C:\\Users\\chris\\Documents/R/win-library/4.1. This causes Quarto to no find out R packages on Powershell and MinGW (quarto env results). It would require maintaining two user libraries to render the same no matter which tool is used.

This is an issue I already encountered when using Makefile with R. This home directory behavior is painful on Windows.

I am not sure which is the best solution, but I think this will clearly creates pain for users trying to use Quarto and R outside of RStudio. (Using Powershell or MinGW inside RStudio Terminal does not have this issue).

I opened this issue as notes for our discussions. Maybe one of you encountered that already

[FR] Quarto SASS variable to control padding of all non-navbar content

This may already exist, so please let me know if there is an easier way. Workbench team wanted more whitespace above the main content, and I wanted all the elements to stay aligned- this proved harder than I thought! It would be great if Quarto used a variable to control that top padding, which users could also grab onto and change. As is, this was a lot of trial and error, eyeballing things, and holding rulers up to my screen. Here was my outcome:

Screen Shot 2021-07-29 at 3 54 43 PM

And my CSS:

/* increase padding above ALL content */
.sidebar {
  padding-top: 50px;
}
.sidebar-menu-container {
  padding-top: 25px;
}
main {
  padding-top: 28px;
}

Notes on making a quarto-render Github Action

I took a stab at making a Github action that renders the contents of a repo. I'm definitely no actions expert, but I tested rendering R documents and Python documents windows-latest and ubuntu-latest. Short story: R was fine, but I ran into issue with Python because of the same Jupyter error I was seeing earlier last week. See the example workflows here.

Once the action is made, if the user wants to use it, they will have to supply a list of packages that they're using in their documents so that Quarto can actually render them. Python makes that easy with pip freeze > requirements.txt, and we can use Renv lockfiles to handle that for R. I haven't done much work with Julia, but it looks like we can do something similar (also here).

There may be some errors in installing packages depending on what OS the user is writing on. For instance, I wrote these examples on a Windows machine. When I went to test on ubuntu-latest, it ran into an error because pywin32 and pywinpty are Windows-only packages and won't install on Ubuntu. We can get around this either by structuring the requirements like this and calling the pip install command accordingly or by just parsing requirement files for platform-specific packages.

There will also probably be errors if the packages that the person is using is not found on CRAN, PyPI, or whatever the Julia equivalent is.

Rendering R Markdown documents seems to work fine. Here is an example workflow I wrote that installs the latest Quarto-CLI (hardcoded for now), restores the R packages used via Renv, and renders the RMarkdown file. Just a note that sometimes this Install packages step took a long time for the R case, sometimes upwards of 10 minutes. There's also an example step at the bottom that pushes the new renders to the repo.

I only tested R on Ubuntu because setting up Quarto through Github Actions was...challenging. I originally tried to do silent install via msiexec, but I wasn't able to get the options I found via Orca to work. I eventually ended up using Christophe's scoop bucket to get it to work on windows-latest, but then scoop wasn't persisting between steps, so I had to make everything into one big step and it kind of sucks. This is my first time writing actions, though, so I'm probably forgetting something.

Quarto's having problems rendering Python, though, and it's the same error I was experiencing with running quarto commands on Windows outside of the symbolic link that the development version of quarto-cli sets up - quarto is unable to start up a Jupyter kernel, producing this error:

image

I reproduced this problem on Linux and Windows (I had to make it all one big step in the Windows workflow because scoop wasn't persisting between steps for some reason).

I remember that this error has to do with Quarto starting a Jupyter daemon in the background - I just wanted to share this issue so everyone's aware of it.

Appropriate time for user feedback?

I just discovered quarto and it looks like an amazing project! Is the current state of the project ready for general user feedback from those not in the dev team? I'm always eager to help 😄

Passing non default extension to markdown input format

Using command line I can do

pandoc --from markdown+emoji --to revealjs -s -o test.html test.qmd

Is this supporting in quarto ? I tried a few thing with odd result

Doing

---
format: revealjs
variant: +emoji
---

will lead to adding the extension to the to format

pandoc 
  to: revealjs+emoji
  from: markdown
  standalone: true
  filters:
    - crossref

I also tried at command line but no luck passing the --from argument from pandoc command line to quarto render. It does the same (moving the extensions to the to format)

❯ quarto render test2.qmd --from markdown+emoji
pandoc --from markdown+emoji
  to: revealjs+emoji
  from: markdown
  standalone: true
  filters:
    - crossref

metadata
  hash: true

The extension emoji is not supported for revealjs
❯ quarto render test2.qmd --to revealjs --from markdown+emoji
pandoc --from markdown+emoji
  to: revealjs+emoji
  from: markdown
  standalone: true
  filters:
    - crossref

metadata
  hash: true

The extension emoji is not supported for revealjs

test file

---
title: test
format: revealjs
# variant: +emoji
---

# Slide with emoji

Here is a emoji

:smile:

Remove anchor link from sidebar title, or ensure title text is centered

Here is my sidebar:

  sidebar:
    title: "Quarto Demo"
    tools:
      - icon: twitter
        href: https://twitter.com
      - icon: github
        menu:
          - text: Source Code
          - url:  https://code.com
          - text: Report a Bug
          - url:  https://bugs.com

I don't think the anchor link is actually necessary for that header, but it is also causing the title to not be centered, and the icon alignment looks off because of it:

Screen Shot 2021-04-23 at 10 19 40 AM

The subtitle is centered because it does not have a header tag, and hence no anchor link.

On controlling code folding's initial state

The Wiki introduces how to control the caption of code fodling with the fold chunk option.
However, I think the caption should be tweaked by different chunk option, and the fold chunk option rather control if fold is initially open or closed (e.g., fold="open", fold="closed").

Of course we can keep the current implementation and have another chunk option to specify the initial state.

https://github.com/quarto-dev/quarto-cli/wiki/Rendering-Rmds#code-folding

Windows release not working

The last Quarto version to work for me on Windows was v0.2.28. When I install v0.2.32 or v.02.34 and run quarto check, I get this error:

image

I get the same error on serve, render, and preview.

FWIW, the v0.2.34 executable in the Workbench Docker container is working with no problems

code block given newline

Using a development Quarto build (a53ce3b).

The Markdown file:

---
title: "code block newline"
---

``` {.dockerfile}
RUN curl -fsSL -O https://cdn.rstudio.com/r/${R_DISTRIBUTION}/pkgs/${R_INSTALLER} && \
    export DEBIAN_FRONTEND=noninteractive && \
    apt-get update && \
    apt-get install -f -y ./${R_INSTALLER} && \
    rm ${R_INSTALLER} && \
    rm -rf /var/lib/apt/lists/*
```

quarto render has the code block with an additional line of whitespace between the RUN curl and the export DEBIAN... lines.

image

This may be related to #44, which documented a different consequence of long-lines in code blocks.

Mathematical content in chapter headings not always recognized

I am test-driving quarto by converting my old diploma thesis originally done in LaTeX to it. I have found that math content in headings is sometimes not correctly displayed, e.g. https://rstub.github.io/diploma-thesis/period_efa.html:

  • In the main text the math content is correctly shown in both the chapter and the section heading
  • The math content in the section heading is also correctly shown in the on-page TOC
  • The math content from the chapter heading and the title is shown in raw form in the main TOC and on the chapter navigation lins in the previous/next chapter

Anything I can do to fix this?

In addition, I have the impression that the math content in the chapter heading is breaking recognition of the chapter label. At least I don't see what is wrong with https://github.com/rstub/diploma-thesis/blob/main/period_efa.qmd#L7 and the label works once I remove the math content. However, references to section 2.1 with the same math content do work w/o problems. Any idea what is going on here?

BTW, is there a way to retain the intermediate markdown files (after knitr/jupyter but before pandoc)? That would help me debugging stuff like this.

revealjs quoting of some option is not correct

Take this

---
title: test
format: 
  revealjs:
    slideNumber: 'c/t'
---

## slide 1

## Slide 2

It won't work as expected because Quarto is quoting and adding parenthesis '(c/t)'

        // Display the page number of the current slide
        slideNumber: '(c/t)',

// quote slideNumber
scriptEl.innerText = scriptEl.innerText.replace(
/slideNumber: (h[\.\/]v|c(?:\/t)?)/,
"slideNumber: '($1)'",
);

The parenthesis needs to be removed.

cc @apreshill I think this is the error you encountered

Bootstrap navbar-bg SASS variable does not work

Hello (related to Workbench docs conversion)-

/*-- scss:defaults --*/
$navbar-bg: #fff;

I also tried: $navbar-light-bg. Is there a different variable that works here? No matter what I try to change I see:
Screen Shot 2021-07-29 at 11 06 17 AM

This ultimately works, but a Bootstrap SASS variable should work:

/*
.bg-primary {
  background-color: #ffffff !important;
}*/

Rendering a basic Rmd on Windows throws lua filter errors

I'm rendering a very basic Rmd that knits just fine:

test2.Rmd

    ---
    title: "Building R from source"
    author: "Andrie de Vries"
    date: "6 July 2018"
    output: 
      html_document: 
        self_contained: no
    ---
    
    ```{r setup, include=FALSE}
    knitr::opts_chunk$set(echo = TRUE)
    ```
    
    Some text

I then run quarto render .\test2.Rmd but I get this error:

Error running filter C:/Program Files/Quarto/share/filters/quarto-pre/quarto-pre.lua:
...ram Files/Quarto/share/filters/quarto-pre/quarto-pre.lua:1343: attempt to index a nil value (local 'f')
stack traceback:
        ...ram Files/Quarto/share/filters/quarto-pre/quarto-pre.lua:1343: in function 'readIncludeFiles'
        ...ram Files/Quarto/share/filters/quarto-pre/quarto-pre.lua:1307: in function <...ram Files/Quarto/share/filters/quarto-pre/quarto-pre.lua:1299>
SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at runPandoc (file:///C:/Program%20Files/Quarto/bin/quarto.js:19872:36)
    at async renderPandoc (file:///C:/Program%20Files/Quarto/bin/quarto.js:20008:27)
    at async renderFiles (file:///C:/Program%20Files/Quarto/bin/quarto.js:17379:34)
    at async render (file:///C:/Program%20Files/Quarto/bin/quarto.js:17788:22)
    at async Command.fn (file:///C:/Program%20Files/Quarto/bin/quarto.js:20208:29)
    at async Command.execute (file:///C:/Program%20Files/Quarto/bin/quarto.js:1812:17)
    at async Command.parse (file:///C:/Program%20Files/Quarto/bin/quarto.js:1765:20)
    at async Command.parse (file:///C:/Program%20Files/Quarto/bin/quarto.js:1727:20)
    at async quarto1 (file:///C:/Program%20Files/Quarto/bin/quarto.js:24974:5)

My environment:

PS C:\Users\apdev\Documents\github\experiments\zendesk_articles> quarto help

  Usage:   quarto
  Version: vv0.1.117

Python not found by Quarto

I've been getting this error whenever I try to render Python code:

image

I'm running the code from the Hello, Quarto example. I'm able to execute it as a Jupyter Notebook and as standalone Python script and save the output as an image. This error happens when I try to render it either as a Jupyter Notebook or as a qmd file.

I thought this might have been because I was originally doing this from a conda virtual environment, but I uninstalled all the Python versions on my machine and did a fresh reinstall and am still getting the same error.

The path given by which python matches the one in my quarto env...

image

image

...though there is another entry in there that I'm not quite sure got there.

This is on the most recent version of quarto-cli though it has been happening for the past couple of days.

Difficulties re-rendering qmd documents containing only Julia code

After installing IJulia and JuliaCall on Windows 10, I'm able to get qmd files containing R, Python, and Julia running (though it seems to be running quite slowly). If I try to render a qmd only containing Julia code, a Julia daemon pops up and the file renders fine as long as I keep that open. If I close it, a new daemon doesn't start and I get this error:
image.

If I restart the quarto-cli shell and try to render it again, I get the same error. If I open Task Manager and close this Python application...

image

...I'm able to render Julia files again. I'm guessing it has something to do Julia being computed through a Jupyter kernel and even though the Julia daemon gets closed, the Python/Jupyter app is staying open and messing with stuff.

Steps to reproduce

A small example file named julia.qmd:

---
title: "Matplotlib Demo"
author: "Norah Smith"
date: "May 22nd, 2021"
format: 
  html:
    code-fold: true
---
## Julia 

```{julia}    
using Plots
x = 1:10; y = rand(10, 2);
plot(x, y)
```

I then ran quarto render julia.qmd and ran into the experience outlined above.

Navbar not rendering shortcodes

Shortcodes for values in _variables.yml are not rendering properly in navbars:

image

They work in the titles of individual documents, though:

--- 
title: "RStudio Workbench {{< var version >}}"
date: "`r Sys.Date()`"
--- 

image

Relevant _quarto.yml:

site:
  title: "RStudio Workbench Administration {{< var version >}}"
  navbar:
    type: light
    # title: "RStudio Workbench Administration {{< var version >}}"

The shortcode isn't evaluated properly regardless of which title line is being used.

Here's a repo with a minimal example: https://github.com/pommevilla/navbar-shortcodes

404 not behaving correctly for subdirectories

I have a 404.md in the root directory of the preview site for the Workbench redesign:

When I serve this locally, the 404 page works as expected: going to http://localhost:4848/fake.html and http://localhost:4848/getting_started/fake.html both show the correctly rendered 404 page and in both cases I am able to navigate away via the sidebar and the navbar.

When I try this on the live preview site, the 404 page correctly renders for https://pommevilla.github.io/incog-workbench/fake.html and I am able to navigate away as above. However, when I try https://pommevilla.github.io/incog-workbench/getting_started/fake.html, the 404 page doesn't render correctly and I can't navigate away from the sidebar and the url just keeps piling up as I click around to something like https://pommevilla.github.io/incog-workbench/getting_started/getting_started/authenticating_users/access_and_security/access_and_security/authenticating_users/access_and_security/secure_sockets.html - all the links I'm clicking are taken as relative to the directory of the incorrect page.

I've set site-url: https://pommevilla.github.io/incog-workbench. I tried this with and without the permalink: /404.html suggested by Github here and still get the same behavior.

I looked around and found several places saying that custom 404 pages for subdirectories don't work when served out of the root directory: here. Since the issue seemed to be around working out of a subdirectory, I copied the repo and hooked that up to a custom domain, but I'm still getting the same behavior: links like https://incog-workbench.com/broken.html work fine, but links like https://incog-workbench.com/load_balancing/broken.html still lead to the same behavior above.

Puzzling difference in behavior of code chunks in lists

When porting a project from Bookdown, I found the following behavior surprising.

We are embedding code chunks in list items, for example:

#.  First item:

    ```{python}
    print("First item code")
    ```

When using rmarkdown::render(), this executes and renders as I would expect with the rendered code output under the indented code block.

When rendering the same Rmd file in Quarto, the code executes correctly, but the rendered doc has lots of stray Markdown in it, such as:

::: {.cell indent=” “}

```{.python .cell-code}
print("First item code")
```

::: {.cell-output-stdout}
```
First item code
```
:::

:::

With Qmd format, the rendering does not interpret the in-list code blocks correctly, and leaves output like the following:

    First item:

    print(“First item code”) ```

The repo https://github.com/matthew-brett/quarto-test/tree/main has a MWE of Markdown, Rmd via Quarto, Rmd via rmarkdown, and Qmd format, generated with make all.

I am using the latest development version of Quarto, as of this evening.

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.