Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A plugin to easily set Mistune plugins #1076

Open
nixjdm opened this issue Sep 21, 2022 · 6 comments
Open

A plugin to easily set Mistune plugins #1076

nixjdm opened this issue Sep 21, 2022 · 6 comments

Comments

@nixjdm
Copy link
Member

nixjdm commented Sep 21, 2022

Inspired by #1074, I propose an official plugin that allows you to easily set which Mistune plugins you want in a project. This could read a lektor plugin config file to set all listed plugins. At least, there is a full set of Mistune-supplied plugins listed here https://mistune.readthedocs.io/en/latest/plugins.html, and it would be great if a user could simply list which of those should be set. As a nuance, it would be nice to either add plugins, in addition to those defaulted in Lektor (again see #1074), or set a complete list, which would in effect allow disabling even some of those default plugins as well as adding plugins.

If the community creates more Mistune plugins that are external, it would be nice to pull those in with similar ease, but that could be as messy as current Lektor plugin management, potentially. AFAICT there isn't a mature story for an external Mistune plugin ecosystem yet, though.

Given Lektor's currently strong tie to Mistune, and the existence of other Mistune-specific Lektor plugins, I think this ought to be an official plugin for this project.

@nixjdm
Copy link
Member Author

nixjdm commented Sep 21, 2022

Also see the set of Directives which special are optional Mistune plugins: https://mistune.readthedocs.io/en/latest/directives.html

@dairiki
Copy link
Contributor

dairiki commented Sep 21, 2022

While working on #1074, I had thought about adding a setting to the .lektorproject file to configure which mistune plugins would be enabled but then thought better of it. Decoupling that logic into a Lektor plugin probably helps maintainability in the long run.

@dairiki
Copy link
Contributor

dairiki commented Sep 22, 2022

I've started playing with this (and with using hatch to manage the packaging and test and dev environments) at https://github.com/dairiki/lektor-mistune-config.

@ofek
Copy link

ofek commented Sep 22, 2022

Hatch maintainer here! Let me know if I can help

@dairiki
Copy link
Contributor

dairiki commented Sep 22, 2022

Hatch maintainer here! Let me know if I can help

Hi @ofek! Thank you for the attention!
I'm playing with converting the building and testing of Lektor to hatch here: https://github.com/dairiki/lektor/tree/feature.hatch

Basically, I'm very happy with how easy the transition was. It was nice how easy it was to convert our frontend esbuild-based build process into a build-hook. (It's a huge win that with the esbuild build hooked into the PEP517 build process we gain the ability to install directly from git using pip.) It's nice, also, to have the configuration for the test venvs and the suggested dev venv all in the same place.

The main feature I haven't yet managed to translate to hatch is my use of tox's parallel mode.

I'm used to being able to run tox -p6 and have our whole matrix of testenvs run in parallel. We have roughly eight entries in our matrix, and our tests are slow. Running each environment of the matrix serially is painful.

Is there a suggested way to run a command in a whole matrix of hatch environments in parallel?

@ofek
Copy link

ofek commented Sep 22, 2022

No, but that is planned!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants