🐒 πŸ‘©β€πŸ« πŸ‘¨β€πŸ« Highlighting B4X code in HTML pages using Prism

Erel

Administrator
Staff member
Licensed User
Example: https://www.b4x.com/js/

Prism is a popular JavaScript text highlighter: https://prismjs.com/index.html

It is the same library that is installed in the forum and highlights the code.
The B4X rules and a modified CSS file are attached.

Note that it is not 100% perfect due to it being a context free parser however overall it does a good job and the code looks much better than plain text.
 

Attachments

  • prism.zip
    9.1 KB · Views: 223

ilan

Expert
Licensed User

Erel

Administrator
Staff member
Licensed User
very good! like this we can show b4x code in a webview in our app.
Haven't thought about it but it should work. Another option: https://www.b4x.com/android/forum/t...e-parser-b4x-code-highlighter.109308/#content

java_QIDqgmNTqq.png


Haven't you "recently" posted such (similar) a thing?
True, but it required several additional steps to be actually used.
 
Top