load prism js for my digital garden syntax highlighting

  • Add prism.js and prism.css based on CDN to my blog or website (digital-garden) to give a proper syntax highlighting

    • add the following line to <head>
      • <link href="https:///prismjs@v1.x/themes/prism.css" rel="stylesheet" />
    • add the following lines to <body>. come to think, perhaps can only on the <head>?
      • <script src="https:///prismjs@v1.x/components/prism-core.min.js"></script>
      • <script src="https:///prismjs@v1.x/plugins/autoloader/prism-autoloader.min.js"></script>
  • my preferred cdn for prism js
  • more complete example per below
<!DOCTYPE html>
<html>
<head>
	...
	<link href="https:///prismjs@v1.x/themes/prism.css" rel="stylesheet" />
</head>
<body>
	...
	<script src="https:///prismjs@v1.x/components/prism-core.min.js"></script>
	<script src="https:///prismjs@v1.x/plugins/autoloader/prism-autoloader.min.js"></script>
</body>
</html>

References

Metadata

  • topic:: 00 Coding00 Coding
    #MOC / for programming language, coding guide and libraries focusing on data analytics and html/css
  • updated:: 2022-07-30 Private or Broken Links
    The page you're looking for is either not available or private!
  • reviewed:: 2022-07-30 Private or Broken Links
    The page you're looking for is either not available or private!
  • #Reference