quarto-dev / quarto-dev/quarto-cli
Allow opting out extension name part in `format-link` text when customizing content
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 6k
- Forks
- 458
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 41
Description
It seems not possible today to really customize fully the text as the extension name will always be appended in parenthesis if the format comes from an extension
Should we add a new option to allow overriding this ?
Or should just an example showing the href form be used instead for those situation ?
https://quarto.org/docs/output-formats/html-multi-format.html#specifying-formats-to-link
To think about.
Discussed in https://github.com/quarto-dev/quarto-cli/discussions/10270
Originally posted by aaronschiff July 11, 2024
Description
This is pretty minor but ... I care about details 😅
I have a project that produces html and pdf output via a custom Typst template. I have used format-link in the project's _quarto.yml file to change the way the link to the Typst output is displayed in the html table of contents, but it still includes the template's name in brackets. Is there a way to remove the template name?
Here is the relevant part of the project _quarto.yml, where my template is called "cheatsheet":
format:
html:
toc: true
cheatsheet-typst:
toc: false
format-links:
- html
- format: cheatsheet-typst
text: PDF
icon: file-pdf
Here's link in the rendered html:
I'd like it to just say "PDF".
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/format/html/format-html-links.ts around lines 95-104, then review the format-links example in the HTML multi-format documentation. Determine how customized text for extension formats should suppress the appended extension name, and verify that the resulting link displays only the configured text such as “PDF”.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- web-dev
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100