Skip to content

Conversation

@ben-schwen
Copy link
Member

@ben-schwen ben-schwen commented Dec 26, 2025

Closes #6584

Much appreciated if someone with more web dev skills than me can fix .css styling :D

image

Whats still missing to be fully equivalent to pkgdown

  • favicon
  • TOC in NEWS

@ben-schwen
Copy link
Member Author

We need to finish either this PR or #7402 since otherwise our dev version is not building in CI! cc @Rdatatable/committers

@jangorecki
Copy link
Member

We don't need docker image for litedown, it was needed for pkgdown because of maaany OS deps. For litedown we can use one of our other docker images.

'<body>',
navbar_html,
'<div class="body">',
html_content,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great to find a way to avoid starting the HTML document from scratch here:

<div class="body">
<!-- DOCTYPE and <html>, <head> below are invalid -->
<!DOCTYPE html><html><head><title>R: Integer based date class</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css">
<script>
const macros = { "\\R": "\\textsf{R}", "\\mbox": "\\text", "\\code": "\\texttt"};
function processMathHTML() {
    var l = document.getElementsByClassName('reqn');
    for (let e of l) { katex.render(e.textContent, e, { throwOnError: false, macros }); }
    return;
}</script>
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.js"
    onload="processMathHTML();"></script>
<link rel="stylesheet" type="text/css" href="R.css">
<!-- starting a new <body> inside a <body> is invalid -->
</head><body><div class="container"><main>

litedown::pkg_manual() does it using scary regexp hacks.

@aitap
Copy link
Member

aitap commented Jan 17, 2026

Somehow, in our case, the indentation added by litedown:::build_toc is misinterpreted by commonmark::markdown_html as an indented code block, so fuse() outputs <code><pre>- &lt;nav&gt;...</pre></code> instead of the table of contents. Are we holding it wrong?

Edit: that's easily fixed by making the first heading of NEWS.md a level-1 heading instead of level-2. Now the problem is that with css: ['@default', '@article'], js: ['@sidenotes'] the left-side TOC easily floats outside the window border because the main content is too wide.

In order to use fancy left-side TOC, we'll need

    meta:
      css: ['@default', '@Article']
      js: ['@sidenotes']

in the YAML header and

    .body {
      max-width: 800px;
    }

in the global site styles.
@@ -1,4 +1,4 @@
## data.table news and updates
# data.table news and updates
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there was a reason for that, @MichaelChirico any idea?

@aitap
Copy link
Member

aitap commented Jan 18, 2026 via email

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.

Use litedown instead of pkgdown

3 participants