Make A New Prism Syntax Highlighting Langage Definition
This is what I did to make a starting point for the Neopolitan syntax highlighter for the example page.
- Fork prism from it's repo
- Clone a local copy
- Run [TODO: Code shorthand span ] in the cloned directory
- Make a new file for your language at
the content below here isn't working prolerly in the praser
components/prism - alfa.js
With contents like :
Prism.languages['some-language'] = {
'token-name': {
pattern: /regex/
},
};
Edit the [TODO: Code shorthand span ] file in the root of the projct to add your language like :
"some-language": {
"title": "Some Language",
"owner": "Your GitHub name"
}
If you're going to try to submit it, make sure it's sorted properly in the alphabetical section below the defaults
-
Build the project with
[TODO: Code shorthand span ]
-
Start the server with
[TODO: Code shorthand span ]
-
Open the test page on your local machine
http : //127.0.0.1 : 8080/test.html
-
Figure your language and click on it. There won't be any highlights yet
-
Update the [TODO: Code shorthand span ] file you created above using > this page > https : //prismjs.com/extending.html > for guidance
Note that you don't need to restart the server if all your doing is editing that file. Reloading the page in the browser is all that's necessary.
-
When you have the highlights the way you like them you can pull down a customize version of prism with them in it by going to your local copy of the download page and getting them from there :
http : //localhost : 8080/download.html