Our great sponsors
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
It does most of the work using Regular Expressions, which you can easily read through in the source (e.g. for JavaSript the rules are here: https://github.com/PrismJS/prism/blob/master/components/prism-javascript.js)
There are a couple of choices to bring it into your project. If you're already using a JS Bundler (e.g. esbuild or Webpack) you can setup the Babel Plugin for Prism. For our demonstration we'll do this the old, simple way, writing our HTML tags directly.
Note that there are code screenshot sites like https://carbon.now.sh/ that will give you great little screenshots of your code. But these are mere .pngs, they're not accessible, searchable or copy & pasteable. That's NOT what we're going to do here, our output will be fully accessible and appear as text on the page.
Related posts
- How do i get PrismJS working with phoenix?
- Is there a library or component for those kind of mock code editor windows for displaying code?
- The problem with code screenshots and how to fix it
- Difference between these 2 ways of creating a controller in AngularJS
- Recommend 12 free productivity tools! Make your work more effective with less effort!