Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: does not require README.qmd for Quarto website #295

Merged
merged 6 commits into from
Oct 5, 2024

Conversation

eitsupi
Copy link
Contributor

@eitsupi eitsupi commented Oct 4, 2024

Fix #292

I don't know if ideally we should render README.Rmd / qmd, but we should be able to fix the error for now anyway.

@vincentarelbundock
Copy link
Collaborator

I believe that Quarto requires a index.qmd file, otherwise it will not build the website.

Currently, we enforce README.qmd and copy that over as index.qmd. If you want to make that change, my guess is that you'll have to convert README.md to index.qmd and ensure that it contains valid Quarto code.

@eitsupi
Copy link
Contributor Author

eitsupi commented Oct 4, 2024

I believe that Quarto requires a index.qmd file, otherwise it will not build the website.

No, Quarto CLI does not require any qmd file; if an index.html file is required, the source file can be index.md, index.Rmd, index.ipynb, or whatever.

@vincentarelbundock
Copy link
Collaborator

No, Quarto CLI does not require any qmd file; if an index.html file is required, the source file can be index.md, index.Rmd, index.ipynb, or whatever.

Could this possibly depend on the output format? Here, we output to a "website" format.

If you're very confident and add a test for a toy repo without README.md that builds properly, we should of course move forward.

I'm just surprised because I think I remember adding this check because we got bug reports from users who had README.md but not README.qmd.

@eitsupi
Copy link
Contributor Author

eitsupi commented Oct 4, 2024

Could this possibly depend on the output format? Here, we output to a "website" format.

I am sure Quarto will not require qmd files in any output format (otherwise it would be very difficult to use for users who only want to use ipynb, right?)
For example, there is not a qmd file in this repository (website source), but it has been around since before the Quarto CLI reached version 1.
https://github.com/rocker-org/website

@vincentarelbundock
Copy link
Collaborator

good example, thanks.

@eitsupi eitsupi marked this pull request as ready for review October 4, 2024 17:00
@eitsupi
Copy link
Contributor Author

eitsupi commented Oct 4, 2024

I believe the test project is now rendering correctly.

@vincentarelbundock
Copy link
Collaborator

@etiennebacher This seems like a clear improvement to me. Do you want to check before merging?

@etiennebacher
Copy link
Owner

Thanks both, I'll take a quick look later today

@vincentarelbundock
Copy link
Collaborator

I can't seem to build the marginaleffects website with this branch. It's a rather complicated website which requires a reticulate virtual environment with some packages. So not sure either of you will want to try it, but I'll post the error message here.

At first glance, it seems related to the index.md change.

[56/57] index.md
ERROR: You must use the .qmd extension for documents with executable code.

Stack trace:
    at Object.execute (file:///Applications/quarto/bin/quarto.js:40980:23)
    at renderExecute (file:///Applications/quarto/bin/quarto.js:78226:48)
    at renderFileInternal (file:///Applications/quarto/bin/quarto.js:78394:49)
    at eventLoopTick (ext:core/01_core.js:153:7)
    at async renderFiles (file:///Applications/quarto/bin/quarto.js:78262:17)
    at async renderProject (file:///Applications/quarto/bin/quarto.js:78672:25)
    at async Command.actionHandler (file:///Applications/quarto/bin/quarto.js:83271:32)
    at async Command.execute (file:///Applications/quarto/bin/quarto.js:8018:13)
    at async Command.parseCommand (file:///Applications/quarto/bin/quarto.js:7908:20)
    at async quarto (file:///Applications/quarto/bin/quarto.js:118497:9)
Error in `quarto::quarto_render()`:Error running quarto cli.
Caused by error:
! System command 'quarto' failed
Backtrace:1. └─altdoc::render_docs(verbose = TRUE, freeze = TRUE)
  2.   └─altdoc:::.import_settings(...)
  3.     └─altdoc (local) finalize(settings, path, verbose, freeze)
  4.       └─quarto::quarto_render(...)
  5.         └─quarto:::quarto_run(args, echo = TRUE, quarto_bin = quarto_bin)
  6.           └─base::tryCatch(...)
  7.             └─base (local) tryCatchList(expr, classes, parentenv, handlers)
  8.               └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
  9.                 └─value[[3L]](cond)
 10.                   └─cli::cli_abort(msg, call = .call, parent = e)
 11.                     └─rlang::abort(...)
Execution halted
make: *** [website] Error 1

@eitsupi
Copy link
Contributor Author

eitsupi commented Oct 5, 2024

I can't seem to build the marginaleffects website with this branch.

My guess is that this is where this comes from.
https://github.com/vincentarelbundock/marginaleffects/blob/64b946a6443ad143bb4d25bcc24357ec1e501bad/README.md?plain=1#L94-L101

``` {latex}

I have never seen this notation before, what is the need for it?
If I understand correctly, this is not actually an executable code block, so I think this needs to be fixed.

@eitsupi
Copy link
Contributor Author

eitsupi commented Oct 5, 2024

@vincentarelbundock
Copy link
Collaborator

Wow @eitsupi you're very good at this. Solves it. Thanks. I'll stop bugging you now.

@eitsupi
Copy link
Contributor Author

eitsupi commented Oct 5, 2024

Never mind, I am glad you were able to resolve the issue! (I know nothing about latex......)

@etiennebacher
Copy link
Owner

Thanks, LGTM, especially if it doesn't break the docs of other packages. I'll merge but any idea about the windows failure?

@etiennebacher etiennebacher merged commit 011cea5 into etiennebacher:main Oct 5, 2024
4 of 5 checks passed
@eitsupi eitsupi deleted the index.qmd branch October 6, 2024 01:28
@eitsupi
Copy link
Contributor Author

eitsupi commented Oct 6, 2024

any idea about the windows failure?

I have no idea.

Where does Rplots.pdf come from?

@eitsupi eitsupi mentioned this pull request Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Quarto] Why requires README.qmd?
3 participants