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

syntax highlighting #555

Open
wants to merge 3 commits into
base: gh-pages
Choose a base branch
from
Open

syntax highlighting #555

wants to merge 3 commits into from

Conversation

joshstovall
Copy link

Hello, I hope whoever is reading this is doing well. I have been developing with MusicXML for a few years now and always wished the documentation had syntax highlighting.

So I added syntax highlighting.

I also updated the layout on the examples page. Please see my images below.

Each element is wrapped in a custom class. So just update the CSS and it can be any color you would like.

There are 4 different styles:

  • Diff mode (wrap in a <div> with xmlmarkup class) used on the example pages, it applies a more eye catching style for the subject matter of the page (anything in the diff class)
  • Bold tags (wrap in a pre with boldtags class)
  • Dark background (wrap in a <pre>) used on the "how to" pages
  • No highlight (wrap in a pre with nohighlight class) no highlight will be applied

Please let me know if I need to make any changes. I'm not sure what the review process is like for this kind of thing, but I'm happy to contribute! I actually have a few things I would like to propose for the spec itself in the future. But for now, I have a syntax highlighter.

Screenshot 2024-09-15 at 11 10 55 AM Screenshot 2024-09-15 at 11 58 10 AM Screenshot 2024-09-15 at 11 51 23 AM Screenshot 2024-09-15 at 11 25 42 AM

added syntax highlighting, updated examples page layout
@adrianholovaty
Copy link
Contributor

Hi @joshstovall — thanks for submitting this!

Did you manually edit all of the HTML files, or did you make these changes via the underlying docs-generation system? I'm asking because the docs are generated automatically by a series of Python tools (see here). If we go forward with your pull request, the changes would have to be made within the docs system so that future auto-generation of the docs doesn't just override your work.

@joshstovall
Copy link
Author

Oh yeah, sorry about that. Yes I did edit a bit of HTML by hand. A few classnames and also the examples page layout. At times, I was wondering why the HTML looked so funky. But now it all makes sense.

I just pushed styles.css and global.js in docgenerator directory of this repo. I guess you can ignore my first 2 commits if they are going to be overwritten.

I'll make the changes to the mnxdocgenerator ASAP.

@mscuthbert
Copy link
Contributor

@joshstovall -- super impressed; as Adrian says we're in the middle of reformating the whole docs system so we will wait on this for a bit but want to come back to it.

@joshstovall
Copy link
Author

Whenever the new docs are done, I'd be happy to add in the syntax highlighting!

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.

3 participants