Skip to content

Commit

Permalink
Improve message on docs error
Browse files Browse the repository at this point in the history
  • Loading branch information
pennal committed Aug 21, 2023
1 parent 7f0d6e8 commit 9ef0c17
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/scripts/components.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,19 @@ function transformToMarkdown(component) {
const root = parse(component.html);
const container = root.querySelector('.container');
let index = 0;
if (container == null) {
console.error(
`Error while processing component located @ '${component.filePath}'
Matching index.html has no root element with class 'container'. Possible causes:
- Missing main 'div' tag with class 'container'
- Multiple tags with 'container' class
- Malformed html in 'index.html'
Please check the associated html file and try again`
);
process.exit(1);
}
const vueExamples = container.childNodes.map((node) => {
switch (node.rawTagName) {
case 'section': {
Expand Down

0 comments on commit 9ef0c17

Please sign in to comment.