ccamara
ccamara

Reputation: 1225

Can't include a md file in a quarto book page

I'd like to include the readme.md file in the index of a quarto book (so I do not need to duplicate content).

According to these instructions in the official documentation, that should be possible.

This is my current structure:

/folders
...
_quarto.yml
index.qmd
README.md
...

This is my index.qmd file:

# Preface {.unnumbered}

This is a Quarto book.

{{< include README.md >}}

Regretfully, the readme file is not included. Instead, {{< include README.md >}} is printed as a text.

EDIT:

I have created this github project:https://github.com/ccamara/quarto-book-test . You can see the outputs here: https://ccamara.github.io/quarto-book-test/

This is what I've done so far:

  1. Create a default project: quarto create-project mybook --type book
  2. Create a README.mdfile in the project's root
  3. Edit index.md (in the project's root) and added {{< include README.md >}}
  4. Run quarto preview
  5. I get a warning stating WARNING: Shortcode include is not recognized.
  6. index.md does not render README.mdcontents, instead it displays the include shortcode as a regular text (see screnshot below).

screenshot

Upvotes: 2

Views: 976

Answers (1)

Carlos Scheidegger
Carlos Scheidegger

Reputation: 1966

I can't reproduce, unfortunately. I recreated your example, and got this:

enter image description here

This happens in quarto preview and quarto render both. What version and OS are you running? Can you run this and report the result? Thanks.

$ quarto --version

Upvotes: 2

Related Questions