Conversation
…o not always return a Boolean value
🦋 Changeset detectedLatest commit: 76eecdb The changes in this PR will be included in the next version bump. This PR includes changesets to release 15 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for myst-theme ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
I think it'd be helpful if we let users easily define scienceicons in the book/article themes 👍 . Based on this implementation, it seems like we don't actually add any user-facing functionality, right? They'd still need to follow these instructions on their own from the science icons docs: I also suspect that if they did this, and then wrapped the icons in a link (which seems to me the most common use-case), that they'd inherit the blue link syntax we use for prose. That feels suboptimal as well - we'd probably want "theme styling" for scienceicons when they're used. Depending on our implementation, this might need a change in scienceicons since they don't emit a CSS class name w/ the icon so we can style it (e.g. Could we enable more "out of the box" functionality here by either:
@rowanc1 what's your vision for how we should bring in functionality for scienceicons? Should it be all baked into this theme and out of the box? (e.g. so that anybody that uses these themes gets |
|
On the topic of loading plugin support, I am in favour of enabling themes to define plugins for mymstd. I think that's a really interesting idea, even though it slightly muddies the mostly one-way interaction between mystmd and themes (i.e. affects how easy it is to swap out one theme for another with pre-built content). We should likely think about scienceicons in the context of other icons like material icons: https://github.com/jupyter-book/mystmd/blob/main/packages/myst-ext-icon/src/index.ts We have defined a role to parse these, but it's not hooked in to the theme or the engine yet. There were some pain points at the time in loading icons without blowing up the bundle size that we were discussing, and it's been on the back burner since. The more things like icon packs we add, the more important it becomes to be able to somehow prune these back. Normally tree shaking does this, but because the theme is not a compiled-up-front application w.r.t content, we don't get that for free. |
|
@agoose77 what do you think is the best path forward for this PR? We could add it in as a step forward for now? My interest in this is that we'd be a step closer to #362 without adding any new config surface area (instead, users would need to add a plugin). To me the ideal use-case would be that a plugin can define both the roles/directives/node types that get put in the AST, and rules for rendering those nodes in various contexts. That's a step closer to our goal of mystmd/themes having a less opinionated base setup, and relying more on extension points for extra functionality. But it feels like we aren't there yet Maybe the MIMEbundle conversation is related to this? If a new node had a MIMEbundle-like thing inside, then a renderer could step through that bundle to decide how to render it even if it hadn't been explicitly told how to do it. If you combine that with the ability to ship things like PNGs with plugins then you could probably get pretty far. |
|
I wanted to demonstrate what I meant by needing another plugin, so just pushed a commit to explain what I mean. It makes minor modifications to the theme so that we can render scienceicons with a little bit of styling via a CSS class. If we want to revert that commit or remove parts of it, no problem from me! It:
Take a look at it here: |
Enable CSF's
{scienceicon}role (https://github.com/continuous-foundation/scienceicons?tab=readme-ov-file#myst-markdown) to render to React.This is primarily in service of the tools.scientific-python.org site conversion to myst (scientific-python/tools.scientific-python.org#81).
It is also a move in the direction of solving this standing
myst-themeissue: #362