hdoc-tools 0.62.4 → 0.63.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/editor/dist/assets/{index-BtxvGZHW.js → index-Dknn5g5A.js} +5 -4
- package/editor/dist/index.html +13 -13
- package/hdoc-build.js +5 -3
- package/hdoc-content-routes.js +136 -4
- package/hdoc-serve.js +26 -3
- package/hdoc-validate-interbook.js +8 -0
- package/hdoc-validate.js +92 -35
- package/package.json +1 -1
- package/ui/css/theme-default/styles/base.css +86 -21
- package/ui/css/theme-default/styles/components/api-doc.css +6 -3
- package/ui/css/theme-default/styles/components/content.css +140 -39
- package/ui/css/theme-default/styles/components/custom-block.css +1 -1
- package/ui/css/theme-default/styles/components/htl-doc.css +243 -64
- package/ui/css/theme-default/styles/components/htl-library.css +152 -0
- package/ui/css/theme-default/styles/components/htl-search.css +267 -0
- package/ui/css/theme-default/styles/components/sidebar.css +59 -16
- package/ui/css/theme-default/styles/fonts.css +17 -3
- package/ui/css/theme-default/styles/htldoc.layouts.css +756 -87
- package/ui/css/theme-default/styles/vars.css +40 -35
- package/ui/favicon.svg +64 -0
- package/ui/images/hornbill-logo-full-reversed.svg +92 -0
- package/ui/images/hornbill-logo-full.svg +92 -0
- package/ui/images/hug_library.jpg +0 -0
- package/ui/images/mcp-catalog.svg +9 -0
- package/ui/images/products/hornbill-square.svg +1 -0
- package/ui/index.html +1106 -342
- package/ui/js/bootstrap.js +89 -0
- package/ui/js/doc.hornbill.js +3156 -751
- package/ui/js/hb.vue.js +121 -0
- package/ui/js/highlightjs/highlight.pack.js +1513 -2
- package/ui/js/highlightjs/styles/vs2015-accessible.css +141 -0
- package/ui/js/highlightjs-badge.js +41 -58
- package/ui/js/mermaid.min.js +1447 -1295
- package/ui/js/webcomponents/hdocApprove.js +115 -0
- package/ui/js/highlightjs/styles/brown-paper.css +0 -64
- package/ui/js/highlightjs/styles/brown-papersq.png +0 -0
- package/ui/js/highlightjs/styles/codepen-embed.css +0 -60
- package/ui/js/highlightjs/styles/color-brewer.css +0 -71
- package/ui/js/highlightjs/styles/darcula.css +0 -77
- package/ui/js/highlightjs/styles/dark.css +0 -63
- package/ui/js/highlightjs/styles/darkula.css +0 -6
- package/ui/js/highlightjs/styles/default.css +0 -99
- package/ui/js/highlightjs/styles/dracula.css +0 -76
- package/ui/js/highlightjs/styles/far.css +0 -71
- package/ui/js/highlightjs/styles/foundation.css +0 -88
- package/ui/js/highlightjs/styles/github-gist.css +0 -71
- package/ui/js/highlightjs/styles/github-mm.css +0 -71
- package/ui/js/highlightjs/styles/github.css +0 -99
- package/ui/js/highlightjs/styles/googlecode.css +0 -89
- package/ui/js/highlightjs/styles/grayscale.css +0 -101
- package/ui/js/highlightjs/styles/idea.css +0 -97
- package/ui/js/highlightjs/styles/ir-black.css +0 -73
- package/ui/js/highlightjs/styles/kavadocs.css +0 -71
- package/ui/js/highlightjs/styles/kavadocsdark.css +0 -120
- package/ui/js/highlightjs/styles/kimbie.dark.css +0 -74
- package/ui/js/highlightjs/styles/kimbie.light.css +0 -74
- package/ui/js/highlightjs/styles/magula.css +0 -70
- package/ui/js/highlightjs/styles/mono-blue.css +0 -59
- package/ui/js/highlightjs/styles/monokai-sublime.css +0 -83
- package/ui/js/highlightjs/styles/monokai.css +0 -70
- package/ui/js/highlightjs/styles/obsidian.css +0 -88
- package/ui/js/highlightjs/styles/paraiso-dark.css +0 -72
- package/ui/js/highlightjs/styles/paraiso-light.css +0 -72
- package/ui/js/highlightjs/styles/railscasts.css +0 -106
- package/ui/js/highlightjs/styles/rainbow.css +0 -85
- package/ui/js/highlightjs/styles/solarized-dark.css +0 -84
- package/ui/js/highlightjs/styles/solarized-light.css +0 -84
- package/ui/js/highlightjs/styles/sunburst.css +0 -102
- package/ui/js/highlightjs/styles/twilight.css +0 -97
- package/ui/js/highlightjs/styles/vs.css +0 -68
- package/ui/js/highlightjs/styles/vs2015.css +0 -117
- package/ui/js/highlightjs/styles/xcode.css +0 -104
- package/ui/js/highlightjs/styles/zenburn.css +0 -80
package/ui/js/hb.vue.js
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
//--
|
|
2
|
+
//-- Vue 3 app factory for the docs site.
|
|
3
|
+
//--
|
|
4
|
+
//-- Vue 3 removed the three things this site was originally built on:
|
|
5
|
+
//-- * `new Vue({el:...})` -> Vue.createApp(options).mount(el)
|
|
6
|
+
//-- * Vue.component(name,def) -> app.component(name,def) (per app, not global)
|
|
7
|
+
//-- * Vue.filter(name,fn) + {{x|f}} -> gone entirely
|
|
8
|
+
//--
|
|
9
|
+
//-- That is awkward here because there is no build step, several independent scripts register
|
|
10
|
+
//-- shared components (js/webcomponents/*, js/doc.hornbill.js, settings/js/*), and the page
|
|
11
|
+
//-- creates more than one app: the shell, plus a short-lived app for every injected article
|
|
12
|
+
//-- and every settings view. With no single place that owns "the app", per-app registration
|
|
13
|
+
//-- would mean every script needing a handle to every app.
|
|
14
|
+
//--
|
|
15
|
+
//-- So hbVue keeps a small registry that scripts can add to before any app exists, and
|
|
16
|
+
//-- hbCreateApp stamps the whole registry onto each app it builds. One-for-one replacements:
|
|
17
|
+
//--
|
|
18
|
+
//-- Vue.component(n,d) -> hbVue.component(n,d)
|
|
19
|
+
//-- Vue.filter(n,f) -> hbVue.helper(n,f) and {{x | f}} becomes {{f(x)}} in templates
|
|
20
|
+
//-- new Vue({el:e,...}) -> hbMount({...}, e) (returns the same vm you used before)
|
|
21
|
+
//-- vm.$destroy() -> hbVue.unmount(vm)
|
|
22
|
+
//--
|
|
23
|
+
//-- Load this immediately after Vue and before any script that registers or mounts. //-- SG
|
|
24
|
+
|
|
25
|
+
var hbVue = {
|
|
26
|
+
//-- name -> component definition, applied to every app created by hbCreateApp
|
|
27
|
+
components: {},
|
|
28
|
+
|
|
29
|
+
//-- name -> function, exposed to every template as a callable (the Vue.filter replacement)
|
|
30
|
+
helpers: {},
|
|
31
|
+
|
|
32
|
+
//-- native custom elements that may appear inside a compiled template. Vue 3 treats an
|
|
33
|
+
//-- unknown hyphenated tag as a component and logs "Failed to resolve component", so any
|
|
34
|
+
//-- real custom element has to be declared. Doc content is compiled under v-pre and is
|
|
35
|
+
//-- therefore already exempt - this is for elements in the app templates themselves.
|
|
36
|
+
customElements: ["api-param-optional"],
|
|
37
|
+
|
|
38
|
+
//-- vm proxy -> app, so a caller holding a vm can still tear it down (see unmount)
|
|
39
|
+
_apps: new WeakMap(),
|
|
40
|
+
|
|
41
|
+
component: function (name, definition) {
|
|
42
|
+
hbVue.components[name] = definition;
|
|
43
|
+
return hbVue;
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
helper: function (name, fn) {
|
|
47
|
+
hbVue.helpers[name] = fn;
|
|
48
|
+
return hbVue;
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
//-- tear down an app given the vm that hbMount returned. Vue 3 has no vm.$destroy();
|
|
52
|
+
//-- teardown is an app-level operation, and app.unmount() also empties the container.
|
|
53
|
+
unmount: function (vm) {
|
|
54
|
+
if (!vm) return false;
|
|
55
|
+
let app = hbVue._apps.get(vm);
|
|
56
|
+
if (!app) return false;
|
|
57
|
+
app.unmount();
|
|
58
|
+
hbVue._apps.delete(vm);
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
//-- create an app with the shared registry applied, but do not mount it. Use this when you
|
|
64
|
+
//-- need the app handle itself; otherwise use hbMount.
|
|
65
|
+
function hbCreateApp(options) {
|
|
66
|
+
let app = Vue.createApp(options);
|
|
67
|
+
|
|
68
|
+
//-- keep Vue from trying to resolve declared custom elements as components
|
|
69
|
+
app.config.compilerOptions.isCustomElement = function (tag) {
|
|
70
|
+
return hbVue.customElements.indexOf(tag) !== -1;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
//-- template helpers land on globalProperties so templates can call them directly
|
|
74
|
+
for (let name in hbVue.helpers) {
|
|
75
|
+
if (hbVue.helpers.hasOwnProperty(name)) {
|
|
76
|
+
app.config.globalProperties[name] = hbVue.helpers[name];
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
for (let name in hbVue.components) {
|
|
81
|
+
if (hbVue.components.hasOwnProperty(name)) {
|
|
82
|
+
app.component(name, hbVue.components[name]);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return app;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
//-- create and mount in one call. Returns the mounted root instance proxy - the same object
|
|
90
|
+
//-- `new Vue({el})` used to return, so vm.someMethod(), vm.someDataProp, vm.$forceUpdate()
|
|
91
|
+
//-- and vm.$nextTick() all still work.
|
|
92
|
+
//--
|
|
93
|
+
//-- NOTE the one behaviour change from Vue 2: Vue 2 compiled the mount element's *outerHTML*,
|
|
94
|
+
//-- so directives on the element itself (v-on:click, :class) were live. Vue 3 compiles its
|
|
95
|
+
//-- *innerHTML* and leaves the container alone, so any directive on the container is silently
|
|
96
|
+
//-- ignored. Bind those by hand after mounting (see hbBindRootHandler).
|
|
97
|
+
function hbMount(options, elementOrSelector) {
|
|
98
|
+
let app = hbCreateApp(options);
|
|
99
|
+
let vm = app.mount(elementOrSelector);
|
|
100
|
+
hbVue._apps.set(vm, app);
|
|
101
|
+
return vm;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
//-- Vue 3 does not compile directives on the mount container, so a `v-on:<event>` that used to
|
|
105
|
+
//-- sit on the root element has to be wired up manually. Markup declares it as
|
|
106
|
+
//-- data-root-<event>="<methodName>" and this attaches it, which keeps the intent visible in
|
|
107
|
+
//-- the HTML rather than burying it in a script. No attribute means no handler, which is how
|
|
108
|
+
//-- _inline.html opts out while sharing the same controller as index.html.
|
|
109
|
+
function hbBindRootHandler(vm, elementOrSelector, eventName) {
|
|
110
|
+
let el = (typeof elementOrSelector === "string") ? document.querySelector(elementOrSelector) : elementOrSelector;
|
|
111
|
+
if (!el || !vm) return false;
|
|
112
|
+
|
|
113
|
+
let methodName = el.getAttribute("data-root-" + eventName);
|
|
114
|
+
if (!methodName || typeof vm[methodName] !== "function") return false;
|
|
115
|
+
|
|
116
|
+
el.addEventListener(eventName, function (ev) {
|
|
117
|
+
vm[methodName](ev);
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
return true;
|
|
121
|
+
}
|