-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Moose Syntax Highlighting #30123
base: next
Are you sure you want to change the base?
Moose Syntax Highlighting #30123
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not up to date with current packages
Job Documentation, step Docs: sync website on b94007b wanted to post the following: View the site here This comment will be updated on new commits. |
Job Coverage, step Generate coverage on b94007b wanted to post the following: Framework coverage
Modules coverageCoverage did not change Full coverage reportsReports
This comment will be updated on new commits. |
Job Documentation on b94007b : invalidated by @zachmprince Fetch error that's been resolved |
Job Precheck, step Versioner verify on 2f58e15 wanted to post the following: Versioner templatesFound 16 templates, 0 failed Versioner versionsFound 10 packages, 2 changed, 0 failed
|
Reason
Closes #30112
Design
The modification of the
prism.min.js
is the implementation of the syntax highlighting. The line for the moose input part was generated from my prism fork. Since I wanted to look more like the VSCode style, I modified the moose.css to include colors seen in the vscode theme that many of us use. Here is a snippet of what the highlighting looks like:I went a little above-and-beyond, so to speak, and added links and tooltips to page documentation recognized by the syntax. For instance, clicking on
[Functions]
will take you to the Functions syntax page andParsedFunction
will take you to ParsedFunction.md. Also, hovering over the parameters and the class name (ParsedMaterial
) will show the parameter/class description.This is my first time writing JavaScript, so please go easy on my ignorance on how to code in that. All the python code and custom JS file is to support the syntax linking and description display. If we don't end up liking that, this is a much simpler PR.
Impact
The runtime for the doc build seems about the same. Pages with moose input listings do show some confusing text on the initial load, but quickly turn into the right thing once the JS is done. I don't see much other down sides other than we are dependent on a fork prism to get the syntax highlighting regex, but that is well documented in the prism.min.js file.