Skip to content

Add html rendering pathway - #3027

Draft
agoose77 wants to merge 2 commits into
mainfrom
feat-add-template-rendering
Draft

Add html rendering pathway#3027
agoose77 wants to merge 2 commits into
mainfrom
feat-add-template-rendering

Conversation

@agoose77

Copy link
Copy Markdown
Contributor

Our existing HTML rendering pathway is facilitated by mystmd. There's no direct need to do things this way. This PR adds an opt-in rendering pathway for themes to implement HTML rendering, which permits a theme to e.g. use a SSG approach.

@changeset-bot

changeset-bot Bot commented Aug 17, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: b52fb29

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@rowanc1 rowanc1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A few comments when looking on my phone on pushing more responsibility to the render function if it is provided.

I would say we go all or nothing TBH. If there is a render html, it should do everything (including favicon, sitemap, js copy). "Given this content make it an html site in this directory".

Comment on lines +246 to +250
// This always includes the thebe JS chunks, even when no project enables
// `thebe`/`jupyter`. The myst-theme uses thebe-core to render Jupyter cell
// outputs, so these chunks are required for outputs to render at all.
const templateBuildDir = path.join(template.templatePath, 'public');
fs.copySync(templateBuildDir, htmlDir);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This should probably be the responsibility of theme render function if provided of ensuring all assets are available. (Might need to pass template directory in as env variable?)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This code-path is only for the existing rendering (if a template doesn't support HTML rendering). My view is that we deprecate this, but remove it later.

// We need to go through and change all links to the right folder
rewriteAssetsFolder(htmlDir, baseurl);
}
await appServer.stop();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If the template is in charge of rendering html, then we shouldn't have to start the server (some could probably do it without a server, but it should be a template choice).

@agoose77 agoose77 Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yep, we only want the content server. To-do!

@agoose77

Copy link
Copy Markdown
Contributor Author

@rowanc1 yes - this is a WIP that I wanted to push whilst I'm OoO!

There are nuances around non route paths, but I've made some progress on the theme side to just proxy those routes such that we should be able to eliminate special cases on the mystmd side

@agoose77
agoose77 marked this pull request as draft August 18, 2026 11:33
@agoose77
agoose77 force-pushed the feat-add-template-rendering branch from 9f3ca76 to b52fb29 Compare August 24, 2026 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants