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

Moose Syntax Highlighting #30123

Open
wants to merge 9 commits into
base: next
Choose a base branch
from
Open

Conversation

zachmprince
Copy link
Contributor

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:

image

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 and ParsedFunction will take you to ParsedFunction.md. Also, hovering over the parameters and the class name (ParsedMaterial) will show the parameter/class description.

image image

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.

Copy link
Member

@loganharbour loganharbour left a 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

@moosebuild
Copy link
Contributor

moosebuild commented Mar 18, 2025

Job Documentation, step Docs: sync website on acec52e wanted to post the following:

View the site here

This comment will be updated on new commits.

@moosebuild
Copy link
Contributor

moosebuild commented Mar 18, 2025

Job Coverage, step Generate coverage on acec52e wanted to post the following:

Framework coverage

Mutiple base shas were found when retrieving head reports:
09b3c83
64da7a2

Modules coverage

Coverage did not change

Full coverage reports

Reports

This comment will be updated on new commits.

@moosebuild
Copy link
Contributor

Job Documentation on b94007b : invalidated by @zachmprince

Fetch error that's been resolved

Copy link
Member

@loganharbour loganharbour left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All minor. Will require another re-do of the package bump

@moosebuild
Copy link
Contributor

Job Precheck, step Versioner verify on acec52e wanted to post the following:

Versioner templates

Found 16 templates, 0 failed

Versioner versions

Found 10 packages, 2 changed, 0 failed

package status hash to hash version to version
wasp CHANGE a8340b3 45a5f8b 2025.02.25 build 1 2025.03.26 build 0
moose-dev CHANGE 00b281f c355a34 2025.03.24 2025.03.26

Copy link
Member

@loganharbour loganharbour left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coordinate before merging because this is a package update.

@moosebuild
Copy link
Contributor

Job Coverage, step Verify coverage on acec52e wanted to post the following:

The following coverage requirement(s) failed:

  • Failed to generate framework coverage rate (required: 81.0%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Syntax highlighting for moose inputs
3 participants