downlit
Syntax Highlighting and Automatic Linking
downlit provides syntax highlighting and automatic linking for R code in documentation. It’s designed to work with RMarkdown packages like pkgdown, bookdown, and hugodown to turn code references into clickable links to documentation.
The package automatically links function calls, help topics, vignettes, and package names to their documentation, either on pkgdown sites or fallback sources like rdrr.io. It handles both multiline code blocks (with syntax highlighting and comment styling) and inline code references. Cross-package linking works by discovering pkgdown metadata, making it easy to create interconnected documentation across R packages.
Contributors#
Resources featuring downlit#
Beautiful reports and presentations with Quarto | Led by Tom Mock, RStudio
Quarto is a powerful tool for authoring reproducible computational documents in R, Python or Julia. Quarto can also help with sharing your results to business stakeholders across your company. This talk will provide an overview of Quarto’s implementation of revealjs for interactive presentations and HTML/PDF documents for static reports.
Content website: rstd.io/quarto-reports
Timestamps: 2:55 - Start of session 4:10 - Visual editor in RStudio 6:20 - Parameters to create different variations of a report 15:30 - Unified syntax across different output formats 18:01 - Pandoc fenced divs 20:10 - Tabsets 22:22 - Pandoc bracketed spans 24:30 - Footnotes 26:30 - Layout image inline with paragraphs / image into “gutter” column margin 29:23 - Hide all code 29:50 - Code tools (Fold code, source code) 34:12 - Code highlighting 37:03 - HTML Appearance 38:00 - Bootswatch themes 38:43 - PDF Articles 42:05 - Presentations (revealjs (HTML), PowerPoint (MS Office), beamer (LaTeX, PDF)) 45:06 - Creating slides 47:53 - Multiple columns 48:28 - Secret Tip (Alt + Click to Zoom in to a section) 49:24 - Absolute Position 51:04 - Presentation themes 52:44 - Footer/Logo 54:01 - Slide Background 57:01 - Custom classes 58:35 - End slide with helpful links (all shared here: rstd.io/quarto-reports)
This meetup is Part 3 in our Quarto series: Part 1: Welcome to Quarto Workshop: https://www.youtube.com/watch?v=yvi5uXQMvu4 Part 2: Building a Blog with Quarto: https://youtu.be/CVcvXfRyfE0 For more about Quarto: quarto.org
Resources discussed: Visual editor: https://quarto.org/docs/visual-editor/ Parameters: https://quarto.org/docs/computations/parameters.html Tabsets: https://quarto.org/docs/interactive/layout.html#tabset-panel Fenced Divs and Bracketed spans: https://quarto.org/docs/authoring/markdown-basics.html#divs-and-spans Footnotes: https://quarto.org/docs/authoring/footnotes-and-citations.html Figures and figure layouts: https://quarto.org/docs/authoring/figures.html#complex-layouts Code execution options: https://quarto.org/docs/computations/execution-options.html Code chunk format options: https://quarto.org/docs/reference/formats/html.html#code Code appearance: https://quarto.org/docs/output-formats/html-code.html#appearance Code highlighting light/dark: https://quarto.org/docs/output-formats/html-code.html#appearance Function links in code chunks with downlit: https://quarto.org/docs/output-formats/html-code.html#code-linking HTML Themes: https://quarto.org/docs/output-formats/html-themes.html PDF formatting options: https://quarto.org/docs/reference/formats/pdf.html#title-author PDF journal templates: https://quarto.org/docs/journals/templates.html Presentations: https://quarto.org/docs/presentations/index.html Revealjs Options: https://quarto.org/docs/presentations/revealjs/ Advanced Revealjs (absolute positioning, layout helpers like r-stack): https://quarto.org/docs/presentations/revealjs/advanced.html Revealjs themes and customizing: https://quarto.org/docs/presentations/revealjs/themes.html Revealjs footer & logo: https://quarto.org/docs/presentations/revealjs/index.html#footer-logo Inline span text formatting: Emil Hvitfeldt’s Slidecraft 101: Colors and Fonts, https://www.emilhvitfeldt.com/post/slidecraft-colors-fonts/ Meghan Hall’s Quarto Slides, https://meghan.rbind.io/blog/quarto-slides/ Andrew Heiss’ Quarto slides on APIs and webscraping with R, https://github.com/andrewheiss/2022-seacen
Speaker bio: Thomas is the Customer Enablement Lead at RStudio, helping RStudio’s customers be as successful as possible. He is deeply involved in the global data science community, sharing tips on RStats Twitter (find him at @thomas_mock), as co-founder of TidyTuesday, a weekly Data Science learning challenge, and presenting on various Data Science topics on YouTube or at conferences.
For upcoming meetups: rstd.io/community-events
