quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.75k stars 306 forks source link

Book Part with no chapter is not linked #6474

Closed ratnanil closed 1 year ago

ratnanil commented 1 year ago

Bug description

I have a book containing parts. One part, namely my References.qmd, does not contain chapters. The qmd File is rendered, but regretfully not linked in the sidebar.

Steps to reproduce

Create a book project

quarto create project book # create a book project

In the file _quarto.yml, do the following changes

book:
  title: "·"
  author: "Norah Jones"
  date: "8/9/2023"
  chapters:
   - index.qmd
-  - intro.qmd
-  - summary.qmd
-  - references.qmd
+  - part: "references.qmd"

Render the project

quarto render

Expected behavior

"References" in the sidebar panel should be a Hyperlink to /References.html

Actual behavior

"References" in the sidebar panel is not a Hyperlink

(Note the colour of References in the screenshot below)

image

Your environment

Quarto check output

quarto check

[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.1: OK
      Dart Sass version 1.55.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.3.361
      Path: /opt/quarto/bin

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.10.12
      Path: /usr/bin/python3
      Jupyter: (None)

      Jupyter is not available in this Python installation.
      Install with python3 -m pip install jupyter

[✓] Checking R installation...........(None)

      Unable to locate an installed version of R.
      Install R from https://cloud.r-project.org/

R is not probably not detected because I'm working with a docker container. If I run R --version in the termial, I get:

R --version
R version 4.2.3 (2023-03-15) -- "Shortstop Beagle"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under the terms of the
GNU General Public License versions 2 or 3.
For more information about these matters see
https://www.gnu.org/licenses/.
mcanouil commented 1 year ago

You cannot have parts without chapters. Parts require chapters.

book:
  title: "Issue6474"
  author: "Norah Jones"
  date: "8/10/2023"
  chapters:
    - index.qmd
    - part: intro.qmd
      chapters:
        - summary.qmd
        - references.qmd

I don't believe this to be a bug. @dragonstyle in case you have a different opinion.

ratnanil commented 1 year ago

Is there a reason that a chapter is mandatory for a part? Note that the only thing missing is the hyperlink to References in the sidebar. The page itself exists already. The hyperlink does exist if the part does have chapters (see example below)

book:
  title: "Quarto-test"
  author: "Norah Jones"
  date: "8/10/2023"
  chapters:
    - index.qmd
    - part: intro.qmd
      chapters: 
      - summary.qmd
    - part: references.qmd

image

mcanouil commented 1 year ago

I don't understand why do you need a part? Isn't the following enough?

Part is about nesting chapters which is not what you want.

book:
  title: "Issue6474"
  author: "Norah Jones"
  date: "8/10/2023"
  chapters:
    - index.qmd
    - part: intro.qmd
      chapters:
        - summary.qmd
    - references.qmd
ratnanil commented 1 year ago

OMG I completely missed that. I was so stuck in the partchapter hierarchical system that I did not know that this works. Thanks for the solution!

mcanouil commented 1 year ago

The "Preface" (from index.qmd) was maybe too obvious^^

I am going ahead and close this.