pure-systems.com syntax highlighting

For documentation pages. Example page: https://www.pure-systems.com/pv-update/additions/doc/latest/com.ps.consul.eclipse.ui.doc/ch06s14.html

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @license MIT
// @name        pure-systems.com syntax highlighting
// @namespace   Violentmonkey Scripts
// @match       https://www.pure-systems.com/*
// @grant       none
// @version     1.0
// @author      -
// @description For documentation pages. Example page: https://www.pure-systems.com/pv-update/additions/doc/latest/com.ps.consul.eclipse.ui.doc/ch06s14.html
// @require https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js
// @require https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/highlight.min.js
// ==/UserScript==

$("head").append('<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/styles/default.min.css">')
$(".programlisting").each(function () {
  if ($(this).children().length == 0) {
    $(this).wrapInner(document.createElement("code")) //wrap the content in a <code> tag
  }
  else {
    $(this).children().wrapInner(document.createElement("code")) //wrap each child's content in its own <code> tag
  }
});

hljs.highlightAll();