package.json:
Update MWDK to 2.4.2:
"materia-widget-development-kit": "2.4.2"
Directory structure:
src/_guides/creator.md
src/_guides/player.md
All image assets should be in src/_guides/assets/
Add guide entries to the widget's install.yaml
:
creator_guide: guides/creator.html
player_guide: guides/player.html
Webpack config:
Note that the configs required here are all that's necessary for the helper docs to work. Older configurations, like the generateHelperPlugin
function, aren't required and can be removed.
Add temp files to the entry
config:
(Note that this requires the path
module to be included (const path = require('path')
) - if the config is using a srcPath
variable to track the directory path, you can use that instead. This may vary from widget to widget.)
const entries = {
'guides/player.temp.html': [
path.join(__dirname, 'src', '_guides', 'player.md')
],
'guides/creator.temp.html': [
path.join(__dirname, 'src', '_guides', 'creator.md')
]
}
Ensure the entry config is added as an option being passed to the getLegacyWidgetBuildConfig()
method:
const options = {
entries: entries
}
let buildConfig = widgetWebpack.getLegacyWidgetBuildConfig(options)
module.exports = buildConfig