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

Readme does not render in Quarto website #317

Open
tony-aw opened this issue Feb 26, 2025 · 9 comments
Open

Readme does not render in Quarto website #317

tony-aw opened this issue Feb 26, 2025 · 9 comments

Comments

@tony-aw
Copy link

tony-aw commented Feb 26, 2025

The Readme does not render in a Quarto: it is displayed as a raw markdown file (i.e. how a markdown file would look when you open it with a text editor or something).
Moreover, the "Home" button points to index.md, instead of index.html.

@etiennebacher
Copy link
Owner

I have made some changes to harmonize the behavior depending on what type of README is used (qmd, Rmd, or md only). Maybe I missed some stuff, could you try with the github version of altdoc (v.0.5.0.9000) and with the CRAN version (v.0.5.0) and let me know if one of them works?

@tony-aw
Copy link
Author

tony-aw commented Feb 26, 2025

I already tried both the CRAN and devel version before posting this issue, and both failed.
Quarto is up-to-date (both the package and the program).

@etiennebacher
Copy link
Owner

etiennebacher commented Feb 26, 2025

What kind of README do you have? Is it a qmd or Rmd file that you render to md, or do you just have README.md?

@tony-aw
Copy link
Author

tony-aw commented Feb 26, 2025

I have a README.qmd file, and I tried rendering it to md and gfm. I also tried removing anything from the Readme that isn't simple text (i.e. images and code), but altdoc still fails to render the readme properly.

Suggestion: Ask users to render Readme to html just like the vignettes. That might save you a lot of headaches (i.e. altdoc could treat Readme file just like any other vignette).

@vincentarelbundock
Copy link
Collaborator

I found that the README.qmd file should not have a YAML at all, and especially not a preamble instructing building to gfm.

It can still be rendered with this of course

quarto render README.qmd --to gfm

@etiennebacher
Copy link
Owner

It seems indeed that the YAML in README.qmd causes a problem. Ideally we would detect it and warn the user to remove it.

@tony-aw
Copy link
Author

tony-aw commented Feb 26, 2025

I tried this.
This solves part of the problem, in that the website starts with a rendered Readme.

But the "home" button will still point to index.md when you click on the home button.
And badges are not rendered properly in the Readme file (other images seem to work fine).

I also noticed this technique causes altdoc to give the following warning many times in a row:
WARN: Unable to resolve link target: index.md

@etiennebacher
Copy link
Owner

Ah I see, in altdoc/quarto_website.yml you need to replace index.md by index.qmd.

This is also sth we should detect automatically I think.

@tony-aw
Copy link
Author

tony-aw commented Feb 27, 2025

Yes, that fixes the rendering of the readme when clicking on the "home" button.
I also fixed the badges (in my attempts to fix the Readme, I accidentally removed library(badger))

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

No branches or pull requests

3 participants