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

dev server: improve rendering of build error messages #16

Open
kristoff-it opened this issue Feb 9, 2024 · 0 comments
Open

dev server: improve rendering of build error messages #16

kristoff-it opened this issue Feb 9, 2024 · 0 comments

Comments

@kristoff-it
Copy link
Owner

Follow-up from #10.

When the dev server is running and an automatic build errors out, we just show stderr verbatim to the user by placing the text in a <pre> element.

These error messages should be made nicer in a few ways:

  1. stop printing lines that come from the build system itself, which are also full of escape codes
  2. if the error is in a template, the same error message will be printed N times, once for each content file that uses is as a layout (directly or indirectly via template extension), ideally we would like to identify the error message that belongs to the current page and display that as the primary one.

The first task can be implemented by redirecting the error messages output by Zine to a different stream, be it a tmp file or maybe even just stdout. This behavior could be enabled via a flag that only the dev server is expected to use.

The second task requires either giving more structure to the error messages, or recognizing programmatically the current structure, in order to ultimately know where an error message begins and where it ends.

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

1 participant