Closed phated closed 4 years ago
This is weird, since we included admonitions in core (so there should be no errors with CSS file), how did you remove this module?
@lex111 you don't include admonitions in core (see https://github.com/facebook/docusaurus/blob/master/packages/docusaurus/package.json#L34-L88) but include it only in preset-classic (https://github.com/facebook/docusaurus/blob/master/packages/docusaurus-preset-classic/package.json#L19) which I'm not using because I always avoid the preset. I think this theme should check if admonitions is enabled before trying to include that file.
@phated aah, I get it, we did not consider the case when someone can use the classic theme directly without using the preset (this is not a very popular use case).
@lex111 is there a reason that remark-admonitions
isn't just providing that lifecycle hook for itself?
We should shift 'remark-admonitions/styles/infima.css'
out of packages/docusaurus-theme-classic/src/index.js
into the preset but unfortunately presets don't allow lifecycle hooks at the moment. We might need to change that or create a new API to modify themes within presets. The dependency is a bit tangled up at the moment :/
@phated I see that the Gulp website is already using the latest version of D2, which is awesome! I hope you were not disappointed with the new version 😜
Regarding this issue, why don't you use preset-classic? Even if you do not need a blog, this should not bring overhead.
Yeah, we pushed through any issues because I needed to get it released before a podcast appearance this week. Docusaurus has been amazing, as always!
I'm generally against presets for most tools I use because I end up needing to change a lot of things. For example, I see a world where the gulp team creates their own theme (we've done medium customization already and need more), so I wouldn't want to rip out the preset at that time.
I also think by understanding how the preset is working and reimplementing it myself, I can see things that aren't needed and find issues like this. I have more feedback on the plugin architecture, but I currently don't have the time to write up my thoughts 🙁
@phated we really love the feedback from our users, thank you for that. We welcome any feedback, because we are still in the alpha stage.
I tend to include admonitions in every plugin (both for docs and blogs), instead of doing this in a preset. I think it was a predictable behavior.
BTW consider adding your project to our showcase at https://v2.docusaurus.io/showcase 😇
🐛 Bug Report
Due to https://github.com/facebook/docusaurus/blob/master/packages/docusaurus-theme-classic/src/index.js#L56, you are unable to to use the
@docusaurus/theme-classic
theme without installing theremark-admonitions
module. This shouldn't be a hard requirement.Have you read the Contributing Guidelines on issues?
Yep
To Reproduce
module.exports = { title: 'gulp.js', favicon: 'img/favicon.png', url: 'https://gulpjs.com/', baseUrl: '/', tagline: 'The streaming build system', // Used by the deployment organizationName: 'gulpjs', projectName: 'gulpjs.github.io', // The theme themeConfig: {}, themes: ['@docusaurus/theme-classic'], plugins: [ ['@docusaurus/plugin-content-docs', { path: '../converted-docs' }] ] };