diff --git a/odoc.support/fonts/fira-mono-v14-latin-500.woff2 b/odoc.support/fonts/fira-mono-v14-latin-500.woff2 new file mode 100644 index 0000000..9d07a63 Binary files /dev/null and b/odoc.support/fonts/fira-mono-v14-latin-500.woff2 differ diff --git a/odoc.support/fonts/fira-mono-v14-latin-regular.woff2 b/odoc.support/fonts/fira-mono-v14-latin-regular.woff2 new file mode 100644 index 0000000..edc71a8 Binary files /dev/null and b/odoc.support/fonts/fira-mono-v14-latin-regular.woff2 differ diff --git a/odoc.support/fonts/fira-sans-v17-latin-500.woff2 b/odoc.support/fonts/fira-sans-v17-latin-500.woff2 new file mode 100644 index 0000000..24bb8f4 Binary files /dev/null and b/odoc.support/fonts/fira-sans-v17-latin-500.woff2 differ diff --git a/odoc.support/fonts/fira-sans-v17-latin-500italic.woff2 b/odoc.support/fonts/fira-sans-v17-latin-500italic.woff2 new file mode 100644 index 0000000..1a8b72d Binary files /dev/null and b/odoc.support/fonts/fira-sans-v17-latin-500italic.woff2 differ diff --git a/odoc.support/fonts/fira-sans-v17-latin-700.woff2 b/odoc.support/fonts/fira-sans-v17-latin-700.woff2 new file mode 100644 index 0000000..40b8a1c Binary files /dev/null and b/odoc.support/fonts/fira-sans-v17-latin-700.woff2 differ diff --git a/odoc.support/fonts/fira-sans-v17-latin-700italic.woff2 b/odoc.support/fonts/fira-sans-v17-latin-700italic.woff2 new file mode 100644 index 0000000..bdf8f5f Binary files /dev/null and b/odoc.support/fonts/fira-sans-v17-latin-700italic.woff2 differ diff --git a/odoc.support/fonts/fira-sans-v17-latin-italic.woff2 b/odoc.support/fonts/fira-sans-v17-latin-italic.woff2 new file mode 100644 index 0000000..b9619dd Binary files /dev/null and b/odoc.support/fonts/fira-sans-v17-latin-italic.woff2 differ diff --git a/odoc.support/fonts/fira-sans-v17-latin-regular.woff2 b/odoc.support/fonts/fira-sans-v17-latin-regular.woff2 new file mode 100644 index 0000000..d31eba8 Binary files /dev/null and b/odoc.support/fonts/fira-sans-v17-latin-regular.woff2 differ diff --git a/odoc.support/fonts/noticia-text-v15-latin-700.woff2 b/odoc.support/fonts/noticia-text-v15-latin-700.woff2 new file mode 100644 index 0000000..536fbe1 Binary files /dev/null and b/odoc.support/fonts/noticia-text-v15-latin-700.woff2 differ diff --git a/odoc.support/fonts/noticia-text-v15-latin-italic.woff2 b/odoc.support/fonts/noticia-text-v15-latin-italic.woff2 new file mode 100644 index 0000000..9b83b07 Binary files /dev/null and b/odoc.support/fonts/noticia-text-v15-latin-italic.woff2 differ diff --git a/odoc.support/fonts/noticia-text-v15-latin-regular.woff2 b/odoc.support/fonts/noticia-text-v15-latin-regular.woff2 new file mode 100644 index 0000000..efff29f Binary files /dev/null and b/odoc.support/fonts/noticia-text-v15-latin-regular.woff2 differ diff --git a/odoc.support/highlight.pack.js b/odoc.support/highlight.pack.js index a373159..7d1bcd0 100644 --- a/odoc.support/highlight.pack.js +++ b/odoc.support/highlight.pack.js @@ -302,7 +302,238 @@ e["after:highlightBlock"](Object.assign({block:t.el},t))})})(e),s.push(e)} },t.versionString="11.7.0",t.regex={concat:p,lookahead:d,either:f,optional:h, anyNumberOfTimes:u};for(const t in A)"object"==typeof A[t]&&e.exports(A[t]) ;return Object.assign(t,A),t})({});return te}() -;"object"==typeof exports&&"undefined"!=typeof module&&(module.exports=hljs);/*! `xml` grammar compiled for Highlight.js 11.7.0 */ +;"object"==typeof exports&&"undefined"!=typeof module&&(module.exports=hljs);/*! `reasonml` grammar compiled for Highlight.js 11.7.0 */ +(()=>{var e=(()=>{"use strict";return e=>{ +const n="~?[a-z$_][0-9a-zA-Z$_]*",a="`?[A-Z$_][0-9a-zA-Z$_]*",s="("+["||","++","**","+.","*","/","*.","/.","..."].map((e=>e.split("").map((e=>"\\"+e)).join(""))).join("|")+"|\\|>|&&|==|===)",i="\\s+"+s+"\\s+",r={ +keyword:"and as asr assert begin class constraint do done downto else end exception external for fun function functor if in include inherit initializer land lazy let lor lsl lsr lxor match method mod module mutable new nonrec object of open or private rec sig struct then to try type val virtual when while with", +built_in:"array bool bytes char exn|5 float int int32 int64 list lazy_t|5 nativeint|5 ref string unit ", +literal:"true false" +},l="\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)",t={ +className:"number",relevance:0,variants:[{begin:l},{begin:"\\(-"+l+"\\)"}]},c={ +className:"operator",relevance:0,begin:s},o=[{className:"identifier", +relevance:0,begin:n},c,t],g=[e.QUOTE_STRING_MODE,c,{className:"module", +begin:"\\b"+a,returnBegin:!0,relevance:0,end:".",contains:[{ +className:"identifier",begin:a,relevance:0}]}],b=[{className:"module", +begin:"\\b"+a,returnBegin:!0,end:".",relevance:0,contains:[{ +className:"identifier",begin:a,relevance:0}]}],m={className:"function", +relevance:0,keywords:r,variants:[{begin:"\\s(\\(\\.?.*?\\)|"+n+")\\s*=>", +end:"\\s*=>",returnBegin:!0,relevance:0,contains:[{className:"params", +variants:[{begin:n},{ +begin:"~?[a-z$_][0-9a-zA-Z$_]*(\\s*:\\s*[a-z$_][0-9a-z$_]*(\\(\\s*('?[a-z$_][0-9a-z$_]*\\s*(,'?[a-z$_][0-9a-z$_]*\\s*)*)?\\))?){0,2}" +},{begin:/\(\s*\)/}]}]},{begin:"\\s\\(\\.?[^;\\|]*\\)\\s*=>",end:"\\s=>", +returnBegin:!0,relevance:0,contains:[{className:"params",relevance:0,variants:[{ +begin:n,end:"(,|\\n|\\))",relevance:0,contains:[c,{className:"typing",begin:":", +end:"(,|\\n)",returnBegin:!0,relevance:0,contains:b}]}]}]},{ +begin:"\\(\\.\\s"+n+"\\)\\s*=>"}]};g.push(m);const d={className:"constructor", +begin:a+"\\(",end:"\\)",illegal:"\\n",keywords:r, +contains:[e.QUOTE_STRING_MODE,c,{className:"params",begin:"\\b"+n}]},u={ +className:"pattern-match",begin:"\\|",returnBegin:!0,keywords:r,end:"=>", +relevance:0,contains:[d,c,{relevance:0,className:"constructor",begin:a}]},v={ +className:"module-access",keywords:r,returnBegin:!0,variants:[{ +begin:"\\b("+a+"\\.)+"+n},{begin:"\\b("+a+"\\.)+\\(",end:"\\)",returnBegin:!0, +contains:[m,{begin:"\\(",end:"\\)",relevance:0,skip:!0}].concat(g)},{ +begin:"\\b("+a+"\\.)+\\{",end:/\}/}],contains:g};return b.push(v),{ +name:"ReasonML",aliases:["re"],keywords:r,illegal:"(:-|:=|\\$\\{|\\+=)", +contains:[e.COMMENT("/\\*","\\*/",{illegal:"^(#,\\/\\/)"}),{ +className:"character",begin:"'(\\\\[^']+|[^'])'",illegal:"\\n",relevance:0 +},e.QUOTE_STRING_MODE,{className:"literal",begin:"\\(\\)",relevance:0},{ +className:"literal",begin:"\\[\\|",end:"\\|\\]",relevance:0,contains:o},{ +className:"literal",begin:"\\[",end:"\\]",relevance:0,contains:o},d,{ +className:"operator",begin:i,illegal:"--\x3e",relevance:0 +},t,e.C_LINE_COMMENT_MODE,u,m,{className:"module-def", +begin:"\\bmodule\\s+"+n+"\\s+"+a+"\\s+=\\s+\\{",end:/\}/,returnBegin:!0, +keywords:r,relevance:0,contains:[{className:"module",relevance:0,begin:a},{ +begin:/\{/,end:/\}/,relevance:0,skip:!0}].concat(g)},v]}}})() +;hljs.registerLanguage("reasonml",e)})();/*! `javascript` grammar compiled for Highlight.js 11.7.0 */ +(()=>{var e=(()=>{"use strict" +;const e="[A-Za-z$_][0-9A-Za-z$_]*",n=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],a=["true","false","null","undefined","NaN","Infinity"],t=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],s=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],r=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],c=["arguments","this","super","console","window","document","localStorage","module","global"],i=[].concat(r,t,s) +;return o=>{const l=o.regex,b=e,d={begin:/<[A-Za-z0-9\\._:-]+/, +end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,n)=>{ +const a=e[0].length+e.index,t=e.input[a] +;if("<"===t||","===t)return void n.ignoreMatch();let s +;">"===t&&(((e,{after:n})=>{const a=""+e[0].slice(1) +;return-1!==e.input.indexOf(a,n)})(e,{after:a})||n.ignoreMatch()) +;const r=e.input.substring(a) +;((s=r.match(/^\s*=/))||(s=r.match(/^\s+extends\s+/))&&0===s.index)&&n.ignoreMatch() +}},g={$pattern:e,keyword:n,literal:a,built_in:i,"variable.language":c +},u="\\.([0-9](_?[0-9])*)",m="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",E={ +className:"number",variants:[{ +begin:`(\\b(${m})((${u})|\\.)?|(${u}))[eE][+-]?([0-9](_?[0-9])*)\\b`},{ +begin:`\\b(${m})\\b((${u})\\b|\\.)?|(${u})\\b`},{ +begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{ +begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{ +begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{ +begin:"\\b0[0-7]+n?\\b"}],relevance:0},A={className:"subst",begin:"\\$\\{", +end:"\\}",keywords:g,contains:[]},y={begin:"html`",end:"",starts:{end:"`", +returnEnd:!1,contains:[o.BACKSLASH_ESCAPE,A],subLanguage:"xml"}},N={ +begin:"css`",end:"",starts:{end:"`",returnEnd:!1, +contains:[o.BACKSLASH_ESCAPE,A],subLanguage:"css"}},_={className:"string", +begin:"`",end:"`",contains:[o.BACKSLASH_ESCAPE,A]},h={className:"comment", +variants:[o.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{ +begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag", +begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0, +excludeBegin:!0,relevance:0},{className:"variable",begin:b+"(?=\\s*(-)|$)", +endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}] +}),o.C_BLOCK_COMMENT_MODE,o.C_LINE_COMMENT_MODE] +},f=[o.APOS_STRING_MODE,o.QUOTE_STRING_MODE,y,N,_,{match:/\$\d+/},E] +;A.contains=f.concat({begin:/\{/,end:/\}/,keywords:g,contains:["self"].concat(f) +});const v=[].concat(h,A.contains),p=v.concat([{begin:/\(/,end:/\)/,keywords:g, +contains:["self"].concat(v)}]),S={className:"params",begin:/\(/,end:/\)/, +excludeBegin:!0,excludeEnd:!0,keywords:g,contains:p},w={variants:[{ +match:[/class/,/\s+/,b,/\s+/,/extends/,/\s+/,l.concat(b,"(",l.concat(/\./,b),")*")], +scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{ +match:[/class/,/\s+/,b],scope:{1:"keyword",3:"title.class"}}]},R={relevance:0, +match:l.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/), +className:"title.class",keywords:{_:[...t,...s]}},O={variants:[{ +match:[/function/,/\s+/,b,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}], +className:{1:"keyword",3:"title.function"},label:"func.def",contains:[S], +illegal:/%/},k={ +match:l.concat(/\b/,(I=[...r,"super","import"],l.concat("(?!",I.join("|"),")")),b,l.lookahead(/\(/)), +className:"title.function",relevance:0};var I;const x={ +begin:l.concat(/\./,l.lookahead(l.concat(b,/(?![0-9A-Za-z$_(])/))),end:b, +excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},T={ +match:[/get|set/,/\s+/,b,/(?=\()/],className:{1:"keyword",3:"title.function"}, +contains:[{begin:/\(\)/},S] +},C="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+o.UNDERSCORE_IDENT_RE+")\\s*=>",M={ +match:[/const|var|let/,/\s+/,b,/\s*/,/=\s*/,/(async\s*)?/,l.lookahead(C)], +keywords:"async",className:{1:"keyword",3:"title.function"},contains:[S]} +;return{name:"Javascript",aliases:["js","jsx","mjs","cjs"],keywords:g,exports:{ +PARAMS_CONTAINS:p,CLASS_REFERENCE:R},illegal:/#(?![$_A-z])/, +contains:[o.SHEBANG({label:"shebang",binary:"node",relevance:5}),{ +label:"use_strict",className:"meta",relevance:10, +begin:/^\s*['"]use (strict|asm)['"]/ +},o.APOS_STRING_MODE,o.QUOTE_STRING_MODE,y,N,_,h,{match:/\$\d+/},E,R,{ +className:"attr",begin:b+l.lookahead(":"),relevance:0},M,{ +begin:"("+o.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*", +keywords:"return throw case",relevance:0,contains:[h,o.REGEXP_MODE,{ +className:"function",begin:C,returnBegin:!0,end:"\\s*=>",contains:[{ +className:"params",variants:[{begin:o.UNDERSCORE_IDENT_RE,relevance:0},{ +className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0, +excludeEnd:!0,keywords:g,contains:p}]}]},{begin:/,/,relevance:0},{match:/\s+/, +relevance:0},{variants:[{begin:"<>",end:">"},{ +match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:d.begin, +"on:begin":d.isTrulyOpeningTag,end:d.end}],subLanguage:"xml",contains:[{ +begin:d.begin,end:d.end,skip:!0,contains:["self"]}]}]},O,{ +beginKeywords:"while if switch catch for"},{ +begin:"\\b(?!function)"+o.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{", +returnBegin:!0,label:"func.def",contains:[S,o.inherit(o.TITLE_MODE,{begin:b, +className:"title.function"})]},{match:/\.\.\./,relevance:0},x,{match:"\\$"+b, +relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"}, +contains:[S]},k,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/, +className:"variable.constant"},w,T,{match:/\$[(.]/}]}}})() +;hljs.registerLanguage("javascript",e)})();/*! `sql` grammar compiled for Highlight.js 11.7.0 */ +(()=>{var e=(()=>{"use strict";return e=>{ +const r=e.regex,t=e.COMMENT("--","$"),n=["true","false","unknown"],a=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],i=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],s=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],o=i,c=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year","add","asc","collation","desc","final","first","last","view"].filter((e=>!i.includes(e))),l={ +begin:r.concat(/\b/,r.either(...o),/\s*\(/),relevance:0,keywords:{built_in:o}} +;return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{ +$pattern:/\b[\w\.]+/,keyword:((e,{exceptions:r,when:t}={})=>{const n=t +;return r=r||[],e.map((e=>e.match(/\|\d+$/)||r.includes(e)?e:n(e)?e+"|0":e)) +})(c,{when:e=>e.length<3}),literal:n,type:a, +built_in:["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"] +},contains:[{begin:r.either(...s),relevance:0,keywords:{$pattern:/[\w\.]+/, +keyword:c.concat(s),literal:n,type:a}},{className:"type", +begin:r.either("double precision","large object","with timezone","without timezone") +},l,{className:"variable",begin:/@[a-z0-9]+/},{className:"string",variants:[{ +begin:/'/,end:/'/,contains:[{begin:/''/}]}]},{begin:/"/,end:/"/,contains:[{ +begin:/""/}]},e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,t,{className:"operator", +begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0}]}}})() +;hljs.registerLanguage("sql",e)})();/*! `bash` grammar compiled for Highlight.js 11.7.0 */ +(()=>{var e=(()=>{"use strict";return e=>{const s=e.regex,t={},n={begin:/\$\{/, +end:/\}/,contains:["self",{begin:/:-/,contains:[t]}]};Object.assign(t,{ +className:"variable",variants:[{ +begin:s.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},n]});const a={ +className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},i={ +begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/, +end:/(\w+)/,className:"string"})]}},c={className:"string",begin:/"/,end:/"/, +contains:[e.BACKSLASH_ESCAPE,t,a]};a.contains.push(c);const o={begin:/\$?\(\(/, +end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,t] +},r=e.SHEBANG({binary:"(fish|bash|zsh|sh|csh|ksh|tcsh|dash|scsh)",relevance:10 +}),l={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0, +contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{ +name:"Bash",aliases:["sh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/, +keyword:["if","then","else","elif","fi","for","while","in","do","done","case","esac","function"], +literal:["true","false"], +built_in:["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset","alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","type","typeset","ulimit","unalias","set","shopt","autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp","chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"] +},contains:[r,e.SHEBANG(),l,o,e.HASH_COMMENT_MODE,i,{match:/(\/[a-z._-]+)+/},c,{ +className:"",begin:/\\"/},{className:"string",begin:/'/,end:/'/},t]}}})() +;hljs.registerLanguage("bash",e)})();/*! `shell` grammar compiled for Highlight.js 11.7.0 */ +(()=>{var s=(()=>{"use strict";return s=>({name:"Shell Session", +aliases:["console","shellsession"],contains:[{className:"meta.prompt", +begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/, +subLanguage:"bash"}}]})})();hljs.registerLanguage("shell",s)})();/*! `plaintext` grammar compiled for Highlight.js 11.7.0 */ +(()=>{var t=(()=>{"use strict";return t=>({name:"Plain text", +aliases:["text","txt"],disableAutodetect:!0})})() +;hljs.registerLanguage("plaintext",t)})();/*! `graphql` grammar compiled for Highlight.js 11.7.0 */ +(()=>{var e=(()=>{"use strict";return e=>{const a=e.regex;return{name:"GraphQL", +aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{ +keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"], +literal:["true","false","null"]}, +contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{ +scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation", +begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/, +end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{ +scope:"symbol",begin:a.concat(/[_A-Za-z][_0-9A-Za-z]*/,a.lookahead(/\s*:/)), +relevance:0}],illegal:[/[;<']/,/BEGIN/]}}})();hljs.registerLanguage("graphql",e) +})();/*! `ocaml` grammar compiled for Highlight.js 11.7.0 */ +(()=>{var e=(()=>{"use strict";return e=>({name:"OCaml",aliases:["ml"], +keywords:{$pattern:"[a-z_]\\w*!?", +keyword:"and as assert asr begin class constraint do done downto else end exception external for fun function functor if in include inherit! inherit initializer land lazy let lor lsl lsr lxor match method!|10 method mod module mutable new object of open! open or private rec sig struct then to try type val! val virtual when while with parser value", +built_in:"array bool bytes char exn|5 float int int32 int64 list lazy_t|5 nativeint|5 string unit in_channel out_channel ref", +literal:"true false"},illegal:/\/\/|>>/,contains:[{className:"literal", +begin:"\\[(\\|\\|)?\\]|\\(\\)",relevance:0},e.COMMENT("\\(\\*","\\*\\)",{ +contains:["self"]}),{className:"symbol",begin:"'[A-Za-z_](?!')[\\w']*"},{ +className:"type",begin:"`[A-Z][\\w']*"},{className:"type", +begin:"\\b[A-Z][\\w']*",relevance:0},{begin:"[a-z_]\\w*'[\\w']*",relevance:0 +},e.inherit(e.APOS_STRING_MODE,{className:"string",relevance:0 +}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null}),{className:"number", +begin:"\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)", +relevance:0},{begin:/->/}]})})();hljs.registerLanguage("ocaml",e)})();/*! `json` grammar compiled for Highlight.js 11.7.0 */ +(()=>{var e=(()=>{"use strict";return e=>{const a=["true","false","null"],n={ +scope:"literal",beginKeywords:a.join(" ")};return{name:"JSON",keywords:{ +literal:a},contains:[{className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/, +relevance:1.01},{match:/[{}[\],:]/,className:"punctuation",relevance:0 +},e.QUOTE_STRING_MODE,n,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE], +illegal:"\\S"}}})();hljs.registerLanguage("json",e)})();/*! `python` grammar compiled for Highlight.js 11.7.0 */ +(()=>{var e=(()=>{"use strict";return e=>{ +const n=e.regex,a=/[\p{XID_Start}_]\p{XID_Continue}*/u,i=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],s={ +$pattern:/[A-Za-z]\w+|__\w+__/,keyword:i, +built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"], +literal:["__debug__","Ellipsis","False","None","NotImplemented","True"], +type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"] +},t={className:"meta",begin:/^(>>>|\.\.\.) /},r={className:"subst",begin:/\{/, +end:/\}/,keywords:s,illegal:/#/},l={begin:/\{\{/,relevance:0},b={ +className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{ +begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/, +contains:[e.BACKSLASH_ESCAPE,t],relevance:10},{ +begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/, +contains:[e.BACKSLASH_ESCAPE,t],relevance:10},{ +begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/, +contains:[e.BACKSLASH_ESCAPE,t,l,r]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/, +end:/"""/,contains:[e.BACKSLASH_ESCAPE,t,l,r]},{begin:/([uU]|[rR])'/,end:/'/, +relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{ +begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/, +end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/, +contains:[e.BACKSLASH_ESCAPE,l,r]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/, +contains:[e.BACKSLASH_ESCAPE,l,r]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE] +},o="[0-9](_?[0-9])*",c=`(\\b(${o}))?\\.(${o})|\\b(${o})\\.`,d="\\b|"+i.join("|"),g={ +className:"number",relevance:0,variants:[{ +begin:`(\\b(${o})|(${c}))[eE][+-]?(${o})[jJ]?(?=${d})`},{begin:`(${c})[jJ]?`},{ +begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{ +begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})` +},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${o})[jJ](?=${d})` +}]},p={className:"comment",begin:n.lookahead(/# type:/),end:/$/,keywords:s, +contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={ +className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/, +end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s, +contains:["self",t,g,b,e.HASH_COMMENT_MODE]}]};return r.contains=[b,g,t],{ +name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:s, +illegal:/(<\/|->|\?)|=>/,contains:[t,g,{begin:/\bself\b/},{beginKeywords:"if", +relevance:0},b,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,a],scope:{ +1:"keyword",3:"title.function"},contains:[m]},{variants:[{ +match:[/\bclass/,/\s+/,a,/\s*/,/\(\s*/,a,/\s*\)/]},{match:[/\bclass/,/\s+/,a]}], +scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{ +className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[g,m,b]}]}}})() +;hljs.registerLanguage("python",e)})();/*! `xml` grammar compiled for Highlight.js 11.7.0 */ (()=>{var e=(()=>{"use strict";return e=>{ const a=e.regex,n=a.concat(/[\p{L}_]/u,a.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),s={ className:"symbol",begin:/&[a-z]+;|[0-9]+;|[a-f0-9]+;/},t={begin:/\s/, @@ -360,102 +591,44 @@ contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},{ begin:"^[-\\*]{3,}",end:"$"},a,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{ className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{ className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]}]}}})() -;hljs.registerLanguage("markdown",e)})();/*! `plaintext` grammar compiled for Highlight.js 11.7.0 */ -(()=>{var t=(()=>{"use strict";return t=>({name:"Plain text", -aliases:["text","txt"],disableAutodetect:!0})})() -;hljs.registerLanguage("plaintext",t)})();/*! `ocaml` grammar compiled for Highlight.js 11.7.0 */ -(()=>{var e=(()=>{"use strict";return e=>({name:"OCaml",aliases:["ml"], -keywords:{$pattern:"[a-z_]\\w*!?", -keyword:"and as assert asr begin class constraint do done downto else end exception external for fun function functor if in include inherit! inherit initializer land lazy let lor lsl lsr lxor match method!|10 method mod module mutable new object of open! open or private rec sig struct then to try type val! val virtual when while with parser value", -built_in:"array bool bytes char exn|5 float int int32 int64 list lazy_t|5 nativeint|5 string unit in_channel out_channel ref", -literal:"true false"},illegal:/\/\/|>>/,contains:[{className:"literal", -begin:"\\[(\\|\\|)?\\]|\\(\\)",relevance:0},e.COMMENT("\\(\\*","\\*\\)",{ -contains:["self"]}),{className:"symbol",begin:"'[A-Za-z_](?!')[\\w']*"},{ -className:"type",begin:"`[A-Z][\\w']*"},{className:"type", -begin:"\\b[A-Z][\\w']*",relevance:0},{begin:"[a-z_]\\w*'[\\w']*",relevance:0 -},e.inherit(e.APOS_STRING_MODE,{className:"string",relevance:0 -}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null}),{className:"number", -begin:"\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)", -relevance:0},{begin:/->/}]})})();hljs.registerLanguage("ocaml",e)})();/*! `python` grammar compiled for Highlight.js 11.7.0 */ -(()=>{var e=(()=>{"use strict";return e=>{ -const n=e.regex,a=/[\p{XID_Start}_]\p{XID_Continue}*/u,i=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],s={ -$pattern:/[A-Za-z]\w+|__\w+__/,keyword:i, -built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"], -literal:["__debug__","Ellipsis","False","None","NotImplemented","True"], -type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"] -},t={className:"meta",begin:/^(>>>|\.\.\.) /},r={className:"subst",begin:/\{/, -end:/\}/,keywords:s,illegal:/#/},l={begin:/\{\{/,relevance:0},b={ -className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{ -begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/, -contains:[e.BACKSLASH_ESCAPE,t],relevance:10},{ -begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/, -contains:[e.BACKSLASH_ESCAPE,t],relevance:10},{ -begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/, -contains:[e.BACKSLASH_ESCAPE,t,l,r]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/, -end:/"""/,contains:[e.BACKSLASH_ESCAPE,t,l,r]},{begin:/([uU]|[rR])'/,end:/'/, -relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{ -begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/, -end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/, -contains:[e.BACKSLASH_ESCAPE,l,r]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/, -contains:[e.BACKSLASH_ESCAPE,l,r]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE] -},o="[0-9](_?[0-9])*",c=`(\\b(${o}))?\\.(${o})|\\b(${o})\\.`,d="\\b|"+i.join("|"),g={ -className:"number",relevance:0,variants:[{ -begin:`(\\b(${o})|(${c}))[eE][+-]?(${o})[jJ]?(?=${d})`},{begin:`(${c})[jJ]?`},{ -begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{ -begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})` -},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${o})[jJ](?=${d})` -}]},p={className:"comment",begin:n.lookahead(/# type:/),end:/$/,keywords:s, -contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={ -className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/, -end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s, -contains:["self",t,g,b,e.HASH_COMMENT_MODE]}]};return r.contains=[b,g,t],{ -name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:s, -illegal:/(<\/|->|\?)|=>/,contains:[t,g,{begin:/\bself\b/},{beginKeywords:"if", -relevance:0},b,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,a],scope:{ -1:"keyword",3:"title.function"},contains:[m]},{variants:[{ -match:[/\bclass/,/\s+/,a,/\s*/,/\(\s*/,a,/\s*\)/]},{match:[/\bclass/,/\s+/,a]}], -scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{ -className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[g,m,b]}]}}})() -;hljs.registerLanguage("python",e)})();/*! `reasonml` grammar compiled for Highlight.js 11.7.0 */ -(()=>{var e=(()=>{"use strict";return e=>{ -const n="~?[a-z$_][0-9a-zA-Z$_]*",a="`?[A-Z$_][0-9a-zA-Z$_]*",s="("+["||","++","**","+.","*","/","*.","/.","..."].map((e=>e.split("").map((e=>"\\"+e)).join(""))).join("|")+"|\\|>|&&|==|===)",i="\\s+"+s+"\\s+",r={ -keyword:"and as asr assert begin class constraint do done downto else end exception external for fun function functor if in include inherit initializer land lazy let lor lsl lsr lxor match method mod module mutable new nonrec object of open or private rec sig struct then to try type val virtual when while with", -built_in:"array bool bytes char exn|5 float int int32 int64 list lazy_t|5 nativeint|5 ref string unit ", -literal:"true false" -},l="\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)",t={ -className:"number",relevance:0,variants:[{begin:l},{begin:"\\(-"+l+"\\)"}]},c={ -className:"operator",relevance:0,begin:s},o=[{className:"identifier", -relevance:0,begin:n},c,t],g=[e.QUOTE_STRING_MODE,c,{className:"module", -begin:"\\b"+a,returnBegin:!0,relevance:0,end:".",contains:[{ -className:"identifier",begin:a,relevance:0}]}],b=[{className:"module", -begin:"\\b"+a,returnBegin:!0,end:".",relevance:0,contains:[{ -className:"identifier",begin:a,relevance:0}]}],m={className:"function", -relevance:0,keywords:r,variants:[{begin:"\\s(\\(\\.?.*?\\)|"+n+")\\s*=>", -end:"\\s*=>",returnBegin:!0,relevance:0,contains:[{className:"params", -variants:[{begin:n},{ -begin:"~?[a-z$_][0-9a-zA-Z$_]*(\\s*:\\s*[a-z$_][0-9a-z$_]*(\\(\\s*('?[a-z$_][0-9a-z$_]*\\s*(,'?[a-z$_][0-9a-z$_]*\\s*)*)?\\))?){0,2}" -},{begin:/\(\s*\)/}]}]},{begin:"\\s\\(\\.?[^;\\|]*\\)\\s*=>",end:"\\s=>", -returnBegin:!0,relevance:0,contains:[{className:"params",relevance:0,variants:[{ -begin:n,end:"(,|\\n|\\))",relevance:0,contains:[c,{className:"typing",begin:":", -end:"(,|\\n)",returnBegin:!0,relevance:0,contains:b}]}]}]},{ -begin:"\\(\\.\\s"+n+"\\)\\s*=>"}]};g.push(m);const d={className:"constructor", -begin:a+"\\(",end:"\\)",illegal:"\\n",keywords:r, -contains:[e.QUOTE_STRING_MODE,c,{className:"params",begin:"\\b"+n}]},u={ -className:"pattern-match",begin:"\\|",returnBegin:!0,keywords:r,end:"=>", -relevance:0,contains:[d,c,{relevance:0,className:"constructor",begin:a}]},v={ -className:"module-access",keywords:r,returnBegin:!0,variants:[{ -begin:"\\b("+a+"\\.)+"+n},{begin:"\\b("+a+"\\.)+\\(",end:"\\)",returnBegin:!0, -contains:[m,{begin:"\\(",end:"\\)",relevance:0,skip:!0}].concat(g)},{ -begin:"\\b("+a+"\\.)+\\{",end:/\}/}],contains:g};return b.push(v),{ -name:"ReasonML",aliases:["re"],keywords:r,illegal:"(:-|:=|\\$\\{|\\+=)", -contains:[e.COMMENT("/\\*","\\*/",{illegal:"^(#,\\/\\/)"}),{ -className:"character",begin:"'(\\\\[^']+|[^'])'",illegal:"\\n",relevance:0 -},e.QUOTE_STRING_MODE,{className:"literal",begin:"\\(\\)",relevance:0},{ -className:"literal",begin:"\\[\\|",end:"\\|\\]",relevance:0,contains:o},{ -className:"literal",begin:"\\[",end:"\\]",relevance:0,contains:o},d,{ -className:"operator",begin:i,illegal:"--\x3e",relevance:0 -},t,e.C_LINE_COMMENT_MODE,u,m,{className:"module-def", -begin:"\\bmodule\\s+"+n+"\\s+"+a+"\\s+=\\s+\\{",end:/\}/,returnBegin:!0, -keywords:r,relevance:0,contains:[{className:"module",relevance:0,begin:a},{ -begin:/\{/,end:/\}/,relevance:0,skip:!0}].concat(g)},v]}}})() -;hljs.registerLanguage("reasonml",e)})(); \ No newline at end of file +;hljs.registerLanguage("markdown",e)})();/*! `c` grammar compiled for Highlight.js 11.7.0 */ +(()=>{var e=(()=>{"use strict";return e=>{const n=e.regex,t=e.COMMENT("//","$",{ +contains:[{begin:/\\\n/}] +}),s="[a-zA-Z_]\\w*::",a="(decltype\\(auto\\)|"+n.optional(s)+"[a-zA-Z_]\\w*"+n.optional("<[^<>]+>")+")",r={ +className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{ +match:/\batomic_[a-z]{3,6}\b/}]},i={className:"string",variants:[{ +begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{ +begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)", +end:"'",illegal:"."},e.END_SAME_AS_BEGIN({ +begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},l={ +className:"number",variants:[{begin:"\\b(0b[01']+)"},{ +begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)" +},{ +begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)" +}],relevance:0},o={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{ +keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include" +},contains:[{begin:/\\\n/,relevance:0},e.inherit(i,{className:"string"}),{ +className:"string",begin:/<.*?>/},t,e.C_BLOCK_COMMENT_MODE]},c={ +className:"title",begin:n.optional(s)+e.IDENT_RE,relevance:0 +},d=n.optional(s)+e.IDENT_RE+"\\s*\\(",u={ +keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"], +type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal128","const","static","complex","bool","imaginary"], +literal:"true false NULL", +built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr" +},g=[o,r,t,e.C_BLOCK_COMMENT_MODE,l,i],m={variants:[{begin:/=/,end:/;/},{ +begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}], +keywords:u,contains:g.concat([{begin:/\(/,end:/\)/,keywords:u, +contains:g.concat(["self"]),relevance:0}]),relevance:0},p={ +begin:"("+a+"[\\*&\\s]+)+"+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0, +keywords:u,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)", +keywords:u,relevance:0},{begin:d,returnBegin:!0,contains:[e.inherit(c,{ +className:"title.function"})],relevance:0},{relevance:0,match:/,/},{ +className:"params",begin:/\(/,end:/\)/,keywords:u,relevance:0, +contains:[t,e.C_BLOCK_COMMENT_MODE,i,l,r,{begin:/\(/,end:/\)/,keywords:u, +relevance:0,contains:["self",t,e.C_BLOCK_COMMENT_MODE,i,l,r]}] +},r,t,e.C_BLOCK_COMMENT_MODE,o]};return{name:"C",aliases:["h"],keywords:u, +disableAutodetect:!0,illegal:"",contains:[].concat(m,p,g,[o,{ +begin:e.IDENT_RE+"::",keywords:u},{className:"class", +beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{ +beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:o, +strings:i,keywords:u}}}})();hljs.registerLanguage("c",e)})(); diff --git a/odoc.support/odoc.css b/odoc.support/odoc.css index 8b0ed5a..71148de 100644 --- a/odoc.support/odoc.css +++ b/odoc.support/odoc.css @@ -1,19 +1,108 @@ @charset "UTF-8"; /* Copyright (c) 2016 The odoc contributors. All rights reserved. Distributed under the ISC license, see terms at the end of the file. - odoc 2.2.0 */ + odoc 2.4.2 */ /* Fonts */ -@import url('https://fonts.googleapis.com/css?family=Fira+Mono:400,500'); -@import url('https://fonts.googleapis.com/css?family=Noticia+Text:400,400i,700'); -@import url('https://fonts.googleapis.com/css?family=Fira+Sans:400,400i,500,500i,600,600i,700,700i'); +/* noticia-text-regular - latin */ +@font-face { + font-family: 'Noticia Text'; + font-style: normal; + font-weight: 400; + src: url('fonts/noticia-text-v15-latin-regular.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */ +} + +/* noticia-text-italic - latin */ +@font-face { + font-family: 'Noticia Text'; + font-style: italic; + font-weight: 400; + src: url('fonts/noticia-text-v15-latin-italic.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */ +} + +/* noticia-text-700 - latin */ +@font-face { + font-family: 'Noticia Text'; + font-style: normal; + font-weight: 700; + src: url('fonts/noticia-text-v15-latin-700.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */ +} + +/* fira-mono-regular - latin */ +@font-face { + font-family: 'Fira Mono'; + font-style: normal; + font-weight: 400; + src: url('fonts/fira-mono-v14-latin-regular.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */ +} + +/* fira-mono-500 - latin */ +@font-face { + font-family: 'Fira Mono'; + font-style: normal; + font-weight: 500; + src: url('fonts/fira-mono-v14-latin-500.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */ +} + +/* fira-sans-regular - latin */ +@font-face { + font-family: 'Fira Sans'; + font-style: normal; + font-weight: 400; + src: url('fonts/fira-sans-v17-latin-regular.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */ +} + +/* fira-sans-italic - latin */ +@font-face { + font-family: 'Fira Sans'; + font-style: italic; + font-weight: 400; + src: url('fonts/fira-sans-v17-latin-italic.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */ +} + +/* fira-sans-500 - latin */ +@font-face { + font-family: 'Fira Sans'; + font-style: normal; + font-weight: 500; + src: url('fonts/fira-sans-v17-latin-500.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */ +} + +/* fira-sans-500italic - latin */ +@font-face { + font-family: 'Fira Sans'; + font-style: italic; + font-weight: 500; + src: url('fonts/fira-sans-v17-latin-500italic.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */ +} + +/* fira-sans-700 - latin */ +@font-face { + font-family: 'Fira Sans'; + font-style: normal; + font-weight: 700; + src: url('fonts/fira-sans-v17-latin-700.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */ +} + +/* fira-sans-700italic - latin */ +@font-face { + font-family: 'Fira Sans'; + font-style: italic; + font-weight: 700; + src: url('fonts/fira-sans-v17-latin-700italic.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */ +} + :root, .light:root { - --main-background: #FFFFFF; + + scroll-padding-top: calc(var(--search-bar-height) + var(--search-padding-top) + 1em); + + --main-background: #FFFFFF; --color: #333333; --link-color: #2C94BD; + --source-color: grey; --anchor-hover: #555; --anchor-color: #d5d5d5; --xref-shadow: #cc6666; @@ -30,13 +119,21 @@ --toc-color: #1F2D3D; --toc-before-color: #777; --toc-background: #f6f8fa; + --toc-background-emph: #ecf0f5; --toc-list-border: #ccc; --spec-summary-border-color: #5c9cf5; + --spec-label-color: green; --spec-summary-background: var(--code-background); --spec-summary-hover-background: #ebeff2; --spec-details-after-background: rgba(0, 4, 15, 0.05); --spec-details-after-shadow: rgba(204, 204, 204, 0.53); + + --search-results-border: #bbb; + --search-results-shadow: #bbb; + + --search-snake: #82aaff; + } .dark:root { @@ -64,6 +161,7 @@ --li-code-color: #999; --toc-color: #777; --toc-background: #252525; + --toc-background-emph: #2a2a2a; --hljs-link: #999; --hljs-keyword: #cda869; @@ -72,6 +170,12 @@ --hljs-type: #ac885b; --hljs-meta: #82aaff; --hljs-variable: #cf6a4c; + + --spec-label-color: lightgreen; + + --search-results-border: #505050; + --search-results-shadow: #404040; + } @media (prefers-color-scheme: dark) { @@ -106,6 +210,7 @@ --toc-color: #777; --toc-before-color: #777; --toc-background: #252525; + --toc-background-emph: #2a2a2a; --toc-list-border: #ccc; --spec-summary-hover-background: #ebeff2; --spec-details-after-background: rgba(0, 4, 15, 0.05); @@ -118,6 +223,12 @@ --hljs-type: #ac885b; --hljs-meta: #82aaff; --hljs-variable: #cf6a4c; + + --spec-label-color: lightgreen; + + --search-results-border: #505050; + --search-results-shadow: #404040; + } } @@ -142,6 +253,7 @@ table { html { font-size: 15px; + scroll-behavior: smooth; } body { @@ -149,24 +261,55 @@ body { background: #FFFFFF; color: var(--color); background-color: var(--main-background); + font-family: "Noticia Text", Georgia, serif; + line-height: 1.5; } body { - max-width: 100ex; - margin-left: calc(10vw + 20ex); - margin-right: 4ex; - margin-top: 20px; - margin-bottom: 50px; - font-family: "Noticia Text", Georgia, serif; - line-height: 1.5; + margin-left: auto; + margin-right: auto; + padding: 0 4ex; +} + +body.odoc { + max-width: 132ex; + display: grid; + grid-template-columns: min-content 1fr; + column-gap: 4ex; + row-gap: 2ex; +} + +body.odoc-src { + margin-right: calc(10vw + 20ex); +} + +.odoc-content { + grid-row: 4; + grid-column: 2; +} + +.odoc-preamble > *:first-child { + /* This make the first thing in the preamble align with the sidebar */ + padding-top: 0; + margin-top: 0; } header { margin-bottom: 30px; } +header.odoc-preamble { + grid-column: 2; + grid-row: 3; +} + nav { - font-family: "Fira Sans", Helvetica, Arial, sans-serif; + font-family: "Fira Sans", sans-serif; +} + +nav.odoc-nav { + grid-column: 2; + grid-row: 2; } /* Basic markup elements */ @@ -238,6 +381,10 @@ a { color: var(--link-color); } +.odoc-src pre a { + color: inherit; +} + a:hover { box-shadow: 0 1px 0 0 var(--link-color); } @@ -289,18 +436,30 @@ a.anchor { box-shadow: 0 1px 0 0 var(--xref-shadow); } +/* Source links float inside preformated text or headings. */ +a.source_link { + float: right; + color: var(--source-color); + font-family: "Fira Sans", sans-serif; + font-size: initial; +} + /* Section and document divisions. Until at least 4.03 many of the modules of the stdlib start at .h7, we restart the sequence there like h2 */ h1, h2, h3, h4, h5, h6, .h7, .h8, .h9, .h10 { - font-family: "Fira Sans", Helvetica, Arial, sans-serif; + font-family: "Fira Sans", sans-serif; font-weight: 400; padding-top: 0.1em; line-height: 1.2; overflow-wrap: break-word; } +.odoc-preamble h1 { + margin-top: 10px; +} + h1 { font-weight: 500; font-size: 2.441em; @@ -348,7 +507,7 @@ h4 { font-size: 1.12em; } -/* Comment delimiters, hidden but accessible to screen readers and +/* Comment delimiters, hidden but accessible to screen readers and selected for copy/pasting */ /* Taken from bootstrap */ @@ -368,36 +527,36 @@ h4 { /* Preformatted and code */ tt, code, pre { - font-family: "Fira Mono", courier; + font-family: "Fira Mono", monospace; font-weight: 400; } -pre { +.odoc pre { padding: 0.1em; border: 1px solid var(--pre-border-color); border-radius: 5px; overflow-x: auto; } -p code, -li code { +.odoc p code, +.odoc li code { background-color: var(--li-code-background); color: var(--li-code-color); border-radius: 3px; padding: 0 0.3ex; } -p a > code { +p a > code, li a > code { color: var(--link-color); } -code { +.odoc code { white-space: pre-wrap; } /* Code blocks (e.g. Examples) */ -pre code { +.odoc pre code { font-size: 0.893rem; } @@ -419,6 +578,10 @@ pre code { padding: 0.35em 0.5em; } +.spec .label, .spec .optlabel { + color: var(--spec-label-color); +} + li:not(:last-child) > .def-doc { margin-bottom: 15px; } @@ -434,10 +597,10 @@ div.odoc-spec,.odoc-include { .spec.type .variant, .spec.type .record { margin-left: 2ch; +} + +.spec.type li.variant, .spec.type li.record { list-style: none; - display: flex; - flex-wrap: wrap; - row-gap: 4px; } .spec.type .record > code, .spec.type .variant > code { @@ -454,9 +617,8 @@ div.odoc-spec,.odoc-include { padding: 0.25em 0.5em; margin-left: 10%; border-radius: 3px; - flex-grow:1; background: var(--main-background); - box-shadow: 2px 2px 4px lightgrey; + box-shadow: 1px 1px 2px lightgrey; } div.def { @@ -536,6 +698,12 @@ td.def-doc *:first-child { .at-tags li { padding-left: 3ex; text-indent: -3ex; } .at-tags .at-tag { text-transform: capitalize } +/* Alert emoji */ + +.alert::before, .deprecated::before { + content: '⚠️ '; +} + /* Lists of modules */ .modules { list-style-type: none; margin-left: -3ex; } @@ -618,19 +786,32 @@ td.def-doc *:first-child { line-height: 1.2; } +/* When a search bar is present, we need the sticky sidebar to be a bit lower, + so `top` is higher */ + +.odoc-search + * + .odoc-toc { + --toc-top: calc(var(--search-bar-height) + var(--search-padding-top) + 20px); + max-height: calc(100vh - 2 * var(--toc-top)); + top: var(--toc-top) +} + .odoc-toc { - position: fixed; - top: 0px; - bottom: 0px; - left: 0px; - max-width: 30ex; - min-width: 26ex; - width: 20%; + --toc-top: 20px; + width: 28ex; background: var(--toc-background); overflow: auto; color: var(--toc-color); padding-left: 2ex; padding-right: 2ex; + grid-row-start: 3; + grid-row-end: 5; + grid-column: 1; + height: fit-content; + border: solid 1px var(--border); + border-radius: 5px; + position:sticky; + max-height: calc(100vh - 2 * var(--toc-top)); + top: var(--toc-top) } .odoc-toc ul li a { @@ -638,15 +819,287 @@ td.def-doc *:first-child { font-size: 0.95em; color: var(--color); font-weight: 400; - line-height: 1.6em; + line-height: 1.2em; display: block; } -.odoc-toc ul li a:hover { +.odoc-sidebar ul li a:hover { box-shadow: none; text-decoration: underline; } +:root { + --search-bar-height: 25px; + --search-padding-top: 1rem; +} + +.odoc-search { + position: sticky; + top: 0; + background: var(--main-background); + /* This amounts to fit-content when the search is not active, but when you + have the search results displayed, you do not want the height of the search + container to change. */ + height: calc(var(--search-bar-height) + var(--search-padding-top)); + width: 100%; + padding-top: var(--search-padding-top); + z-index: 1; + grid-row: 1; + grid-column-start: 1; + grid-column-end: 3; +} + + +.odoc-search .search-inner { + width: 100%; + position: relative; + left: 0; + display: grid; + /* The second column is for the search snake, which has 0 width */ + grid-template-columns: 1fr 0fr; + grid-row-gap: 1rem; + /* The second row is for the search results. It has a width, but only */ + grid-template-rows: min-content 0px; + background: transparent; +} + +.odoc-search .search-bar { + position: relative; + z-index: 2; + font-size: 1em; + transition: font-size 0.3s; + box-shadow: 0px 0px 0.2rem 0.3em var(--main-background); + height: var(--search-bar-height); +} + +.odoc-search:focus-within .search-bar { + font-size: 1.1em; +} + +.odoc-search:not(:focus-within) .search-result { + display: none; +} + +.odoc-search .search-result:empty { + display: none; +} + +.odoc-search .search-result { + grid-row: 2; + background: var(--toc-background); + position: absolute; + left: 0; + right: 0; + border: solid; + border-color: var(--search-results-border); + border-width: 1px; + border-radius: 6px; + box-shadow: 0 3px 10px 2px var(--search-results-shadow), 0 0 3px 4px var(--main-background), 0px -1rem 0px 0px var(--main-background); + /* Works better on smallish screens with this */ + max-height: calc(min(40rem, 50vh)); + overflow-y: auto; +} + +.search-bar { + /* inputs are of fixed size by default, even if you display:block them */ + width: 100%; +} + + +.odoc-search .search-no-result { + color: var(--color); + border-bottom: var(--search-results-border) solid 1px; + background-color: inherit; + outline: 0; + padding: 10px; + padding-right: 0.5rem; +} + +.search-bar-container { + display: flex; + align-items: stretch; + border-bottom: 1rem solid var(--main-background); +} + +.search-snake { + grid-row: 1; + grid-column: 2; + display: flex; + align-items: center; + width: 0; + z-index: 2; + position: relative; + left: 0; + margin-top: 4px; + margin-bottom: 4px; + /* Otherwise the search snake flickers for very fast searches. */ + transition: opacity 0.2s; + opacity: 0; +} + +.search-snake.search-busy { + opacity: 1; +} + +.search-snake:before { + content: " "; + display: block; + aspect-ratio: 1 / 1; + height: 100%; + margin-right: 4px; + border-radius: 50%; + border: 3px solid #aaa; + border-color: var(--search-snake) transparent var(--search-snake) transparent; + animation: search-snake 1.2s linear infinite; + position: absolute; + right: 0; +} + +@keyframes search-snake { + 0% { + transform: rotate(0deg); + } + + 100% { + transform: rotate(360deg); + } +} + +:root { + --kind-font-size-factor: 0.8; +} + +.odoc-search .search-entry { + color: var(--color); + display: grid; + /* Possible kinds are the following : + "doc" "type" "mod" "exn" "class" "meth" "cons" "sig" "cons" "field" "val" + and "ext". + As the longest is 5 characters (and the font monospace), we give 5 + character size to the column. However the font used for kind is a little + smaller, so we adjust by this factor. + */ + grid-template-columns: [kinds] calc(var(--kind-font-size-factor) * 5ch) [titles] 1fr; + column-gap: 0.5rem; + border-bottom: var(--search-results-border) solid 1px; + background-color: inherit; + outline: 0; + padding: 0.4rem 0.4rem 0.7rem 0.7rem; +} +.odoc-search .search-entry p { + margin: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.odoc-search .search-entry:focus-visible { + box-shadow: none; + background-color: var(--target-background); +} + +.odoc-search .search-entry:hover { + box-shadow: none; + background-color: var(--toc-background-emph); +} + +.odoc-search .search-entry .entry-kind { + grid-row: 1/2; + grid-column: 1/2; + line-height: 1.4rem; + font-size: calc(var(--kind-font-size-factor) * 1em); + font-weight: bold; + text-align: right; + position: relative; + bottom: 0; +} + +.odoc-search .search-entry pre { + border: none; + margin: 0; +} + +.odoc-search .search-entry pre code { + font-size: 1em; + background-color: var(--li-code-background); + color: var(--li-code-color); + border-radius: 3px; + padding: 0 0.3ex; +} + +.odoc-search .search-entry .entry-title { + width: 100%; + display: block; + grid-column: 2/2; + grid-row: 1/2; + align-self: end; + line-height: 1.4rem; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.odoc-search .entry-name { + font-weight: bold; +} + +.odoc-search .prefix-name { + font-weight: bold; +} + +.odoc-search .search-entry .prefix-name { + opacity: 0.7; +} + +.odoc-search .entry-rhs { + white-space: nowrap; +} + +.odoc-search .search-entry .entry-content { + flex-grow: 1; + flex-shrink: 1; + min-width: 0; +} + +.odoc-search .search-entry .entry-comment { + max-height: 1.5em; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + font-size: 0.95em; + grid-row: 2/2; + grid-column: 2/2; +} + +.odoc-search .search-entry .entry-comment ul { + white-space: nowrap; + display: inline; +} + +.odoc-search .search-entry .entry-comment li { + display: inline; + white-space: nowrap; +} + +.odoc-search .search-entry .entry-comment ul>li::before { + content: '•'; +} + +.odoc-search .search-entry .entry-comment div { + display: inline; + white-space: nowrap; +} + +.odoc-search .search-entry .entry-comment p { + display: inline; + white-space: nowrap; +} + +.odoc-search .search-entry .entry-comment code { + display: inline; + white-space: nowrap; +} + /* First level titles */ .odoc-toc>ul>li>a { @@ -655,6 +1108,7 @@ td.def-doc *:first-child { .odoc-toc li ul { margin: 0px; + padding-top: 0.25em; } .odoc-toc ul { @@ -662,8 +1116,9 @@ td.def-doc *:first-child { } .odoc-toc ul li { - margin: 0; + padding: 0.25em 0; } + .odoc-toc>ul>li { margin-bottom: 0.3em; } @@ -674,12 +1129,35 @@ td.def-doc *:first-child { padding-left: 12px; } +/* Tables */ + +.odoc-table { + margin: 1em; +} + +.odoc-table td, +.odoc-table th { + padding-left: 0.5em; + padding-right: 0.5em; + border: 1px solid black; +} + +.odoc-table th { + font-weight: bold; +} + /* Mobile adjustements. */ -@media only screen and (max-width: 95ex) { - body.odoc { +@media only screen and (max-width: 110ex) { + body { margin: 2em; + padding: 0; + } + + body.odoc { + display: block; } + .odoc-toc { position: static; width: auto; @@ -699,11 +1177,53 @@ td.def-doc *:first-child { color: black; background: white; } + body nav:first-child { visibility: hidden; } } +/* Source code. */ + +.source_container { + display: flex; +} + +.source_line_column { + padding-right: 0.5em; + text-align: right; + background: #eee8d5; +} + +.source_line { + padding: 0 1em; +} + +.source_code { + flex-grow: 1; + background: #fdf6e3; + padding: 0 0.3em; + color: #657b83; +} + +/* Source directories */ + +.odoc-directory::before { + content: "📁"; + margin: 0.3em; + font-size: 1.3em; +} + +.odoc-file::before { + content: "📄"; + margin: 0.3em; + font-size: 1.3em; +} + +.odoc-folder-list { + list-style: none; +} + /* Syntax highlighting (based on github-gist) */ .hljs { @@ -777,6 +1297,85 @@ td.def-doc *:first-child { text-decoration: underline; } +.VAL, +.TYPE, +.LET, +.REC, +.IN, +.OPEN, +.NONREC, +.MODULE, +.METHOD, +.LETOP, +.INHERIT, +.INCLUDE, +.FUNCTOR, +.EXTERNAL, +.CONSTRAINT, +.ASSERT, +.AND, +.END, +.CLASS, +.STRUCT, +.SIG { + color: #859900; + ; +} + +.WITH, +.WHILE, +.WHEN, +.VIRTUAL, +.TRY, +.TO, +.THEN, +.PRIVATE, +.OF, +.NEW, +.MUTABLE, +.MATCH, +.LAZY, +.IF, +.FUNCTION, +.FUN, +.FOR, +.EXCEPTION, +.ELSE, +.TO, +.DOWNTO, +.DO, +.DONE, +.BEGIN, +.AS { + color: #cb4b16; +} + +.TRUE, +.FALSE { + color: #b58900; +} + +.failwith, +.INT, +.SEMISEMI, +.LIDENT { + color: #2aa198; +} + +.STRING, +.CHAR, +.UIDENT { + color: #b58900; +} + +.DOCSTRING { + color: #268bd2; +} + +.COMMENT { + color: #93a1a1; +} + /*--------------------------------------------------------------------------- Copyright (c) 2016 The odoc contributors @@ -791,4 +1390,4 @@ td.def-doc *:first-child { WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ---------------------------------------------------------------------------*/ + ---------------------------------------------------------------------------*/ \ No newline at end of file diff --git a/odoc.support/odoc_search.js b/odoc.support/odoc_search.js new file mode 100644 index 0000000..0dc659d --- /dev/null +++ b/odoc.support/odoc_search.js @@ -0,0 +1,66 @@ +/* The browsers interpretation of the CORS origin policy prevents to run + webworkers from javascript files fetched from the file:// protocol. This hack + is to workaround this restriction. */ +function createWebWorker() { + var searchs = search_urls.map((search_url) => { + let parts = document.location.href.split("/"); + parts[parts.length - 1] = search_url; + return '"' + parts.join("/") + '"'; + }); + blobContents = ["importScripts(" + searchs.join(",") + ");"]; + var blob = new Blob(blobContents, { type: "application/javascript" }); + var blobUrl = URL.createObjectURL(blob); + + var worker = new Worker(blobUrl); + URL.revokeObjectURL(blobUrl); + + return worker; +} + +var worker; +var waiting = 0; + +function wait() { + waiting = waiting + 1; + document.querySelector(".search-snake").classList.add("search-busy"); +} + +function stop_waiting() { + if (waiting > 0) waiting = waiting - 1; + else waiting = 0; + if (waiting == 0) { + document.querySelector(".search-snake").classList.remove("search-busy"); + } +} + +document.querySelector(".search-bar").addEventListener("focus", (ev) => { + if (typeof worker == "undefined") { + worker = createWebWorker(); + worker.onmessage = (e) => { + stop_waiting(); + let results = e.data; + let search_results = document.querySelector(".search-result"); + search_results.innerHTML = ""; + let f = (entry) => { + let search_result = document.createElement("a"); + search_result.classList.add("search-entry"); + search_result.href = base_url + entry.url; + search_result.innerHTML = entry.html; + search_results.appendChild(search_result); + }; + results.forEach(f); + let search_request = document.querySelector(".search-bar").value; + if (results.length == 0 && search_request != "") { + let no_result = document.createElement("div"); + no_result.classList.add("search-no-result"); + no_result.innerText = "No result..."; + search_results.appendChild(no_result); + } + }; + } +}); + +document.querySelector(".search-bar").addEventListener("input", (ev) => { + wait(); + worker.postMessage(ev.target.value); +}); diff --git a/ssl/Ssl/Error/index.html b/ssl/Ssl/Error/index.html index 18fdaad..08c41aa 100644 --- a/ssl/Ssl/Error/index.html +++ b/ssl/Ssl/Error/index.html @@ -1,2 +1,2 @@ -
Ssl.Error
type t = private {
library_number : int;
Identifies the OpenSSL sub-library that generated this error. Library values are defined in https://github.com/openssl/openssl/blob/openssl-3.0.0/include/openssl/err.h.in#L72
*)reason_code : int;
The reason code is the information about what went wrong.
*)lib : string option;
The library name that generated the error.
*)reason : string option;
The reason string for the error message.
*)}
The error code returned by ERR_get_error() consists of a library number, function code and reason code.
Each sub-library of OpenSSL has a unique library number; function and reason codes are unique within each sub-library. Note that different libraries may use the same value to signal different functions and reasons.
val get_error : unit -> t
Retrieve the earliest error from the error queue then it removes the entry. Returns the code and library and reason strings
val peek_error : unit -> t
Retrieve the earliest error from the error queue without modifying it. Returns the code and library and reason strings
val peek_last_error : unit -> t
Retrieves the latest error code from the thread's error queue without modifying it. Returns the code and library and reason strings.
Ssl.Error
type t = private {
library_number : int;
Identifies the OpenSSL sub-library that generated this error. Library values are defined in https://github.com/openssl/openssl/blob/openssl-3.0.0/include/openssl/err.h.in#L72
*)reason_code : int;
The reason code is the information about what went wrong.
*)lib : string option;
The library name that generated the error.
*)reason : string option;
The reason string for the error message.
*)}
The error code returned by ERR_get_error() consists of a library number, function code and reason code.
Each sub-library of OpenSSL has a unique library number; function and reason codes are unique within each sub-library. Note that different libraries may use the same value to signal different functions and reasons.
val get_error : unit -> t
Retrieve the earliest error from the error queue then it removes the entry. Returns the code and library and reason strings
val peek_error : unit -> t
Retrieve the earliest error from the error queue without modifying it. Returns the code and library and reason strings
val peek_last_error : unit -> t
Retrieves the latest error code from the thread's error queue without modifying it. Returns the code and library and reason strings.
Ssl.Runtime_lock
Runtime_lock
is an equivalent, signature compatible, equivalent to the Ssl
module, with one difference: the OCaml runtime lock isn't released before calling the underlying SSL primitives. Multiple systhreads cannot, therefore, run concurrently.
It works well with non blocking sockets where the usual semantics apply, i.e. handling of `EWOULDBLOCK`, `EGAIN`, etc. Additionally, the functions in this module don't perform a copy of application data buffers.
val connect : socket -> unit
Connect an SSL socket.
val accept : socket -> unit
Accept an SSL connection.
Open an SSL connection with the specified context.
val close_notify : socket -> bool
Send close notify to the peer. This is SSL_shutdown(3). * returns true
if shutdown is finished, false
in case close_notify
* needs to be called a second time.
val shutdown_connection : socket -> unit
Close an SSL connection opened with open_connection
.
val shutdown : socket -> unit
Close a SSL connection. * Send close notify to the peer and wait for close notify from peer.
val flush : socket -> unit
Flush an SSL connection.
val read : socket -> Stdlib.Bytes.t -> int -> int -> int
read sock buf off len
receives data from a connected SSL socket.
read_into_bigarray sock ba off len
receives data from a connected SSL socket. This function releases the runtime while the read takes place.
val write : socket -> Stdlib.Bytes.t -> int -> int -> int
write sock buf off len
sends data over a connected SSL socket.
val write_substring : socket -> string -> int -> int -> int
write_substring sock str off len
sends data over a connected SSL socket.
write_bigarray sock ba off len
sends data over a connected SSL socket. This function releases the runtime while the read takes place.
val input_string : socket -> string
Input a string on an SSL socket.
val output_string : socket -> string -> unit
Write a string on an SSL socket.
val input_char : socket -> char
Input a character on an SSL socket.
val output_char : socket -> char -> unit
Write a char on an SSL socket.
val input_int : socket -> int
Input an integer on an SSL socket.
val output_int : socket -> int -> unit
Write an integer on an SSL socket.
Ssl.Runtime_lock
Runtime_lock
is an equivalent, signature compatible, equivalent to the Ssl
module, with one difference: the OCaml runtime lock isn't released before calling the underlying SSL primitives. Multiple systhreads cannot, therefore, run concurrently.
It works well with non blocking sockets where the usual semantics apply, i.e. handling of `EWOULDBLOCK`, `EGAIN`, etc. Additionally, the functions in this module don't perform a copy of application data buffers.
val connect : socket -> unit
Connect an SSL socket.
val accept : socket -> unit
Accept an SSL connection.
Open an SSL connection with the specified context.
val close_notify : socket -> bool
Send close notify to the peer. This is SSL_shutdown(3). * returns true
if shutdown is finished, false
in case close_notify
* needs to be called a second time.
val shutdown_connection : socket -> unit
Close an SSL connection opened with open_connection
.
val shutdown : socket -> unit
Close a SSL connection. * Send close notify to the peer and wait for close notify from peer.
val flush : socket -> unit
Flush an SSL connection.
val read : socket -> Stdlib.Bytes.t -> int -> int -> int
read sock buf off len
receives data from a connected SSL socket.
read_into_bigarray sock ba off len
receives data from a connected SSL socket. This function releases the runtime while the read takes place.
val write : socket -> Stdlib.Bytes.t -> int -> int -> int
write sock buf off len
sends data over a connected SSL socket.
val write_substring : socket -> string -> int -> int -> int
write_substring sock str off len
sends data over a connected SSL socket.
write_bigarray sock ba off len
sends data over a connected SSL socket. This function releases the runtime while the read takes place.
val input_string : socket -> string
Input a string on an SSL socket.
val output_string : socket -> string -> unit
Write a string on an SSL socket.
val input_char : socket -> char
Input a character on an SSL socket.
val output_char : socket -> char -> unit
Write a char on an SSL socket.
val input_int : socket -> int
Input an integer on an SSL socket.
val output_int : socket -> int -> unit
Write an integer on an SSL socket.
Ssl
Functions for making encrypted communications using the Secure Socket Layer (SSL). These are mostly bindings to the openssl library.
val native_library_version : version
type ssl_error =
| Error_none
No error happened. This is never raised and should disappear in future versions.
*)| Error_ssl
A non-recoverable, fatal error in the SSL library occurred, usually a protocol error. The OpenSSL error queue contains more information on the error. If this error occurs then no further I/O operations should be performed on the connection and SSL_shutdown() must not be called.
*)| Error_want_read
The operation did not complete; the same TLS/SSL I/O function should be called again later.
*)| Error_want_write
The operation did not complete; the same TLS/SSL I/O function should be called again later.
*)| Error_want_x509_lookup
The operation did not complete because an application callback set by set_client_cert_cb
has asked to be called again. The TLS/SSL I/O function should be called again later. Details depend on the application.
| Error_syscall
Some I/O error occurred. The OpenSSL error queue may contain more information on the error.
*)| Error_zero_return
The TLS/SSL connection has been closed. If the protocol version is SSL 3.0 or TLS 1.0, this result code is returned only if a closure alert has occurred in the protocol, i.e. if the connection has been closed cleanly. Note that in this case Error_zero_return
does not necessarily indicate that the underlying transport has been closed.
| Error_want_connect
The operation did not complete; the same TLS/SSL I/O function should be called again later.
*)| Error_want_accept
The operation did not complete; the same TLS/SSL I/O function should be called again later.
*)| Error_want_async
The operation did not complete because an asynchronous engine is still processing data. The TLS/SSL I/O function should be called again later. The function must be called from the same thread that the original call was made from.
*)| Error_want_async_job
The asynchronous job could not be started because there were no async jobs available in the pool. The application should retry the operation after a currently executing asynchronous operation for the current thread has completed.
*)| Error_want_client_hello_cb
The operation did not complete because an application callback set by SSL_CTX_set_client_hello_cb() has asked to be called again. The TLS/SSL I/O function should be called again later. Details depend on the application.
*)| Error_want_retry_verify
See https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set_verify.html
*)An ssl error has occurred (see SSL_get_error(3ssl) for details).
type bigarray =
+Ssl (ssl.Ssl) Module Ssl
Functions for making encrypted communications using the Secure Socket Layer (SSL). These are mostly bindings to the openssl library.
OpenSSL version
val native_library_version : version
Exceptions and errors
type ssl_error =
| Error_none
(*No error happened. This is never raised and should disappear in future versions.
*)| Error_ssl
(*A non-recoverable, fatal error in the SSL library occurred, usually a protocol error. The OpenSSL error queue contains more information on the error. If this error occurs then no further I/O operations should be performed on the connection and SSL_shutdown() must not be called.
*)| Error_want_read
(*The operation did not complete; the same TLS/SSL I/O function should be called again later.
*)| Error_want_write
(*The operation did not complete; the same TLS/SSL I/O function should be called again later.
*)| Error_want_x509_lookup
(*The operation did not complete because an application callback set by set_client_cert_cb
has asked to be called again. The TLS/SSL I/O function should be called again later. Details depend on the application.
*)| Error_syscall
(*Some I/O error occurred. The OpenSSL error queue may contain more information on the error.
*)| Error_zero_return
(*The TLS/SSL connection has been closed. If the protocol version is SSL 3.0 or TLS 1.0, this result code is returned only if a closure alert has occurred in the protocol, i.e. if the connection has been closed cleanly. Note that in this case Error_zero_return
does not necessarily indicate that the underlying transport has been closed.
*)| Error_want_connect
(*The operation did not complete; the same TLS/SSL I/O function should be called again later.
*)| Error_want_accept
(*The operation did not complete; the same TLS/SSL I/O function should be called again later.
*)| Error_want_async
(*The operation did not complete because an asynchronous engine is still processing data. The TLS/SSL I/O function should be called again later. The function must be called from the same thread that the original call was made from.
*)| Error_want_async_job
(*The asynchronous job could not be started because there were no async jobs available in the pool. The application should retry the operation after a currently executing asynchronous operation for the current thread has completed.
*)| Error_want_client_hello_cb
(*The operation did not complete because an application callback set by SSL_CTX_set_client_hello_cb() has asked to be called again. The TLS/SSL I/O function should be called again later. Details depend on the application.
*)| Error_want_retry_verify
(*See https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set_verify.html
*)
An ssl error has occurred (see SSL_get_error(3ssl) for details).
exception Connection_error of ssl_error
The connection could not be made with the SSL service.
exception Accept_error of ssl_error
Failed to accept an SSL connection.
exception Read_error of ssl_error
An error occurred while reading data.
exception Write_error of ssl_error
An error occurred while writing data.
An error occurred while flushing a socket. Flush_error true
means that the operation should be retried.
type verify_error =
| Error_v_unable_to_get_issuer_cert
(*The issuer certificate could not be found: this occurs if the issuer certificate of an untrusted certificate cannot be found.
*)| Error_v_unable_to_get_ctl
(*The CRL of a certificate could not be found.
*)| Error_v_unable_to_decrypt_cert_signature
(*The certificate signature could not be decrypted. This means that the actual signature value could not be determined rather than it not matching the expected value, this is only meaningful for RSA keys.
*)| Error_v_unable_to_decrypt_CRL_signature
(*The CRL signature could not be decrypted: this means that the actual signature value could not be determined rather than it not matching the expected value. Unused.
*)| Error_v_unable_to_decode_issuer_public_key
(*The public key in the certificate SubjectPublicKeyInfo could not be read.
*)| Error_v_cert_signature_failure
(*The signature of the certificate is invalid.
*)| Error_v_CRL_signature_failure
(*The signature of the certificate is invalid.
*)| Error_v_cert_not_yet_valid
(*The certificate is not yet valid: the notBefore date is after the current time.
*)| Error_v_cert_has_expired
(*The certificate has expired: that is the notAfter date is before the current time.
*)| Error_v_CRL_not_yet_valid
(*The CRL is not yet valid.
*)| Error_v_CRL_has_expired
(*The CRL has expired.
*)| Error_v_error_in_cert_not_before_field
(*The certificate notBefore field contains an invalid time.
*)| Error_v_error_in_cert_not_after_field
(*The certificate notAfter field contains an invalid time.
*)| Error_v_error_in_CRL_last_update_field
(*The CRL lastUpdate field contains an invalid time.
*)| Error_v_error_in_CRL_next_update_field
(*The CRL nextUpdate field contains an invalid time.
*)| Error_v_out_of_mem
(*An error occurred trying to allocate memory. This should never happen.
*)| Error_v_depth_zero_self_signed_cert
(*The passed certificate is self signed and the same certificate cannot be found in the list of trusted certificates.
*)| Error_v_self_signed_cert_in_chain
(*The certificate chain could be built up using the untrusted certificates but the root could not be found locally.
*)| Error_v_unable_to_get_issuer_cert_locally
(*The issuer certificate of a locally looked up certificate could not be found. This normally means the list of trusted certificates is not complete.
*)| Error_v_unable_to_verify_leaf_signature
(*No signatures could be verified because the chain contains only one certificate and it is not self signed.
*)| Error_v_cert_chain_too_long
(*The certificate chain length is greater than the supplied maximum depth. Unused.
*)| Error_v_cert_revoked
(*The certificate has been revoked.
*)| Error_v_invalid_CA
(*A CA certificate is invalid. Either it is not a CA or its extensions are not consistent with the supplied purpose.
*)| Error_v_path_length_exceeded
(*The basicConstraints pathlength parameter has been exceeded.
*)| Error_v_invalid_purpose
(*The supplied certificate cannot be used for the specified purpose.
*)| Error_v_cert_untrusted
(*The root CA is not marked as trusted for the specified purpose.
*)| Error_v_cert_rejected
(*The root CA is marked to reject the specified purpose.
*)| Error_v_subject_issuer_mismatch
(*The current candidate issuer certificate was rejected because its subject name did not match the issuer name of the current certificate.
*)| Error_v_akid_skid_mismatch
(*The current candidate issuer certificate was rejected because its subject key identifier was present and did not match the authority key identifier current certificate.
*)| Error_v_akid_issuer_serial_mismatch
(*The current candidate issuer certificate was rejected because its issuer name and serial number was present and did not match the authority key identifier of the current certificate.
*)| Error_v_keyusage_no_certsign
(*The current candidate issuer certificate was rejected because its keyUsage extension does not permit certificate signing.
*)| Error_v_application_verification
(*An application specific error. Unused.
*)
Why did the certificate verification fail?
exception Verify_error of verify_error
An error occurred while verifying the certificate.
Communication
Initialize SSL functions. Should be called before calling any other function. The parameter thread_safe
should be set to true if you use threads in you application (the same effect can achieved by calling Ssl_threads.init
first.
Retrieve a human-readable message that corresponds to the earliest error code from the thread's error queue and removes the entry.
module Error : sig ... end
Threads
You should not have to use those functions. They are only here for internal use (they are needed to make the openssl library thread-safe, see the Ssl_threads
module).
Contexts
A context. A context should be created by a server or client once per program life-time and holds mainly default values for the SSL structures which are later created for the connections.
val create_context : protocol -> context_type -> context
Create a context.
set_min_protocol_version ctx proto
sets the minimum supported protocol version for ctx
to proto
.
set_max_protocol_version ctx proto
sets the maximum supported protocol version for ctx
to proto
.
get_min_protocol_version ctx
sets the minimum supported protocol version for ctx
to proto
.
get_max_protocol_version ctx proto
sets the maximum supported protocol version for ctx
to proto
.
val add_extra_chain_cert : context -> string -> unit
Add an additional certificate to the extra chain certificates associated with the ctx
. Extra chain certificates will be sent to the peer for verification and are sent in order following the end entity certificate. The value should be contents of the certificate as string in PEM format.
val add_cert_to_store : context -> string -> unit
Add a certificate to the ctx
trust storage. The value should be contents of the certificate as string in PEM format.
val use_certificate : context -> string -> string -> unit
use_certificate ctx cert privkey
makes the context ctx
use cert
as * certificate's file name (in PEM format) and privkey
as private key file * name.
val use_certificate_from_string : context -> string -> string -> unit
Use a certificate whose contents is given as argument (you should use instead use_certificate
if you want to read the certificate from a file).
val set_password_callback : context -> (bool -> string) -> unit
Set the callback function called to get passwords for encrypted PEM files. * The callback function takes a boolean argument which indicates if it's used * for reading/decryption (false
) or writing/encryption (true
).
val set_client_CA_list_from_file : context -> string -> unit
Set the list of CAs sent to the client when requesting a client certificate.
val client_verify_callback : verify_callback
Client's verification callback. Warning: this might change in the future.
Set verbosity of client_verify_callback
val set_verify : context -> verify_mode list -> verify_callback option -> unit
Set the verify mode and callback, see SSL_CTX_set_verify(3). * Warning: this might change in the future.
val set_verify_depth : context -> int -> unit
Set the maximum depth for the certificate chain verification that shall be allowed.
val set_context_alpn_protos : context -> string list -> unit
Set the list of supported ALPN protocols for negotiation to the context.
exception Connection_error of ssl_error
The connection could not be made with the SSL service.
exception Accept_error of ssl_error
Failed to accept an SSL connection.
exception Read_error of ssl_error
An error occurred while reading data.
exception Write_error of ssl_error
An error occurred while writing data.
An error occurred while flushing a socket. Flush_error true
means that the operation should be retried.
type verify_error =
| Error_v_unable_to_get_issuer_cert
(*The issuer certificate could not be found: this occurs if the issuer certificate of an untrusted certificate cannot be found.
*)| Error_v_unable_to_get_ctl
(*The CRL of a certificate could not be found.
*)| Error_v_unable_to_decrypt_cert_signature
(*The certificate signature could not be decrypted. This means that the actual signature value could not be determined rather than it not matching the expected value, this is only meaningful for RSA keys.
*)| Error_v_unable_to_decrypt_CRL_signature
(*The CRL signature could not be decrypted: this means that the actual signature value could not be determined rather than it not matching the expected value. Unused.
*)| Error_v_unable_to_decode_issuer_public_key
(*The public key in the certificate SubjectPublicKeyInfo could not be read.
*)| Error_v_cert_signature_failure
(*The signature of the certificate is invalid.
*)| Error_v_CRL_signature_failure
(*The signature of the certificate is invalid.
*)| Error_v_cert_not_yet_valid
(*The certificate is not yet valid: the notBefore date is after the current time.
*)| Error_v_cert_has_expired
(*The certificate has expired: that is the notAfter date is before the current time.
*)| Error_v_CRL_not_yet_valid
(*The CRL is not yet valid.
*)| Error_v_CRL_has_expired
(*The CRL has expired.
*)| Error_v_error_in_cert_not_before_field
(*The certificate notBefore field contains an invalid time.
*)| Error_v_error_in_cert_not_after_field
(*The certificate notAfter field contains an invalid time.
*)| Error_v_error_in_CRL_last_update_field
(*The CRL lastUpdate field contains an invalid time.
*)| Error_v_error_in_CRL_next_update_field
(*The CRL nextUpdate field contains an invalid time.
*)| Error_v_out_of_mem
(*An error occurred trying to allocate memory. This should never happen.
*)| Error_v_depth_zero_self_signed_cert
(*The passed certificate is self signed and the same certificate cannot be found in the list of trusted certificates.
*)| Error_v_self_signed_cert_in_chain
(*The certificate chain could be built up using the untrusted certificates but the root could not be found locally.
*)| Error_v_unable_to_get_issuer_cert_locally
(*The issuer certificate of a locally looked up certificate could not be found. This normally means the list of trusted certificates is not complete.
*)| Error_v_unable_to_verify_leaf_signature
(*No signatures could be verified because the chain contains only one certificate and it is not self signed.
*)| Error_v_cert_chain_too_long
(*The certificate chain length is greater than the supplied maximum depth. Unused.
*)| Error_v_cert_revoked
(*The certificate has been revoked.
*)| Error_v_invalid_CA
(*A CA certificate is invalid. Either it is not a CA or its extensions are not consistent with the supplied purpose.
*)| Error_v_path_length_exceeded
(*The basicConstraints pathlength parameter has been exceeded.
*)| Error_v_invalid_purpose
(*The supplied certificate cannot be used for the specified purpose.
*)| Error_v_cert_untrusted
(*The root CA is not marked as trusted for the specified purpose.
*)| Error_v_cert_rejected
(*The root CA is marked to reject the specified purpose.
*)| Error_v_subject_issuer_mismatch
(*The current candidate issuer certificate was rejected because its subject name did not match the issuer name of the current certificate.
*)| Error_v_akid_skid_mismatch
(*The current candidate issuer certificate was rejected because its subject key identifier was present and did not match the authority key identifier current certificate.
*)| Error_v_akid_issuer_serial_mismatch
(*The current candidate issuer certificate was rejected because its issuer name and serial number was present and did not match the authority key identifier of the current certificate.
*)| Error_v_keyusage_no_certsign
(*The current candidate issuer certificate was rejected because its keyUsage extension does not permit certificate signing.
*)| Error_v_application_verification
(*An application specific error. Unused.
*)
Why did the certificate verification fail?
exception Verify_error of verify_error
An error occurred while verifying the certificate.
Communication
Initialize SSL functions. Should be called before calling any other function. The parameter thread_safe
should be set to true if you use threads in you application (the same effect can achieved by calling Ssl_threads.init
first.
Retrieve a human-readable message that corresponds to the earliest error code from the thread's error queue and removes the entry.
module Error : sig ... end
Threads
You should not have to use those functions. They are only here for internal use (they are needed to make the openssl library thread-safe, see the Ssl_threads
module).
Contexts
A context. A context should be created by a server or client once per program life-time and holds mainly default values for the SSL structures which are later created for the connections.
val create_context : protocol -> context_type -> context
Create a context.
set_min_protocol_version ctx proto
sets the minimum supported protocol version for ctx
to proto
.
set_max_protocol_version ctx proto
sets the maximum supported protocol version for ctx
to proto
.
get_min_protocol_version ctx
sets the minimum supported protocol version for ctx
to proto
.
get_max_protocol_version ctx proto
sets the maximum supported protocol version for ctx
to proto
.
val add_extra_chain_cert : context -> string -> unit
Add an additional certificate to the extra chain certificates associated with the ctx
. Extra chain certificates will be sent to the peer for verification and are sent in order following the end entity certificate. The value should be contents of the certificate as string in PEM format.
val add_cert_to_store : context -> string -> unit
Add a certificate to the ctx
trust storage. The value should be contents of the certificate as string in PEM format.
val use_certificate : context -> string -> string -> unit
use_certificate ctx cert privkey
makes the context ctx
use cert
as * certificate's file name (in PEM format) and privkey
as private key file * name.
val use_certificate_from_string : context -> string -> string -> unit
Use a certificate whose contents is given as argument (you should use instead use_certificate
if you want to read the certificate from a file).
val set_password_callback : context -> (bool -> string) -> unit
Set the callback function called to get passwords for encrypted PEM files. * The callback function takes a boolean argument which indicates if it's used * for reading/decryption (false
) or writing/encryption (true
).
val set_client_CA_list_from_file : context -> string -> unit
Set the list of CAs sent to the client when requesting a client certificate.
val client_verify_callback : verify_callback
Client's verification callback. Warning: this might change in the future.
Set verbosity of client_verify_callback
val set_verify : context -> verify_mode list -> verify_callback option -> unit
Set the verify mode and callback, see SSL_CTX_set_verify(3). * Warning: this might change in the future.
val set_verify_depth : context -> int -> unit
Set the maximum depth for the certificate chain verification that shall be allowed.
val set_context_alpn_protos : context -> string list -> unit
Set the list of supported ALPN protocols for negotiation to the context.
val set_context_alpn_select_callback :
context ->
(string list -> string option) ->
- unit
Set the callback to allow server to select the preferred protocol from client's available protocols.
Ciphers
A cipher. It holds the algorithm information for a particular cipher which * are a core part of the SSL/TLS protocol.
Disable all protocols from the list. * Note that SSLv23
disables both SSLv2 and SSLv3 (as opposed to all the * protocols). *
val set_cipher_list : context -> string -> unit
Set the list of available ciphers for a context. See man ciphers(1) for the format of the string.
val honor_cipher_order : context -> unit
When choosing a cipher, use the server's preferences instead of the client * preferences. When not set, the SSL server will always follow the clients * preferences. When set, the SSLv3/TLSv1 server will choose following its * own preferences. Because of the different protocol, for SSLv2 the server * will send its list of preferences to the client and the client chooses.
val init_dh_from_file : context -> string -> unit
Init DH parameters from file
val init_ec_from_named_curve : context -> string -> unit
Init EC curve from curve name
val get_cipher_description : cipher -> string
Get a description of a cipher.
val get_cipher_name : cipher -> string
Get the name of a cipher.
val get_cipher_version : cipher -> string
Get the version of a cipher.
Get the version used for the connection. As per the OpenSSL documentation, should only be called after the initial handshake has been completed. Prior to that the results returned from these functions may be unreliable.
Certificates
val read_certificate : string -> certificate
read_certificate fname
reads the certificate in the file fname
.
val write_certificate : string -> certificate -> unit
val get_certificate : socket -> certificate
Get the certificate used by a socket.
val get_issuer : certificate -> string
Get the issuer of a certificate.
val get_subject : certificate -> string
Get the subject of a certificate.
val get_start_date : certificate -> Unix.tm
Get the start date of a certificate.
val get_expiration_date : certificate -> Unix.tm
Get the expiration date of a certificate.
val load_verify_locations : context -> string -> string -> unit
load_verify_locations ctxt cafile capath
specifies the locations for the context ctx
, at which CA certificates for verification purposes are located. cafile
should be the name of a CA certificates file in PEM format and capath
should be the name of a directory which contains CA certificates in PEM format. Empty strings can be used in order not to specify on of the parameters (but not both).
val set_default_verify_paths : context -> bool
Specifies that the default locations from which CA certificates are loaded should be used. Returns true
on success.
val get_verify_result : socket -> int
Get the verification result.
Get a human readable verification error message for the verification error Its input should be the result of calling get_verify_result
.
val digest : [ `SHA1 | `SHA256 | `SHA384 ] -> certificate -> string
Get the digest of the certificate as a binary string, using the SHA1, SHA256 or SHA384 hashing algorithm.
Creating, connecting, closing and configuring sockets
val set_client_SNI_hostname : socket -> string -> unit
Set the hostname the client is attempting to connect to using the Server * Name Indication (SNI) TLS extension.
val set_alpn_protos : socket -> string list -> unit
Set the list of supported ALPN protocols for negotiation to the connection.
val get_negotiated_alpn_protocol : socket -> string option
Get the negotiated protocol from the connection.
val verify : socket -> unit
Check the result of the verification of the X509 certificate presented by the peer, if any. Raises a verify_error
on failure.
val set_hostflags : socket -> x509_check_flag list -> unit
val set_host : socket -> string -> unit
val set_ip : socket -> string -> unit
Set the expected ip address to be verified. Ip address is dotted decimal quad for IPv4 and colon-separated hexadecimal for IPv6. The condensed "::" notation is supported for IPv6 addresses.
val file_descr_of_socket : socket -> Unix.file_descr
Get the file descriptor associated with a socket. It is primarily useful for select
ing on it; you should not write or read on it.
I/O on SSL sockets
The main SSL communication functions that can block if sockets are in blocking mode. This set of functions releases the OCaml runtime lock, which can require extra copying of application data. The module Runtime_lock
provided below lifts this limitation by never releasing the OCaml runtime lock.
val connect : socket -> unit
Connect an SSL socket.
val accept : socket -> unit
Accept an SSL connection.
Open an SSL connection with the specified context.
val close_notify : socket -> bool
Send close notify to the peer. This is SSL_shutdown(3). * returns true
if shutdown is finished, false
in case close_notify
* needs to be called a second time.
val shutdown_connection : socket -> unit
Close an SSL connection opened with open_connection
.
val shutdown : socket -> unit
Close a SSL connection. * Send close notify to the peer and wait for close notify from peer.
val flush : socket -> unit
Flush an SSL connection.
val read : socket -> Stdlib.Bytes.t -> int -> int -> int
read sock buf off len
receives data from a connected SSL socket.
read_into_bigarray sock ba off len
receives data from a connected SSL socket. This function releases the runtime while the read takes place.
val write : socket -> Stdlib.Bytes.t -> int -> int -> int
write sock buf off len
sends data over a connected SSL socket.
val write_substring : socket -> string -> int -> int -> int
write_substring sock str off len
sends data over a connected SSL socket.
write_bigarray sock ba off len
sends data over a connected SSL socket. This function releases the runtime while the read takes place.
High-level communication functions
val input_string : socket -> string
Input a string on an SSL socket.
val output_string : socket -> string -> unit
Write a string on an SSL socket.
val input_char : socket -> char
Input a character on an SSL socket.
val output_char : socket -> char -> unit
Write a char on an SSL socket.
val input_int : socket -> int
Input an integer on an SSL socket.
val output_int : socket -> int -> unit
Write an integer on an SSL socket.
module Runtime_lock : sig ... end
Runtime_lock
is an equivalent, signature compatible, equivalent to the Ssl
module, with one difference: the OCaml runtime lock isn't released before calling the underlying SSL primitives. Multiple systhreads cannot, therefore, run concurrently.
This function is deprecated. Use Runtime_lock.read_into_bigarray
instead.
\ No newline at end of file
+ unit
Set the callback to allow server to select the preferred protocol from client's available protocols.
A cipher. It holds the algorithm information for a particular cipher which * are a core part of the SSL/TLS protocol.
Disable all protocols from the list. * Note that SSLv23
disables both SSLv2 and SSLv3 (as opposed to all the * protocols). *
val set_cipher_list : context -> string -> unit
Set the list of available ciphers for a context. See man ciphers(1) for the format of the string.
val honor_cipher_order : context -> unit
When choosing a cipher, use the server's preferences instead of the client * preferences. When not set, the SSL server will always follow the clients * preferences. When set, the SSLv3/TLSv1 server will choose following its * own preferences. Because of the different protocol, for SSLv2 the server * will send its list of preferences to the client and the client chooses.
val init_dh_from_file : context -> string -> unit
Init DH parameters from file
val init_ec_from_named_curve : context -> string -> unit
Init EC curve from curve name
val get_cipher_description : cipher -> string
Get a description of a cipher.
val get_cipher_name : cipher -> string
Get the name of a cipher.
val get_cipher_version : cipher -> string
Get the version of a cipher.
Get the version used for the connection. As per the OpenSSL documentation, should only be called after the initial handshake has been completed. Prior to that the results returned from these functions may be unreliable.
val read_certificate : string -> certificate
read_certificate fname
reads the certificate in the file fname
.
val write_certificate : string -> certificate -> unit
val get_certificate : socket -> certificate
Get the certificate used by a socket.
val get_issuer : certificate -> string
Get the issuer of a certificate.
val get_subject : certificate -> string
Get the subject of a certificate.
val get_start_date : certificate -> Unix.tm
Get the start date of a certificate.
val get_expiration_date : certificate -> Unix.tm
Get the expiration date of a certificate.
val load_verify_locations : context -> string -> string -> unit
load_verify_locations ctxt cafile capath
specifies the locations for the context ctx
, at which CA certificates for verification purposes are located. cafile
should be the name of a CA certificates file in PEM format and capath
should be the name of a directory which contains CA certificates in PEM format. Empty strings can be used in order not to specify on of the parameters (but not both).
val set_default_verify_paths : context -> bool
Specifies that the default locations from which CA certificates are loaded should be used. Returns true
on success.
val get_verify_result : socket -> int
Get the verification result.
Get a human readable verification error message for the verification error Its input should be the result of calling get_verify_result
.
val digest : [ `SHA1 | `SHA256 | `SHA384 ] -> certificate -> string
Get the digest of the certificate as a binary string, using the SHA1, SHA256 or SHA384 hashing algorithm.
val set_client_SNI_hostname : socket -> string -> unit
Set the hostname the client is attempting to connect to using the Server * Name Indication (SNI) TLS extension.
val set_alpn_protos : socket -> string list -> unit
Set the list of supported ALPN protocols for negotiation to the connection.
val get_negotiated_alpn_protocol : socket -> string option
Get the negotiated protocol from the connection.
val verify : socket -> unit
Check the result of the verification of the X509 certificate presented by the peer, if any. Raises a verify_error
on failure.
val set_hostflags : socket -> x509_check_flag list -> unit
val set_host : socket -> string -> unit
val set_ip : socket -> string -> unit
Set the expected ip address to be verified. Ip address is dotted decimal quad for IPv4 and colon-separated hexadecimal for IPv6. The condensed "::" notation is supported for IPv6 addresses.
val file_descr_of_socket : socket -> Unix.file_descr
Get the file descriptor associated with a socket. It is primarily useful for select
ing on it; you should not write or read on it.
The main SSL communication functions that can block if sockets are in blocking mode. This set of functions releases the OCaml runtime lock, which can require extra copying of application data. The module Runtime_lock
provided below lifts this limitation by never releasing the OCaml runtime lock.
val connect : socket -> unit
Connect an SSL socket.
val accept : socket -> unit
Accept an SSL connection.
Open an SSL connection with the specified context.
val close_notify : socket -> bool
Send close notify to the peer. This is SSL_shutdown(3). * returns true
if shutdown is finished, false
in case close_notify
* needs to be called a second time.
val shutdown_connection : socket -> unit
Close an SSL connection opened with open_connection
.
val shutdown : socket -> unit
Close a SSL connection. * Send close notify to the peer and wait for close notify from peer.
val flush : socket -> unit
Flush an SSL connection.
val read : socket -> Stdlib.Bytes.t -> int -> int -> int
read sock buf off len
receives data from a connected SSL socket.
read_into_bigarray sock ba off len
receives data from a connected SSL socket. This function releases the runtime while the read takes place.
val write : socket -> Stdlib.Bytes.t -> int -> int -> int
write sock buf off len
sends data over a connected SSL socket.
val write_substring : socket -> string -> int -> int -> int
write_substring sock str off len
sends data over a connected SSL socket.
write_bigarray sock ba off len
sends data over a connected SSL socket. This function releases the runtime while the read takes place.
val input_string : socket -> string
Input a string on an SSL socket.
val output_string : socket -> string -> unit
Write a string on an SSL socket.
val input_char : socket -> char
Input a character on an SSL socket.
val output_char : socket -> char -> unit
Write a char on an SSL socket.
val input_int : socket -> int
Input an integer on an SSL socket.
val output_int : socket -> int -> unit
Write an integer on an SSL socket.
module Runtime_lock : sig ... end
Runtime_lock
is an equivalent, signature compatible, equivalent to the Ssl
module, with one difference: the OCaml runtime lock isn't released before calling the underlying SSL primitives. Multiple systhreads cannot, therefore, run concurrently.
This function is deprecated. Use Runtime_lock.read_into_bigarray
instead.
Ssl_threads
Functions for making the openssl library thread-safe.
Ssl_threads
Functions for making the openssl library thread-safe.
This library exposes the following toplevel modules:
Ssl
Functions for making encrypted communications using the Secure Socket Layer (SSL). These are mostly bindings to the openssl library.Ssl_threads
Functions for making the openssl library thread-safe.This library exposes the following toplevel modules:
Ssl
Functions for making encrypted communications using the Secure Socket Layer (SSL). These are mostly bindings to the openssl library.Ssl_threads
Functions for making the openssl library thread-safe.