hdoc-tools 0.60.1 → 0.61.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.
@@ -1,14 +1,14 @@
1
- (function(){var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),l=o(((e,t)=>{
2
- /*!
3
- * Determine if an object is a Buffer
4
- *
5
- * @author Feross Aboukhadijeh <https://feross.org>
6
- * @license MIT
7
- */
8
- t.exports=function(e){return e!=null&&e.constructor!=null&&typeof e.constructor.isBuffer==`function`&&e.constructor.isBuffer(e)}})),u=o(((e,t)=>{t.exports=r;var n=[];function r(e,t){var r=0,i;if(!t)return n;if(e.FLAG===`long`){for(i=Array(Math.ceil(t.length/2));r<t.length;)i[r/2]=t.slice(r,r+2),r+=2;return i}return t.split(e.FLAG===`num`?`,`:``)}})),d=o(((e,t)=>{var n=u();t.exports=s;var r=[].push,i=`etaoinshrdlcumwfgypbvkjxqz`.split(``),a=/\s+/,o=[`qwertzuop`,`yxcvbnm`,`qaw`,`say`,`wse`,`dsx`,`sy`,`edr`,`fdc`,`dx`,`rft`,`gfv`,`fc`,`tgz`,`hgb`,`gv`,`zhu`,`jhn`,`hb`,`uji`,`kjm`,`jn`,`iko`,`lkm`];function s(e){var t=Object.create(null),s=Object.create(null),u=Object.create(null),d=[],f={in:[],out:[]},p=[],m=e.toString(`utf8`),h=[],g=0,_=m.indexOf(`
9
- `),v,y,b,x,S,C,w,T,E,D,O,k,A;for(u.KEY=[];_>-1;)j(m.slice(g,_)),g=_+1,_=m.indexOf(`
10
- `,g);for(j(m.slice(g)),_=-1;++_<h.length;)if(y=h[_],v=y.split(a),b=v[0],b===`REP`){for(x=_+parseInt(v[1],10);++_<=x;)v=h[_].split(a),d.push([v[1],v[2]]);_--}else if(b===`ICONV`||b===`OCONV`){for(x=_+parseInt(v[1],10),T=f[b===`ICONV`?`in`:`out`];++_<=x;)v=h[_].split(a),T.push([new RegExp(v[1],`g`),v[2]]);_--}else if(b===`COMPOUNDRULE`){for(x=_+parseInt(v[1],10);++_<=x;)for(D=h[_].split(a)[1],E=-1,p.push(D);++E<D.length;)s[D.charAt(E)]=[];_--}else if(b===`PFX`||b===`SFX`){for(x=_+parseInt(v[3],10),D={type:b,combineable:v[2]===`Y`,entries:[]},t[v[1]]=D;++_<=x;){v=h[_].split(a),S=v[2],C=v[3].split(`/`),w=v[4],T={add:``,remove:``,match:``,continuation:n(u,C[1])},C&&C[0]!==`0`&&(T.add=C[0]);try{S!==`0`&&(T.remove=b===`SFX`?c(S):S),w&&w!==`.`&&(T.match=b===`SFX`?c(w):l(w))}catch{T=null}T&&D.entries.push(T)}_--}else if(b===`TRY`){for(w=v[1],k=-1,O=[];++k<w.length;)A=w.charAt(k),A.toLowerCase()===A&&O.push(A);for(k=-1;++k<i.length;)w.indexOf(i[k])<0&&O.push(i[k]);u[b]=O}else b===`KEY`?r.apply(u[b],v[1].split(`|`)):b===`COMPOUNDMIN`?u[b]=Number(v[1]):b===`ONLYINCOMPOUND`?(u[b]=v[1],s[v[1]]=[]):u[b]=v[1];return isNaN(u.COMPOUNDMIN)&&(u.COMPOUNDMIN=3),u.KEY.length||(u.KEY=o),u.TRY||=i.concat(),u.KEEPCASE||=!1,{compoundRuleCodes:s,replacementTable:d,conversion:f,compoundRules:p,rules:t,flags:u};function j(e){e=e.trim(),e&&e.charCodeAt(0)!==35&&h.push(e)}}function c(e){return RegExp(e+`$`)}function l(e){return RegExp(`^`+e)}})),f=o(((e,t)=>{t.exports=n;function n(e,t){for(var n=-1;++n<t.length;)e=e.replace(t[n][0],t[n][1]);return e}})),p=o(((e,t)=>{t.exports=n;function n(e,t,n){return n&&t in e&&n.indexOf(e[t])>-1}})),m=o(((e,t)=>{var n=p();t.exports=r;function r(e,t){var r=-1;if(e.data[t])return!n(e.flags,`ONLYINCOMPOUND`,e.data[t]);if(t.length>=e.flags.COMPOUNDMIN){for(;++r<e.compoundRules.length;)if(e.compoundRules[r].test(t))return!0}return!1}})),h=o(((e,t)=>{var n=f(),r=m(),i=p();t.exports=a;function a(e,t,a){var s=t.trim(),c;if(!s)return null;if(s=n(s,e.conversion.in),r(e,s))return!a&&i(e.flags,`FORBIDDENWORD`,e.data[s])?null:s;if(s.toUpperCase()===s){if(c=s.charAt(0)+s.slice(1).toLowerCase(),o(e.flags,e.data[c],a))return null;if(r(e,c))return c}if(c=s.toLowerCase(),c!==s){if(o(e.flags,e.data[c],a))return null;if(r(e,c))return c}return null}function o(e,t,n){return i(e,`KEEPCASE`,t)||n||i(e,`FORBIDDENWORD`,t)}})),g=o(((e,t)=>{var n=h();t.exports=r;function r(e){return!!n(this,e)}})),_=o(((e,t)=>{t.exports=n;function n(e){var t=r(e.charAt(0)),n=e.slice(1);return!n||(n=r(n),t===n)?t:t===`u`&&n===`l`?`s`:null}function r(e){return e===e.toLowerCase()?`l`:e===e.toUpperCase()?`u`:null}})),v=o(((e,t)=>{var n=_(),r=f(),i=p(),a=h();t.exports=s;var o=[].push;function s(e){var t=this,i={},a=[],s={},l,u,d=[],f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M,N,P;if(e=r(e.trim(),t.conversion.in),!e||t.correct(e))return[];for(P=n(e),p=-1;++p<t.replacementTable.length;)for(u=t.replacementTable[p],m=e.indexOf(u[0]);m>-1;)d.push(e.replace(u[0],u[1])),m=e.indexOf(u[0],m+1);for(p=-1;++p<e.length;)for(y=e.charAt(p),x=e.slice(0,p),S=e.slice(p+1),w=y.toLowerCase(),C=w!==y,i={},m=-1;++m<t.flags.KEY.length;)if(b=t.flags.KEY[m],h=b.indexOf(w),!(h<0)){for(_=-1;++_<b.length;)if(_!==h){if(v=b.charAt(_),i[v])continue;i[v]=!0,C&&(v=v.toUpperCase()),d.push(x+v+S)}}for(p=-1,O=e.charAt(0),f=[``],k=1,A=0;++p<e.length;){for(y=O,O=e.charAt(p+1),x=e.slice(0,p),u=y===O?``:y+y,m=-1,g=f.length;++m<g;)m<=k&&f.push(f[m]+u),f[m]+=y;++A<3&&(k=f.length)}for(o.apply(d,f),f=[e],u=e.toLowerCase(),(e===u||P===null)&&f.push(e.charAt(0).toUpperCase()+u.slice(1)),u=e.toUpperCase(),e!==u&&f.push(u),l={state:{},weighted:s,suggestions:a},T=c(t,l,f,d),E=0,k=Math.min(T.length,Math.max(15-e.length,3)**3),j=Math.max((10-e.length)**3,1);!a.length&&E<k;)D=E+j,c(t,l,T.slice(E,D)),E=D;for(a.sort(F),f=[],M=[],p=-1;++p<a.length;)N=r(a[p],t.conversion.out),u=N.toLowerCase(),M.indexOf(u)<0&&(f.push(N),M.push(u));return f;function F(e,t){return I(e,t)||L(e,t)||R(e,t)}function I(e,t){return s[e]===s[t]?0:s[e]>s[t]?-1:1}function L(e,t){var r=n(e),i=n(t);return r===i?0:r===P?-1:i===P?1:void 0}function R(e,t){return e.localeCompare(t)}}function c(e,t,r,o){var s=e.flags.TRY,c=e.data,l=e.flags,u=[],d=-1,f,p,m,h,g,_,v,y,b,x,S,C,w;if(o)for(;++d<o.length;)T(o[d],!0);for(d=-1;++d<r.length;)for(f=r[d],p=``,m=``,h=f.charAt(0),g=f,_=f.slice(1),v=h.toLowerCase()!==h,y=n(f),b=-1;++b<=f.length;)for(p+=m,x=g,g=_,_=g.slice(1),m=h,h=f.charAt(b+1),S=v,h&&(v=h.toLowerCase()!==h),g&&S!==v&&(T(p+E(g)),T(p+E(h)+E(m)+_)),T(p+g),g&&T(p+h+m+_),w=-1;++w<s.length;)C=s[w],S&&C!==C.toUpperCase()?(y!==`s`&&(T(p+C+x),T(p+C+g)),C=C.toUpperCase(),T(p+C+x),T(p+C+g)):(T(p+C+x),T(p+C+g));return u;function T(n,r){var o=t.state[n],s;o!==!!o&&(u.push(n),s=a(e,n),o=s&&!i(l,`NOSUGGEST`,c[s]),t.state[n]=o,o&&(t.weighted[n]=r?10:0,t.suggestions.push(n))),o&&t.weighted[n]++}function E(e){var t=e.charAt(0);return(t.toLowerCase()===t?t.toUpperCase():t.toLowerCase())+e.slice(1)}}})),y=o(((e,t)=>{var n=h(),r=p();t.exports=i;function i(e){var t=this,i=n(t,e,!0);return{correct:t.correct(e),forbidden:!!(i&&r(t.flags,`FORBIDDENWORD`,t.data[i])),warn:!!(i&&r(t.flags,`WARN`,t.data[i]))}}})),b=o(((e,t)=>{t.exports=n;function n(e,t,r,i){for(var a=-1,o,s,c,l,u;++a<t.entries.length;)if(o=t.entries[a],l=o.continuation,u=-1,(!o.match||o.match.test(e))&&(s=o.remove?e.replace(o.remove,``):e,s=t.type===`SFX`?s+o.add:o.add+s,i.push(s),l&&l.length))for(;++u<l.length;)c=r[l[u]],c&&n(s,c,r,i);return i}})),x=o(((e,t)=>{var n=b();t.exports=o;var r=[].push,i=[];function a(e,t,n){var a=e[t];t in e?a===i?e[t]=n.concat():r.apply(a,n):e[t]=n.concat()}function o(e,t,r,o){var s=-1,c,l,u,d,f,p,m;for((!(`NEEDAFFIX`in o.flags)||r.indexOf(o.flags.NEEDAFFIX)<0)&&a(e,t,r);++s<r.length;)if(c=o.rules[r[s]],r[s]in o.compoundRuleCodes&&o.compoundRuleCodes[r[s]].push(t),c){for(p=n(t,c,o.rules,[]),l=-1;++l<p.length;)if(p[l]in e||(e[p[l]]=i),c.combineable){for(u=s;++u<r.length;)if(f=o.rules[r[u]],f&&f.combineable&&c.type!==f.type)for(m=n(p[l],f,o.rules,[]),d=-1;++d<m.length;)m[d]in e||(e[m[d]]=i)}}}})),S=o(((e,t)=>{var n=x();t.exports=i;var r=[];function i(e,t){var i=this;return n(i.data,e,i.data[t]||r,i),i}})),C=o(((e,t)=>{t.exports=n;function n(e){var t=this;return delete t.data[e],t}})),w=o(((e,t)=>{t.exports=n;function n(){return this.flags.WORDCHARS||null}})),T=o(((e,t)=>{var n=u(),r=x();t.exports=a;var i=/\s/g;function a(e,t,n){for(var r=e.toString(`utf8`),i=r.indexOf(`
11
- `)+1,a=r.indexOf(`
12
- `,i);a>-1;)r.charCodeAt(i)!==9&&o(r.slice(i,a),t,n),i=a+1,a=r.indexOf(`
13
- `,i);o(r.slice(i),t,n)}function o(e,t,a){for(var o=e.indexOf(`/`),s=e.indexOf(`#`),c=``,l,u;o>-1&&e.charCodeAt(o-1)===92;)e=e.slice(0,o-1)+e.slice(o),o=e.indexOf(`/`,o);s>-1?o>-1&&o<s?(l=e.slice(0,o),i.lastIndex=o+1,u=i.exec(e),c=e.slice(o+1,u?u.index:void 0)):l=e.slice(0,s):o>-1?(l=e.slice(0,o),c=e.slice(o+1)):l=e,l=l.trim(),l&&r(a,l,n(t.flags,c.trim()),t)}})),E=o(((e,t)=>{var n=T();t.exports=r;function r(e){var t=this,r=-1,i,a,o,s;for(n(e,t,t.data);++r<t.compoundRules.length;){for(i=t.compoundRules[r],a=``,s=-1;++s<i.length;)o=i.charAt(s),a+=t.compoundRuleCodes[o].length?`(?:`+t.compoundRuleCodes[o].join(`|`)+`)`:o;t.compoundRules[r]=new RegExp(a,`i`)}return t}})),D=o(((e,t)=>{t.exports=n;function n(e){var t=this,n=e.toString(`utf8`).split(`
1
+ (function(){var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),l=o(((e,t)=>{
2
+ /*!
3
+ * Determine if an object is a Buffer
4
+ *
5
+ * @author Feross Aboukhadijeh <https://feross.org>
6
+ * @license MIT
7
+ */
8
+ t.exports=function(e){return e!=null&&e.constructor!=null&&typeof e.constructor.isBuffer==`function`&&e.constructor.isBuffer(e)}})),u=o(((e,t)=>{t.exports=r;var n=[];function r(e,t){var r=0,i;if(!t)return n;if(e.FLAG===`long`){for(i=Array(Math.ceil(t.length/2));r<t.length;)i[r/2]=t.slice(r,r+2),r+=2;return i}return t.split(e.FLAG===`num`?`,`:``)}})),d=o(((e,t)=>{var n=u();t.exports=s;var r=[].push,i=`etaoinshrdlcumwfgypbvkjxqz`.split(``),a=/\s+/,o=[`qwertzuop`,`yxcvbnm`,`qaw`,`say`,`wse`,`dsx`,`sy`,`edr`,`fdc`,`dx`,`rft`,`gfv`,`fc`,`tgz`,`hgb`,`gv`,`zhu`,`jhn`,`hb`,`uji`,`kjm`,`jn`,`iko`,`lkm`];function s(e){var t=Object.create(null),s=Object.create(null),u=Object.create(null),d=[],f={in:[],out:[]},p=[],m=e.toString(`utf8`),h=[],g=0,_=m.indexOf(`
9
+ `),v,y,b,x,S,C,w,T,E,D,O,k,A;for(u.KEY=[];_>-1;)j(m.slice(g,_)),g=_+1,_=m.indexOf(`
10
+ `,g);for(j(m.slice(g)),_=-1;++_<h.length;)if(y=h[_],v=y.split(a),b=v[0],b===`REP`){for(x=_+parseInt(v[1],10);++_<=x;)v=h[_].split(a),d.push([v[1],v[2]]);_--}else if(b===`ICONV`||b===`OCONV`){for(x=_+parseInt(v[1],10),T=f[b===`ICONV`?`in`:`out`];++_<=x;)v=h[_].split(a),T.push([new RegExp(v[1],`g`),v[2]]);_--}else if(b===`COMPOUNDRULE`){for(x=_+parseInt(v[1],10);++_<=x;)for(D=h[_].split(a)[1],E=-1,p.push(D);++E<D.length;)s[D.charAt(E)]=[];_--}else if(b===`PFX`||b===`SFX`){for(x=_+parseInt(v[3],10),D={type:b,combineable:v[2]===`Y`,entries:[]},t[v[1]]=D;++_<=x;){v=h[_].split(a),S=v[2],C=v[3].split(`/`),w=v[4],T={add:``,remove:``,match:``,continuation:n(u,C[1])},C&&C[0]!==`0`&&(T.add=C[0]);try{S!==`0`&&(T.remove=b===`SFX`?c(S):S),w&&w!==`.`&&(T.match=b===`SFX`?c(w):l(w))}catch{T=null}T&&D.entries.push(T)}_--}else if(b===`TRY`){for(w=v[1],k=-1,O=[];++k<w.length;)A=w.charAt(k),A.toLowerCase()===A&&O.push(A);for(k=-1;++k<i.length;)w.indexOf(i[k])<0&&O.push(i[k]);u[b]=O}else b===`KEY`?r.apply(u[b],v[1].split(`|`)):b===`COMPOUNDMIN`?u[b]=Number(v[1]):b===`ONLYINCOMPOUND`?(u[b]=v[1],s[v[1]]=[]):u[b]=v[1];return isNaN(u.COMPOUNDMIN)&&(u.COMPOUNDMIN=3),u.KEY.length||(u.KEY=o),u.TRY||=i.concat(),u.KEEPCASE||=!1,{compoundRuleCodes:s,replacementTable:d,conversion:f,compoundRules:p,rules:t,flags:u};function j(e){e=e.trim(),e&&e.charCodeAt(0)!==35&&h.push(e)}}function c(e){return RegExp(e+`$`)}function l(e){return RegExp(`^`+e)}})),f=o(((e,t)=>{t.exports=n;function n(e,t){for(var n=-1;++n<t.length;)e=e.replace(t[n][0],t[n][1]);return e}})),p=o(((e,t)=>{t.exports=n;function n(e,t,n){return n&&t in e&&n.indexOf(e[t])>-1}})),m=o(((e,t)=>{var n=p();t.exports=r;function r(e,t){var r=-1;if(e.data[t])return!n(e.flags,`ONLYINCOMPOUND`,e.data[t]);if(t.length>=e.flags.COMPOUNDMIN){for(;++r<e.compoundRules.length;)if(e.compoundRules[r].test(t))return!0}return!1}})),h=o(((e,t)=>{var n=f(),r=m(),i=p();t.exports=a;function a(e,t,a){var s=t.trim(),c;if(!s)return null;if(s=n(s,e.conversion.in),r(e,s))return!a&&i(e.flags,`FORBIDDENWORD`,e.data[s])?null:s;if(s.toUpperCase()===s){if(c=s.charAt(0)+s.slice(1).toLowerCase(),o(e.flags,e.data[c],a))return null;if(r(e,c))return c}if(c=s.toLowerCase(),c!==s){if(o(e.flags,e.data[c],a))return null;if(r(e,c))return c}return null}function o(e,t,n){return i(e,`KEEPCASE`,t)||n||i(e,`FORBIDDENWORD`,t)}})),g=o(((e,t)=>{var n=h();t.exports=r;function r(e){return!!n(this,e)}})),_=o(((e,t)=>{t.exports=n;function n(e){var t=r(e.charAt(0)),n=e.slice(1);return!n||(n=r(n),t===n)?t:t===`u`&&n===`l`?`s`:null}function r(e){return e===e.toLowerCase()?`l`:e===e.toUpperCase()?`u`:null}})),v=o(((e,t)=>{var n=_(),r=f(),i=p(),a=h();t.exports=s;var o=[].push;function s(e){var t=this,i={},a=[],s={},l,u,d=[],f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M,N,P;if(e=r(e.trim(),t.conversion.in),!e||t.correct(e))return[];for(P=n(e),p=-1;++p<t.replacementTable.length;)for(u=t.replacementTable[p],m=e.indexOf(u[0]);m>-1;)d.push(e.replace(u[0],u[1])),m=e.indexOf(u[0],m+1);for(p=-1;++p<e.length;)for(y=e.charAt(p),x=e.slice(0,p),S=e.slice(p+1),w=y.toLowerCase(),C=w!==y,i={},m=-1;++m<t.flags.KEY.length;)if(b=t.flags.KEY[m],h=b.indexOf(w),!(h<0)){for(_=-1;++_<b.length;)if(_!==h){if(v=b.charAt(_),i[v])continue;i[v]=!0,C&&(v=v.toUpperCase()),d.push(x+v+S)}}for(p=-1,O=e.charAt(0),f=[``],k=1,A=0;++p<e.length;){for(y=O,O=e.charAt(p+1),x=e.slice(0,p),u=y===O?``:y+y,m=-1,g=f.length;++m<g;)m<=k&&f.push(f[m]+u),f[m]+=y;++A<3&&(k=f.length)}for(o.apply(d,f),f=[e],u=e.toLowerCase(),(e===u||P===null)&&f.push(e.charAt(0).toUpperCase()+u.slice(1)),u=e.toUpperCase(),e!==u&&f.push(u),l={state:{},weighted:s,suggestions:a},T=c(t,l,f,d),E=0,k=Math.min(T.length,Math.max(15-e.length,3)**3),j=Math.max((10-e.length)**3,1);!a.length&&E<k;)D=E+j,c(t,l,T.slice(E,D)),E=D;for(a.sort(F),f=[],M=[],p=-1;++p<a.length;)N=r(a[p],t.conversion.out),u=N.toLowerCase(),M.indexOf(u)<0&&(f.push(N),M.push(u));return f;function F(e,t){return I(e,t)||L(e,t)||R(e,t)}function I(e,t){return s[e]===s[t]?0:s[e]>s[t]?-1:1}function L(e,t){var r=n(e),i=n(t);return r===i?0:r===P?-1:i===P?1:void 0}function R(e,t){return e.localeCompare(t)}}function c(e,t,r,o){var s=e.flags.TRY,c=e.data,l=e.flags,u=[],d=-1,f,p,m,h,g,_,v,y,b,x,S,C,w;if(o)for(;++d<o.length;)T(o[d],!0);for(d=-1;++d<r.length;)for(f=r[d],p=``,m=``,h=f.charAt(0),g=f,_=f.slice(1),v=h.toLowerCase()!==h,y=n(f),b=-1;++b<=f.length;)for(p+=m,x=g,g=_,_=g.slice(1),m=h,h=f.charAt(b+1),S=v,h&&(v=h.toLowerCase()!==h),g&&S!==v&&(T(p+E(g)),T(p+E(h)+E(m)+_)),T(p+g),g&&T(p+h+m+_),w=-1;++w<s.length;)C=s[w],S&&C!==C.toUpperCase()?(y!==`s`&&(T(p+C+x),T(p+C+g)),C=C.toUpperCase(),T(p+C+x),T(p+C+g)):(T(p+C+x),T(p+C+g));return u;function T(n,r){var o=t.state[n],s;o!==!!o&&(u.push(n),s=a(e,n),o=s&&!i(l,`NOSUGGEST`,c[s]),t.state[n]=o,o&&(t.weighted[n]=r?10:0,t.suggestions.push(n))),o&&t.weighted[n]++}function E(e){var t=e.charAt(0);return(t.toLowerCase()===t?t.toUpperCase():t.toLowerCase())+e.slice(1)}}})),y=o(((e,t)=>{var n=h(),r=p();t.exports=i;function i(e){var t=this,i=n(t,e,!0);return{correct:t.correct(e),forbidden:!!(i&&r(t.flags,`FORBIDDENWORD`,t.data[i])),warn:!!(i&&r(t.flags,`WARN`,t.data[i]))}}})),b=o(((e,t)=>{t.exports=n;function n(e,t,r,i){for(var a=-1,o,s,c,l,u;++a<t.entries.length;)if(o=t.entries[a],l=o.continuation,u=-1,(!o.match||o.match.test(e))&&(s=o.remove?e.replace(o.remove,``):e,s=t.type===`SFX`?s+o.add:o.add+s,i.push(s),l&&l.length))for(;++u<l.length;)c=r[l[u]],c&&n(s,c,r,i);return i}})),x=o(((e,t)=>{var n=b();t.exports=o;var r=[].push,i=[];function a(e,t,n){var a=e[t];t in e?a===i?e[t]=n.concat():r.apply(a,n):e[t]=n.concat()}function o(e,t,r,o){var s=-1,c,l,u,d,f,p,m;for((!(`NEEDAFFIX`in o.flags)||r.indexOf(o.flags.NEEDAFFIX)<0)&&a(e,t,r);++s<r.length;)if(c=o.rules[r[s]],r[s]in o.compoundRuleCodes&&o.compoundRuleCodes[r[s]].push(t),c){for(p=n(t,c,o.rules,[]),l=-1;++l<p.length;)if(p[l]in e||(e[p[l]]=i),c.combineable){for(u=s;++u<r.length;)if(f=o.rules[r[u]],f&&f.combineable&&c.type!==f.type)for(m=n(p[l],f,o.rules,[]),d=-1;++d<m.length;)m[d]in e||(e[m[d]]=i)}}}})),S=o(((e,t)=>{var n=x();t.exports=i;var r=[];function i(e,t){var i=this;return n(i.data,e,i.data[t]||r,i),i}})),C=o(((e,t)=>{t.exports=n;function n(e){var t=this;return delete t.data[e],t}})),w=o(((e,t)=>{t.exports=n;function n(){return this.flags.WORDCHARS||null}})),T=o(((e,t)=>{var n=u(),r=x();t.exports=a;var i=/\s/g;function a(e,t,n){for(var r=e.toString(`utf8`),i=r.indexOf(`
11
+ `)+1,a=r.indexOf(`
12
+ `,i);a>-1;)r.charCodeAt(i)!==9&&o(r.slice(i,a),t,n),i=a+1,a=r.indexOf(`
13
+ `,i);o(r.slice(i),t,n)}function o(e,t,a){for(var o=e.indexOf(`/`),s=e.indexOf(`#`),c=``,l,u;o>-1&&e.charCodeAt(o-1)===92;)e=e.slice(0,o-1)+e.slice(o),o=e.indexOf(`/`,o);s>-1?o>-1&&o<s?(l=e.slice(0,o),i.lastIndex=o+1,u=i.exec(e),c=e.slice(o+1,u?u.index:void 0)):l=e.slice(0,s):o>-1?(l=e.slice(0,o),c=e.slice(o+1)):l=e,l=l.trim(),l&&r(a,l,n(t.flags,c.trim()),t)}})),E=o(((e,t)=>{var n=T();t.exports=r;function r(e){var t=this,r=-1,i,a,o,s;for(n(e,t,t.data);++r<t.compoundRules.length;){for(i=t.compoundRules[r],a=``,s=-1;++s<i.length;)o=i.charAt(s),a+=t.compoundRuleCodes[o].length?`(?:`+t.compoundRuleCodes[o].join(`|`)+`)`:o;t.compoundRules[r]=new RegExp(a,`i`)}return t}})),D=o(((e,t)=>{t.exports=n;function n(e){var t=this,n=e.toString(`utf8`).split(`
14
14
  `),r=-1,i,a,o,s;for(t.flags.FORBIDDENWORD===void 0&&(t.flags.FORBIDDENWORD=!1),s=t.flags.FORBIDDENWORD;++r<n.length;)i=n[r].trim(),i&&(i=i.split(`/`),o=i[0],a=o.charAt(0)===`*`,a&&(o=o.slice(1)),t.add(o,i[1]),a&&t.data[o].push(s));return t}})),O=c(o(((e,t)=>{var n=l(),r=d();t.exports=a;var i=a.prototype;i.correct=g(),i.suggest=v(),i.spell=y(),i.add=S(),i.remove=C(),i.wordCharacters=w(),i.dictionary=E(),i.personal=D();function a(e,t){var i=-1,o;if(!(this instanceof a))return new a(e,t);if(typeof e==`string`||n(e)?(typeof t==`string`||n(t))&&(o=[{dic:t}]):e&&(`length`in e?(o=e,e=e[0]&&e[0].aff):(e.dic&&(o=[e]),e=e.aff)),!e)throw Error("Missing `aff` in dictionary");if(e=r(e),this.data=Object.create(null),this.compoundRuleCodes=e.compoundRuleCodes,this.replacementTable=e.replacementTable,this.conversion=e.conversion,this.compoundRules=e.compoundRules,this.rules=e.rules,this.flags=e.flags,o)for(;++i<o.length;)o[i].dic&&this.dictionary(o[i].dic)}}))(),1);let k=null,A=null,j=new Map,M=new Map;function N(e){return A||=(async()=>{let[t,n]=await Promise.all([fetch(`/dict/en.aff`).then(e=>e.text()),fetch(`/dict/en.dic`).then(e=>e.text())]);k=(0,O.default)(t,n);for(let t of e)k.add(t)})(),A}function P(e){let t=[],n=n=>{let r;for(;(r=n.exec(e))!==null;)t.push([r.index,r.index+r[0].length])};n(/```[\s\S]*?```/g),n(/~~~[\s\S]*?~~~/g),n(/`[^`\n]+`/g);let r=e.match(/^---\r?\n[\s\S]*?\r?\n---/);return r&&t.push([0,r[0].length]),n(/https?:\/\/[^\s)]+/g),n(/\]\([^)]*\)/g),n(/\[\[[^\]]*\]\]/g),n(/\{\{[^}]*\}\}/g),n(/<[^>]+>/g),t}function F(e,t){for(let[n,r]of t)if(e>=n&&e<r)return!0;return!1}function I(e,t){return e.correct(t)?!0:t.includes(`-`)?t.split(`-`).filter(Boolean).every(t=>!!(t.length<2||e.correct(t)||t.endsWith(`s`)&&e.correct(t.slice(0,-1))||t.endsWith(`es`)&&e.correct(t.slice(0,-2)))):!1}function L(e,t){let n=k;if(!n)return[];let r=P(e),i=[],a=/[A-Za-z]+(?:['’-][A-Za-z]+)*/g,o;for(;(o=a.exec(e))!==null;){let e=o[0],a=o.index;if(e.length<2||/\d/.test(e)||e===e.toUpperCase()||t.has(e.toLowerCase())||F(a,r))continue;let s=j.get(e);if(s===void 0&&(s=I(n,e),j.set(e,s)),s)continue;let c=M.get(e);c===void 0&&(c=n.suggest(e).slice(0,5),M.set(e,c)),i.push({from:a,to:a+e.length,word:e,suggestions:c})}return i}self.onmessage=async e=>{let t=e.data;if(t.type===`add`){await A,k&&t.word&&(k.add(t.word),j.delete(t.word));return}if(t.type===`check`){await N(t.customWords??[]);let e=new Set((t.customWords??[]).map(e=>e.toLowerCase())),n=L(t.text,e);self.postMessage({type:`result`,id:t.id,findings:n})}}})();
@@ -1,14 +1,14 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
- <title>hdoc edit</title>
8
- <script type="module" crossorigin src="/assets/index-BtxvGZHW.js"></script>
9
- <link rel="stylesheet" crossorigin href="/assets/index-Blewr90z.css">
10
- </head>
11
- <body>
12
- <div id="root"></div>
13
- </body>
14
- </html>
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>hdoc edit</title>
8
+ <script type="module" crossorigin src="/assets/index-BtxvGZHW.js"></script>
9
+ <link rel="stylesheet" crossorigin href="/assets/index-Blewr90z.css">
10
+ </head>
11
+ <body>
12
+ <div id="root"></div>
13
+ </body>
14
+ </html>
package/hdoc-build.js CHANGED
@@ -9,7 +9,6 @@
9
9
  const hdoc = require(path.join(__dirname, "hdoc-module.js"));
10
10
  const hdoc_build_db = require(path.join(__dirname, "hdoc-build-db.js"));
11
11
  const hdoc_build_embeddings = require(path.join(__dirname, "hdoc-build-embeddings.js"));
12
- const hdoc_build_onyx = require(path.join(__dirname, "hdoc-build-onyx.js"));
13
12
  const hdoc_build_pdf = require(path.join(__dirname, "hdoc-build-pdf.js"));
14
13
  const hdoc_index = require(path.join(__dirname, "hdoc-db.js"));
15
14
  const hdoc_mermaid = require(path.join(__dirname, "hdoc-mermaid.js"));
@@ -49,9 +48,14 @@
49
48
  "pdf-header-non-git.html",
50
49
  );
51
50
 
51
+ // Mermaid theme — SINGLE source shared with the client-side renderer
52
+ // (ui/js/doc.hornbill.js fetches the same file). Emitted into each queued
53
+ // diagram as YAML frontmatter; inline JSON is valid YAML, so no conversion.
52
54
  const mermaid_theme_path = path.resolve(
53
- templates_path,
54
- "mermaid-theme.yaml",
55
+ __dirname,
56
+ "ui",
57
+ "js",
58
+ "mermaid-theme.json",
55
59
  );
56
60
 
57
61
  const pdf_template_path = path.join(__dirname, "templates", "pdf");
@@ -171,7 +175,8 @@
171
175
 
172
176
  let definition = str;
173
177
  if (!definition.startsWith('---')) {
174
- definition = '---\n' + fs.readFileSync(mermaid_theme_path, {encoding: 'utf-8'}) + `\n---\n${definition}`;
178
+ const theme_json = fs.readFileSync(mermaid_theme_path, {encoding: 'utf-8'});
179
+ definition = `---\nconfig: ${JSON.stringify(JSON.parse(theme_json))}\n---\n${definition}`;
175
180
  }
176
181
 
177
182
  // Dedupe identical diagrams (same hash -> same output file).
@@ -1097,7 +1102,9 @@
1097
1102
  "hdocbook-project.json",
1098
1103
  );
1099
1104
  try {
1100
- hdocbook_project = require(hdocbook_project_config_path);
1105
+ hdocbook_project = JSON.parse(
1106
+ fs.readFileSync(hdocbook_project_config_path, "utf8"),
1107
+ );
1101
1108
  } catch (e) {
1102
1109
  console.error("File not found: hdocbook-project.json\n");
1103
1110
  console.error(
@@ -1147,7 +1154,7 @@
1147
1154
  const work_hdocbook_path = path.join(work_path, doc_id, "hdocbook.json");
1148
1155
 
1149
1156
  try {
1150
- hdocbook_config = require(hdocbook_path);
1157
+ hdocbook_config = JSON.parse(fs.readFileSync(hdocbook_path, "utf8"));
1151
1158
  } catch (e) {
1152
1159
  console.error(`File not found: ${doc_id}/hdocbook.json\n`);
1153
1160
  process.exit(1);
@@ -1476,6 +1483,7 @@
1476
1483
  browser,
1477
1484
  source_path,
1478
1485
  output_links,
1486
+ git_token,
1479
1487
  );
1480
1488
 
1481
1489
  // Close the Chromium browser instance
package/hdoc-bump.js CHANGED
@@ -1,123 +1,125 @@
1
- (() => {
2
- const fs = require("node:fs");
3
- const path = require("node:path");
4
-
5
- exports.run = (source_path, bump_type) => {
6
- if (
7
- bump_type !== "patch" &&
8
- bump_type !== "minor" &&
9
- bump_type !== "major"
10
- ) {
11
- console.error(`Unsupported bump type: ${bump_type}`);
12
- process.exit(1);
13
- }
14
- console.log(`Bumping ${bump_type} book version...\n`);
15
-
16
- // Get document ID
17
- const hdocbook_project_config_path = path.join(
18
- source_path,
19
- "hdocbook-project.json",
20
- );
21
- let hdocbook_project;
22
- try {
23
- hdocbook_project = require(hdocbook_project_config_path);
24
- } catch (e) {
25
- console.error("File not found: hdocbook-project.json:");
26
- console.error(e, "\n");
27
- console.error("hdoc bump needs to be run in the root of a HDoc Book.\n");
28
- process.exit(1);
29
- }
30
- const doc_id = hdocbook_project.docId;
31
-
32
- const book_path = path.join(source_path, doc_id);
33
- const hdocbook_path = path.join(book_path, "hdocbook.json");
34
-
35
- let hdocbook_config;
36
- try {
37
- hdocbook_config = require(hdocbook_path);
38
- } catch (e) {
39
- console.error("File not found: hdocbook.json");
40
- console.error(e, "\n");
41
- console.error("hdoc bump needs to be run in the root of a HDoc Book.\n");
42
- process.exit(1);
43
- }
44
- const initial_version = hdocbook_config.version;
45
- const hdocbook_version = hdocbook_config.version.split(".");
46
- if (hdocbook_version.length !== 3) {
47
- console.error(
48
- `Book version does not appear to be in a semantic versioning format: ${initial_version}`,
49
- );
50
- process.exit(1);
51
- }
52
-
53
- if (Number.isNaN(hdocbook_version[0])) {
54
- console.error(
55
- `Existing major version is not a number: ${hdocbook_version[0]}`,
56
- );
57
- process.exit(1);
58
- }
59
- if (Number.isNaN(hdocbook_version[1])) {
60
- console.error(
61
- `Existing minor version is not a number: ${hdocbook_version[1]}`,
62
- );
63
- process.exit(1);
64
- }
65
- if (Number.isNaN(hdocbook_version[2])) {
66
- console.error(
67
- `Existing patch version is not a number: ${hdocbook_version[2]}`,
68
- );
69
- process.exit(1);
70
- }
71
-
72
- switch (bump_type) {
73
- case "major":
74
- try {
75
- hdocbook_version[0] = Number.parseInt(hdocbook_version[0], 10) + 1;
76
- hdocbook_version[1] = 0;
77
- hdocbook_version[2] = 0;
78
- } catch (e) {
79
- console.error("Failed to update major version:");
80
- console.error(e);
81
- process.exit(1);
82
- }
83
- break;
84
- case "minor":
85
- try {
86
- hdocbook_version[0] = Number.parseInt(hdocbook_version[0], 10);
87
- hdocbook_version[1] = Number.parseInt(hdocbook_version[1], 10) + 1;
88
- hdocbook_version[2] = 0;
89
- } catch (e) {
90
- console.error("Failed to update minor version:");
91
- console.error(e);
92
- process.exit(1);
93
- }
94
- break;
95
- default:
96
- //case "patch" catered for with this default
97
- try {
98
- hdocbook_version[0] = Number.parseInt(hdocbook_version[0], 10);
99
- hdocbook_version[1] = Number.parseInt(hdocbook_version[1], 10);
100
- hdocbook_version[2] = Number.parseInt(hdocbook_version[2], 10) + 1;
101
- } catch (e) {
102
- console.error("Failed to update patch version:");
103
- console.error(e);
104
- process.exit(1);
105
- }
106
- break;
107
- }
108
-
109
- hdocbook_config.version = hdocbook_version.join(".");
110
-
111
- try {
112
- fs.writeFileSync(hdocbook_path, JSON.stringify(hdocbook_config, null, 2));
113
- } catch (e) {
114
- console.error("Error writing bumped version to book config:", e);
115
- process.exit(1);
116
- }
117
-
118
- console.log(
119
- `Book version updated from ${initial_version} to ${hdocbook_config.version}\n`,
120
- );
121
- return true;
122
- };
123
- })();
1
+ (() => {
2
+ const fs = require("node:fs");
3
+ const path = require("node:path");
4
+
5
+ exports.run = (source_path, bump_type) => {
6
+ if (
7
+ bump_type !== "patch" &&
8
+ bump_type !== "minor" &&
9
+ bump_type !== "major"
10
+ ) {
11
+ console.error(`Unsupported bump type: ${bump_type}`);
12
+ process.exit(1);
13
+ }
14
+ console.log(`Bumping ${bump_type} book version...\n`);
15
+
16
+ // Get document ID
17
+ const hdocbook_project_config_path = path.join(
18
+ source_path,
19
+ "hdocbook-project.json",
20
+ );
21
+ let hdocbook_project;
22
+ try {
23
+ hdocbook_project = JSON.parse(
24
+ fs.readFileSync(hdocbook_project_config_path, "utf8"),
25
+ );
26
+ } catch (e) {
27
+ console.error("File not found: hdocbook-project.json:");
28
+ console.error(e, "\n");
29
+ console.error("hdoc bump needs to be run in the root of a HDoc Book.\n");
30
+ process.exit(1);
31
+ }
32
+ const doc_id = hdocbook_project.docId;
33
+
34
+ const book_path = path.join(source_path, doc_id);
35
+ const hdocbook_path = path.join(book_path, "hdocbook.json");
36
+
37
+ let hdocbook_config;
38
+ try {
39
+ hdocbook_config = JSON.parse(fs.readFileSync(hdocbook_path, "utf8"));
40
+ } catch (e) {
41
+ console.error("File not found: hdocbook.json");
42
+ console.error(e, "\n");
43
+ console.error("hdoc bump needs to be run in the root of a HDoc Book.\n");
44
+ process.exit(1);
45
+ }
46
+ const initial_version = hdocbook_config.version;
47
+ const hdocbook_version = hdocbook_config.version.split(".");
48
+ if (hdocbook_version.length !== 3) {
49
+ console.error(
50
+ `Book version does not appear to be in a semantic versioning format: ${initial_version}`,
51
+ );
52
+ process.exit(1);
53
+ }
54
+
55
+ if (Number.isNaN(hdocbook_version[0])) {
56
+ console.error(
57
+ `Existing major version is not a number: ${hdocbook_version[0]}`,
58
+ );
59
+ process.exit(1);
60
+ }
61
+ if (Number.isNaN(hdocbook_version[1])) {
62
+ console.error(
63
+ `Existing minor version is not a number: ${hdocbook_version[1]}`,
64
+ );
65
+ process.exit(1);
66
+ }
67
+ if (Number.isNaN(hdocbook_version[2])) {
68
+ console.error(
69
+ `Existing patch version is not a number: ${hdocbook_version[2]}`,
70
+ );
71
+ process.exit(1);
72
+ }
73
+
74
+ switch (bump_type) {
75
+ case "major":
76
+ try {
77
+ hdocbook_version[0] = Number.parseInt(hdocbook_version[0], 10) + 1;
78
+ hdocbook_version[1] = 0;
79
+ hdocbook_version[2] = 0;
80
+ } catch (e) {
81
+ console.error("Failed to update major version:");
82
+ console.error(e);
83
+ process.exit(1);
84
+ }
85
+ break;
86
+ case "minor":
87
+ try {
88
+ hdocbook_version[0] = Number.parseInt(hdocbook_version[0], 10);
89
+ hdocbook_version[1] = Number.parseInt(hdocbook_version[1], 10) + 1;
90
+ hdocbook_version[2] = 0;
91
+ } catch (e) {
92
+ console.error("Failed to update minor version:");
93
+ console.error(e);
94
+ process.exit(1);
95
+ }
96
+ break;
97
+ default:
98
+ //case "patch" catered for with this default
99
+ try {
100
+ hdocbook_version[0] = Number.parseInt(hdocbook_version[0], 10);
101
+ hdocbook_version[1] = Number.parseInt(hdocbook_version[1], 10);
102
+ hdocbook_version[2] = Number.parseInt(hdocbook_version[2], 10) + 1;
103
+ } catch (e) {
104
+ console.error("Failed to update patch version:");
105
+ console.error(e);
106
+ process.exit(1);
107
+ }
108
+ break;
109
+ }
110
+
111
+ hdocbook_config.version = hdocbook_version.join(".");
112
+
113
+ try {
114
+ fs.writeFileSync(hdocbook_path, JSON.stringify(hdocbook_config, null, 2));
115
+ } catch (e) {
116
+ console.error("Error writing bumped version to book config:", e);
117
+ process.exit(1);
118
+ }
119
+
120
+ console.log(
121
+ `Book version updated from ${initial_version} to ${hdocbook_config.version}\n`,
122
+ );
123
+ return true;
124
+ };
125
+ })();