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 8 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 b94007b 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 b94007b wanted to post the following:

Framework coverage

051868 #30123 b94007
Total Total +/- New
Rate 85.29% 85.29% +0.00% -
Hits 109056 109058 +2 0
Misses 18809 18807 -2 0

Diff coverage report

Full coverage report

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

@moosebuild
Copy link
Contributor

Job Precheck, step Versioner verify on 2f58e15 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 46ea1c0 10b0580 2025.02.25 build 0 2025.03.18 build 0
moose-dev CHANGE fcaa73c a804a0f 2025.03.03 2025.03.18

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