diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/CNAME b/CNAME new file mode 100644 index 0000000..ba38006 --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +zmalt.github.io/CSL_Chinese diff --git a/JuliaMono-Regular.woff2 b/JuliaMono-Regular.woff2 new file mode 100644 index 0000000..4a5569b Binary files /dev/null and b/JuliaMono-Regular.woff2 differ diff --git "a/csl-1.0.1-\350\247\204\350\214\203.html" "b/csl-1.0.1-\350\247\204\350\214\203.html" new file mode 100644 index 0000000..8a21872 --- /dev/null +++ "b/csl-1.0.1-\350\247\204\350\214\203.html" @@ -0,0 +1,117 @@ + + + + + + + CSL 1.0.1 规范 - CSL_Chinese + + + + + + + + + + + + + + +
+ + +
+

3 CSL 1.0.1 规范

+ + +
+ +
+ + +
+
+
+ CC BY-NC-SA 4.0 + Mao Zhou +
+
+
+ + \ No newline at end of file diff --git "a/csl-\344\273\213\347\273\215.html" "b/csl-\344\273\213\347\273\215.html" new file mode 100644 index 0000000..6131528 --- /dev/null +++ "b/csl-\344\273\213\347\273\215.html" @@ -0,0 +1,117 @@ + + + + + + + CSL 介绍 - CSL_Chinese + + + + + + + + + + + + + + +
+ + +
+

1 CSL 介绍

+ + +
+ +
+ + +
+
+
+ CC BY-NC-SA 4.0 + Mao Zhou +
+
+
+ + \ No newline at end of file diff --git "a/csl-\346\230\257\344\273\200\344\271\210.html" "b/csl-\346\230\257\344\273\200\344\271\210.html" new file mode 100644 index 0000000..caa2bb4 --- /dev/null +++ "b/csl-\346\230\257\344\273\200\344\271\210.html" @@ -0,0 +1,119 @@ + + + + + + + CSL 是什么 - CSL_Chinese + + + + + + + + + + + + + + +
+ + +
+

1.2 CSL 是什么

+

如果你写过论文的话,你可能在其中引用了别人的论文。参考文献在学术交流中很重要,因为它可以提供引用的来源,并且可以把已经发表的研究联系到一起。但是,手动设置引用格式和参考文献目录非常耗时,而且不同的期刊有自己的引用格式。

+

参考文献管理软件可以解决上面的问题。像Zotero、Mendeley、Papers等软件不仅能帮助你管理参考文献,而且可以自动地生成引用的参考文献目录。为了设置特定的引用格式,这些软件需要能识别的对引用格式的描述,这种描述就是Citation Style Language(CSL)

+ + +
+ +
+ + +
+
+
+ CC BY-NC-SA 4.0 + Mao Zhou +
+
+
+ + \ No newline at end of file diff --git "a/csl-\347\224\237\346\200\201.html" "b/csl-\347\224\237\346\200\201.html" new file mode 100644 index 0000000..5efda09 --- /dev/null +++ "b/csl-\347\224\237\346\200\201.html" @@ -0,0 +1,147 @@ + + + + + + + CSL 生态 - CSL_Chinese + + + + + + + + + + + + + + +
+ + +
+

1.4 CSL 生态

+

要明白 CSL 是怎么运作的,首先要了解 CSL 的生态。Style指的是 CSL 样式,Item Metadata指的是每篇参考文献的作者,题目等信息,Locale Files是为实现与语言无关(指英语,汉语等)的格式的本地化文件,Citation Details指的是影响引文信息或参考文献列表表现的细节,比如顺序,位置等。

+

1.4.1 独立格式和从属格式

+

CSL 的一切都是围绕style的,但是并不是所有的style都是相似的。主要包括两种格式:独立格式(independent styles)和从属格式(dependent styles)

+

独立格式有2种功能,首先,需要先定义一种引用格式。具体格式是什么样的,是 author-date格式还是note格式? 引用的顺序是按字母排序还是按日期排序?参考文献条目中是不是包含DOI?使用什么标点符号以及使用大写还是小写?文献发表年限在文献题目前还是后?等等,这些都是引用格式定义的。第二个功能是: CSL 必须是能自我解释的,可以称之为格式的元数据。元数据中可以包括该 CSL 对应的期刊标题,以及该期刊的联接,该 CSL 的创建者等。

+

从属格式则仅包括格式的元数据,没有对引用格式的定义。从属格式必须指定它的参考格式(父格式),从属格式的引用将使用它的父格式的引用格式。

+

当多个格式使用相同的引用格式时,从属格式非常有用。以一个出版社旗下的不同期刊为例,如果每个期刊都使用独立格式,则每个 CSL 都要完整的对引用格式的描述,即使他们的引用格式都是相同的。这样就导致 CSL 太庞大,冗余太多。这种情况下,从属格式就比较适合。例如,"Nature""Nature Biotechnology""Nature Chemistry"都使用同样的引用格式。因此,只需要创建一个"Nature" 的独立格式,将"Nature Biotechnology""Nature Chemistry"格式都定义为"Nature"格式的从属格式。这样,如果"Nature"的出版社想改变引用格式,只需要改变"Nature"期刊格式的 CSL 就可以,不需要改变它的从属格式对应的 CSL 。

+

1.4.2 Locale 文件

+

事实上,大多数独立格式并不是完全独立的。

+

以下面的条目为例:

+
+

Hartman, P., Bezos, J. P., Kaphan, S., & Spiegel, J. (1999, September 28). Method and system for placing a purchase order via a communications network. Retrieved from https://www.google.com/patents/US5960411

+
+

你可以使用一种独立的 CSL 格式来描述这个条目,在格式种编码就可以实现。例如,在最后的链接前加上"Retrieved from",或者使用"YYYY, Month DD"作为日期的格式。但是这样的一种 CSL ,只能在美式英语中使用,如果使用德语写作,就必须修改样式中对应的翻译和日期格式。

+

幸运的是,独立格式可以依据CSL locale files(以下也翻译为 本地化文件 )来实现通用项的翻译,日期格式和语法的转换。例如:我们可以重写 CSL 格式使用"retrieved""from"项,并使用本地化的日期格式。如果我们将 CSL 样式(同格式)的使用环境设置为美式英语,该样式将从 US English locale file检索和翻译对应的项,并生成上述引用。如果将英语换为德语,就会使用德语对应的locale file,生成的引用如下:

+
+

Hartman, P., Bezos, J. P., Kaphan, S., & Spiegel, J. (28. September 1999). Method and system for placing a purchase order via a communications network. Abgerufen von https://www.google.com/patents/US5960411

+
+

因此,使用 CSL locale files ,可以编写与语言无关的 CSL 样式。如上面展示的,这样的格式可以轻易的在不同的语言中转换。但是语言是很复杂的,CSL automatic localization并不能支持所有的语言特色。但是,语言无关的样式仍然是有意义的,如果你要自己修改 CSL 样式来适应自己选择的语言环境,参考这些语言无关的样式将更容易实现。

+

Locale file 还有一个好处,那就是,我们只需要为每种语言定义一次通用的翻译,日期格式和语法。这样可以保证样式紧凑,并使locale file更容易维护。由于给定语言的引用格式并不是一直和locale file中定义的转换格式一致,因此,我们也可以自己选择性的重写任何在locale file中定义的项目。下面独立格式解析中的locale元素就是为实现这一功能设置的。

+

1.4.3 Item Metadata

+

接下来就是引用中需要的参考文献条目的细节:条目元数据。

+

例如:一篇期刊文章可能需要作者的名字,发表的年份,文章题目,期刊名称,卷和期,出现的页码范围以及DOI(数字文献唯一标识),所有这些信息都有助于读者识别和查找这篇文章。

+

参考文献管理软件可以轻松的创建文献的这些细节信息。但是,很多参考文献管理软件都有自己的格式来存储这些元素据,大多数都支持通用的bibliographic exchange formats,比如BixTexRISciteproc-jsCSL 处理器引入了一种基于JSON的格式,用于以citeproc-js可以理解的方式来存储元数据。其他的一些 CSL 处理器后来采用了这种“CSL JSON”格式(也称为“citeproc JSON”)。

+

译者注:这里讲的似乎有些繁琐。总的来说,是我们需要每篇文章的作者,题目,发表期刊等信息来生成对应的条目。文献管理软件可以很方便的提供这些信息。至于其内部存储的方式,使用的时候并不需要关心,类似Zotero的文献管理软件会自动使用这些信息和 CSL 生成引用信息。

+

1.4.4 引用细节

+

对于给定的引用格式,引文和条目的展示不仅取决于被引用项的元数据,还取决于这些项被引用的上下文。我们将这类特定于上下文的信息称为引用细节。

+

例如:引用时对条目的排序会影响他们在参考文献中的位置(在下面独立格式的citationbibliography章节中提到)。

+

1.4.5 CSL 处理器

+

有了 CSL 样式,locale file,元数据和引用细节,我们现在需要一个软件来解析这些信息,并以正确的格式生成引用和参考文献条目。用来完成这些功能的软件就是 CSL 处理器。

+

大多数的参考文献管理软件使用的是免费开源的 CSL 处理器,比如:citeproc-js

+ + + + + +
+
+
+ CC BY-NC-SA 4.0 + Mao Zhou +
+
+
+ + \ No newline at end of file diff --git a/github.min.css b/github.min.css new file mode 100644 index 0000000..275239a --- /dev/null +++ b/github.min.css @@ -0,0 +1,10 @@ +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*! + Theme: GitHub + Description: Light theme as seen on github.com + Author: github.com + Maintainer: @Hirse + Updated: 2021-05-15 + + Outdated base version: https://github.com/primer/github-syntax-light + Current colors taken from GitHub's CSS +*/.hljs{color:#24292e;background:#fff}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#d73a49}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#6f42c1}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable{color:#005cc5}.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:#032f62}.hljs-built_in,.hljs-symbol{color:#e36209}.hljs-code,.hljs-comment,.hljs-formula{color:#6a737d}.hljs-name,.hljs-quote,.hljs-selector-pseudo,.hljs-selector-tag{color:#22863a}.hljs-subst{color:#24292e}.hljs-section{color:#005cc5;font-weight:700}.hljs-bullet{color:#735c0f}.hljs-emphasis{color:#24292e;font-style:italic}.hljs-strong{color:#24292e;font-weight:700}.hljs-addition{color:#22863a;background-color:#f0fff4}.hljs-deletion{color:#b31d28;background-color:#ffeef0} \ No newline at end of file diff --git a/highlight.min.js b/highlight.min.js new file mode 100644 index 0000000..a966f21 --- /dev/null +++ b/highlight.min.js @@ -0,0 +1,1173 @@ +/*! + Highlight.js v11.5.0 (git: 7a62552656) + (c) 2006-2022 Ivan Sagalaev and other contributors + License: BSD-3-Clause + */ +var hljs=function(){"use strict";var e={exports:{}};function n(e){ +return e instanceof Map?e.clear=e.delete=e.set=()=>{ +throw Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=()=>{ +throw Error("set is read-only") +}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach((t=>{var a=e[t] +;"object"!=typeof a||Object.isFrozen(a)||n(a)})),e} +e.exports=n,e.exports.default=n;var t=e.exports;class a{constructor(e){ +void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1} +ignoreMatch(){this.isMatchIgnored=!0}}function i(e){ +return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'") +}function r(e,...n){const t=Object.create(null);for(const n in e)t[n]=e[n] +;return n.forEach((e=>{for(const n in e)t[n]=e[n]})),t}const s=e=>!!e.kind +;class o{constructor(e,n){ +this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){ +this.buffer+=i(e)}openNode(e){if(!s(e))return;let n=e.kind +;n=e.sublanguage?"language-"+n:((e,{prefix:n})=>{if(e.includes(".")){ +const t=e.split(".") +;return[`${n}${t.shift()}`,...t.map(((e,n)=>`${e}${"_".repeat(n+1)}`))].join(" ") +}return`${n}${e}`})(n,{prefix:this.classPrefix}),this.span(n)}closeNode(e){ +s(e)&&(this.buffer+="")}value(){return this.buffer}span(e){ +this.buffer+=``}}class l{constructor(){this.rootNode={ +children:[]},this.stack=[this.rootNode]}get top(){ +return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){ +this.top.children.push(e)}openNode(e){const n={kind:e,children:[]} +;this.add(n),this.stack.push(n)}closeNode(){ +if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){ +for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)} +walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){ +return"string"==typeof n?e.addText(n):n.children&&(e.openNode(n), +n.children.forEach((n=>this._walk(e,n))),e.closeNode(n)),e}static _collapse(e){ +"string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{ +l._collapse(e)})))}}class c extends l{constructor(e){super(),this.options=e} +addKeyword(e,n){""!==e&&(this.openNode(n),this.addText(e),this.closeNode())} +addText(e){""!==e&&this.add(e)}addSublanguage(e,n){const t=e.root +;t.kind=n,t.sublanguage=!0,this.add(t)}toHTML(){ +return new o(this,this.options).value()}finalize(){return!0}}function d(e){ +return e?"string"==typeof e?e:e.source:null}function g(e){return m("(?=",e,")")} +function u(e){return m("(?:",e,")*")}function b(e){return m("(?:",e,")?")} +function m(...e){return e.map((e=>d(e))).join("")}function p(...e){const n=(e=>{ +const n=e[e.length-1] +;return"object"==typeof n&&n.constructor===Object?(e.splice(e.length-1,1),n):{} +})(e);return"("+(n.capture?"":"?:")+e.map((e=>d(e))).join("|")+")"} +function _(e){return RegExp(e.toString()+"|").exec("").length-1} +const h=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./ +;function f(e,{joinWith:n}){let t=0;return e.map((e=>{t+=1;const n=t +;let a=d(e),i="";for(;a.length>0;){const e=h.exec(a);if(!e){i+=a;break} +i+=a.substring(0,e.index), +a=a.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?i+="\\"+(Number(e[1])+n):(i+=e[0], +"("===e[0]&&t++)}return i})).map((e=>`(${e})`)).join(n)} +const E="[a-zA-Z]\\w*",y="[a-zA-Z_]\\w*",w="\\b\\d+(\\.\\d+)?",N="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",v="\\b(0b[01]+)",k={ +begin:"\\\\[\\s\\S]",relevance:0},O={scope:"string",begin:"'",end:"'", +illegal:"\\n",contains:[k]},x={scope:"string",begin:'"',end:'"',illegal:"\\n", +contains:[k]},M=(e,n,t={})=>{const a=r({scope:"comment",begin:e,end:n, +contains:[]},t);a.contains.push({scope:"doctag", +begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)", +end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0}) +;const i=p("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/) +;return a.contains.push({begin:m(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),a +},S=M("//","$"),A=M("/\\*","\\*/"),C=M("#","$");var T=Object.freeze({ +__proto__:null,MATCH_NOTHING_RE:/\b\B/,IDENT_RE:E,UNDERSCORE_IDENT_RE:y, +NUMBER_RE:w,C_NUMBER_RE:N,BINARY_NUMBER_RE:v, +RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~", +SHEBANG:(e={})=>{const n=/^#![ ]*\// +;return e.binary&&(e.begin=m(n,/.*\b/,e.binary,/\b.*/)),r({scope:"meta",begin:n, +end:/$/,relevance:0,"on:begin":(e,n)=>{0!==e.index&&n.ignoreMatch()}},e)}, +BACKSLASH_ESCAPE:k,APOS_STRING_MODE:O,QUOTE_STRING_MODE:x,PHRASAL_WORDS_MODE:{ +begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/ +},COMMENT:M,C_LINE_COMMENT_MODE:S,C_BLOCK_COMMENT_MODE:A,HASH_COMMENT_MODE:C, +NUMBER_MODE:{scope:"number",begin:w,relevance:0},C_NUMBER_MODE:{scope:"number", +begin:N,relevance:0},BINARY_NUMBER_MODE:{scope:"number",begin:v,relevance:0}, +REGEXP_MODE:{begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//, +end:/\/[gimuy]*/,illegal:/\n/,contains:[k,{begin:/\[/,end:/\]/,relevance:0, +contains:[k]}]}]},TITLE_MODE:{scope:"title",begin:E,relevance:0}, +UNDERSCORE_TITLE_MODE:{scope:"title",begin:y,relevance:0},METHOD_GUARD:{ +begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0},END_SAME_AS_BEGIN:e=>Object.assign(e,{ +"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{ +n.data._beginMatch!==e[1]&&n.ignoreMatch()}})});function R(e,n){ +"."===e.input[e.index-1]&&n.ignoreMatch()}function D(e,n){ +void 0!==e.className&&(e.scope=e.className,delete e.className)}function I(e,n){ +n&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)", +e.__beforeBegin=R,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords, +void 0===e.relevance&&(e.relevance=0))}function L(e,n){ +Array.isArray(e.illegal)&&(e.illegal=p(...e.illegal))}function B(e,n){ +if(e.match){ +if(e.begin||e.end)throw Error("begin & end are not supported with match") +;e.begin=e.match,delete e.match}}function $(e,n){ +void 0===e.relevance&&(e.relevance=1)}const z=(e,n)=>{if(!e.beforeMatch)return +;if(e.starts)throw Error("beforeMatch cannot be used with starts") +;const t=Object.assign({},e);Object.keys(e).forEach((n=>{delete e[n] +})),e.keywords=t.keywords,e.begin=m(t.beforeMatch,g(t.begin)),e.starts={ +relevance:0,contains:[Object.assign(t,{endsParent:!0})] +},e.relevance=0,delete t.beforeMatch +},F=["of","and","for","in","not","or","if","then","parent","list","value"] +;function U(e,n,t="keyword"){const a=Object.create(null) +;return"string"==typeof e?i(t,e.split(" ")):Array.isArray(e)?i(t,e):Object.keys(e).forEach((t=>{ +Object.assign(a,U(e[t],n,t))})),a;function i(e,t){ +n&&(t=t.map((e=>e.toLowerCase()))),t.forEach((n=>{const t=n.split("|") +;a[t[0]]=[e,j(t[0],t[1])]}))}}function j(e,n){ +return n?Number(n):(e=>F.includes(e.toLowerCase()))(e)?0:1}const P={},K=e=>{ +console.error(e)},H=(e,...n)=>{console.log("WARN: "+e,...n)},q=(e,n)=>{ +P[`${e}/${n}`]||(console.log(`Deprecated as of ${e}. ${n}`),P[`${e}/${n}`]=!0) +},Z=Error();function G(e,n,{key:t}){let a=0;const i=e[t],r={},s={} +;for(let e=1;e<=n.length;e++)s[e+a]=i[e],r[e+a]=!0,a+=_(n[e-1]) +;e[t]=s,e[t]._emit=r,e[t]._multi=!0}function W(e){(e=>{ +e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope, +delete e.scope)})(e),"string"==typeof e.beginScope&&(e.beginScope={ +_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope +}),(e=>{if(Array.isArray(e.begin)){ +if(e.skip||e.excludeBegin||e.returnBegin)throw K("skip, excludeBegin, returnBegin not compatible with beginScope: {}"), +Z +;if("object"!=typeof e.beginScope||null===e.beginScope)throw K("beginScope must be object"), +Z;G(e,e.begin,{key:"beginScope"}),e.begin=f(e.begin,{joinWith:""})}})(e),(e=>{ +if(Array.isArray(e.end)){ +if(e.skip||e.excludeEnd||e.returnEnd)throw K("skip, excludeEnd, returnEnd not compatible with endScope: {}"), +Z +;if("object"!=typeof e.endScope||null===e.endScope)throw K("endScope must be object"), +Z;G(e,e.end,{key:"endScope"}),e.end=f(e.end,{joinWith:""})}})(e)}function Q(e){ +function n(n,t){ +return RegExp(d(n),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(t?"g":"")) +}class t{constructor(){ +this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0} +addRule(e,n){ +n.position=this.position++,this.matchIndexes[this.matchAt]=n,this.regexes.push([n,e]), +this.matchAt+=_(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null) +;const e=this.regexes.map((e=>e[1]));this.matcherRe=n(f(e,{joinWith:"|" +}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex +;const n=this.matcherRe.exec(e);if(!n)return null +;const t=n.findIndex(((e,n)=>n>0&&void 0!==e)),a=this.matchIndexes[t] +;return n.splice(0,t),Object.assign(n,a)}}class a{constructor(){ +this.rules=[],this.multiRegexes=[], +this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){ +if(this.multiRegexes[e])return this.multiRegexes[e];const n=new t +;return this.rules.slice(e).forEach((([e,t])=>n.addRule(e,t))), +n.compile(),this.multiRegexes[e]=n,n}resumingScanAtSamePosition(){ +return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,n){ +this.rules.push([e,n]),"begin"===n.type&&this.count++}exec(e){ +const n=this.getMatcher(this.regexIndex);n.lastIndex=this.lastIndex +;let t=n.exec(e) +;if(this.resumingScanAtSamePosition())if(t&&t.index===this.lastIndex);else{ +const n=this.getMatcher(0);n.lastIndex=this.lastIndex+1,t=n.exec(e)} +return t&&(this.regexIndex+=t.position+1, +this.regexIndex===this.count&&this.considerAll()),t}} +if(e.compilerExtensions||(e.compilerExtensions=[]), +e.contains&&e.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.") +;return e.classNameAliases=r(e.classNameAliases||{}),function t(i,s){const o=i +;if(i.isCompiled)return o +;[D,B,W,z].forEach((e=>e(i,s))),e.compilerExtensions.forEach((e=>e(i,s))), +i.__beforeBegin=null,[I,L,$].forEach((e=>e(i,s))),i.isCompiled=!0;let l=null +;return"object"==typeof i.keywords&&i.keywords.$pattern&&(i.keywords=Object.assign({},i.keywords), +l=i.keywords.$pattern, +delete i.keywords.$pattern),l=l||/\w+/,i.keywords&&(i.keywords=U(i.keywords,e.case_insensitive)), +o.keywordPatternRe=n(l,!0), +s&&(i.begin||(i.begin=/\B|\b/),o.beginRe=n(o.begin),i.end||i.endsWithParent||(i.end=/\B|\b/), +i.end&&(o.endRe=n(o.end)), +o.terminatorEnd=d(o.end)||"",i.endsWithParent&&s.terminatorEnd&&(o.terminatorEnd+=(i.end?"|":"")+s.terminatorEnd)), +i.illegal&&(o.illegalRe=n(i.illegal)), +i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map((e=>(e=>(e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((n=>r(e,{ +variants:null},n)))),e.cachedVariants?e.cachedVariants:X(e)?r(e,{ +starts:e.starts?r(e.starts):null +}):Object.isFrozen(e)?r(e):e))("self"===e?i:e)))),i.contains.forEach((e=>{t(e,o) +})),i.starts&&t(i.starts,s),o.matcher=(e=>{const n=new a +;return e.contains.forEach((e=>n.addRule(e.begin,{rule:e,type:"begin" +}))),e.terminatorEnd&&n.addRule(e.terminatorEnd,{type:"end" +}),e.illegal&&n.addRule(e.illegal,{type:"illegal"}),n})(o),o}(e)}function X(e){ +return!!e&&(e.endsWithParent||X(e.starts))}class V extends Error{ +constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}} +const J=i,Y=r,ee=Symbol("nomatch");var ne=(e=>{ +const n=Object.create(null),i=Object.create(null),r=[];let s=!0 +;const o="Could not find the language '{}', did you forget to load/include a language module?",l={ +disableAutodetect:!0,name:"Plain text",contains:[]};let d={ +ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i, +languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-", +cssSelector:"pre code",languages:null,__emitter:c};function _(e){ +return d.noHighlightRe.test(e)}function h(e,n,t){let a="",i="" +;"object"==typeof n?(a=e, +t=n.ignoreIllegals,i=n.language):(q("10.7.0","highlight(lang, code, ...args) has been deprecated."), +q("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"), +i=e,a=n),void 0===t&&(t=!0);const r={code:a,language:i};x("before:highlight",r) +;const s=r.result?r.result:f(r.language,r.code,t) +;return s.code=r.code,x("after:highlight",s),s}function f(e,t,i,r){ +const l=Object.create(null);function c(){if(!O.keywords)return void M.addText(S) +;let e=0;O.keywordPatternRe.lastIndex=0;let n=O.keywordPatternRe.exec(S),t="" +;for(;n;){t+=S.substring(e,n.index) +;const i=w.case_insensitive?n[0].toLowerCase():n[0],r=(a=i,O.keywords[a]);if(r){ +const[e,a]=r +;if(M.addText(t),t="",l[i]=(l[i]||0)+1,l[i]<=7&&(A+=a),e.startsWith("_"))t+=n[0];else{ +const t=w.classNameAliases[e]||e;M.addKeyword(n[0],t)}}else t+=n[0] +;e=O.keywordPatternRe.lastIndex,n=O.keywordPatternRe.exec(S)}var a +;t+=S.substr(e),M.addText(t)}function g(){null!=O.subLanguage?(()=>{ +if(""===S)return;let e=null;if("string"==typeof O.subLanguage){ +if(!n[O.subLanguage])return void M.addText(S) +;e=f(O.subLanguage,S,!0,x[O.subLanguage]),x[O.subLanguage]=e._top +}else e=E(S,O.subLanguage.length?O.subLanguage:null) +;O.relevance>0&&(A+=e.relevance),M.addSublanguage(e._emitter,e.language) +})():c(),S=""}function u(e,n){let t=1;const a=n.length-1;for(;t<=a;){ +if(!e._emit[t]){t++;continue}const a=w.classNameAliases[e[t]]||e[t],i=n[t] +;a?M.addKeyword(i,a):(S=i,c(),S=""),t++}}function b(e,n){ +return e.scope&&"string"==typeof e.scope&&M.openNode(w.classNameAliases[e.scope]||e.scope), +e.beginScope&&(e.beginScope._wrap?(M.addKeyword(S,w.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap), +S=""):e.beginScope._multi&&(u(e.beginScope,n),S="")),O=Object.create(e,{parent:{ +value:O}}),O}function m(e,n,t){let i=((e,n)=>{const t=e&&e.exec(n) +;return t&&0===t.index})(e.endRe,t);if(i){if(e["on:end"]){const t=new a(e) +;e["on:end"](n,t),t.isMatchIgnored&&(i=!1)}if(i){ +for(;e.endsParent&&e.parent;)e=e.parent;return e}} +if(e.endsWithParent)return m(e.parent,n,t)}function p(e){ +return 0===O.matcher.regexIndex?(S+=e[0],1):(R=!0,0)}function _(e){ +const n=e[0],a=t.substr(e.index),i=m(O,e,a);if(!i)return ee;const r=O +;O.endScope&&O.endScope._wrap?(g(), +M.addKeyword(n,O.endScope._wrap)):O.endScope&&O.endScope._multi?(g(), +u(O.endScope,e)):r.skip?S+=n:(r.returnEnd||r.excludeEnd||(S+=n), +g(),r.excludeEnd&&(S=n));do{ +O.scope&&M.closeNode(),O.skip||O.subLanguage||(A+=O.relevance),O=O.parent +}while(O!==i.parent);return i.starts&&b(i.starts,e),r.returnEnd?0:n.length} +let h={};function y(n,r){const o=r&&r[0];if(S+=n,null==o)return g(),0 +;if("begin"===h.type&&"end"===r.type&&h.index===r.index&&""===o){ +if(S+=t.slice(r.index,r.index+1),!s){const n=Error(`0 width match regex (${e})`) +;throw n.languageName=e,n.badRule=h.rule,n}return 1} +if(h=r,"begin"===r.type)return(e=>{ +const n=e[0],t=e.rule,i=new a(t),r=[t.__beforeBegin,t["on:begin"]] +;for(const t of r)if(t&&(t(e,i),i.isMatchIgnored))return p(n) +;return t.skip?S+=n:(t.excludeBegin&&(S+=n), +g(),t.returnBegin||t.excludeBegin||(S=n)),b(t,e),t.returnBegin?0:n.length})(r) +;if("illegal"===r.type&&!i){ +const e=Error('Illegal lexeme "'+o+'" for mode "'+(O.scope||"")+'"') +;throw e.mode=O,e}if("end"===r.type){const e=_(r);if(e!==ee)return e} +if("illegal"===r.type&&""===o)return 1 +;if(T>1e5&&T>3*r.index)throw Error("potential infinite loop, way more iterations than matches") +;return S+=o,o.length}const w=v(e) +;if(!w)throw K(o.replace("{}",e)),Error('Unknown language: "'+e+'"') +;const N=Q(w);let k="",O=r||N;const x={},M=new d.__emitter(d);(()=>{const e=[] +;for(let n=O;n!==w;n=n.parent)n.scope&&e.unshift(n.scope) +;e.forEach((e=>M.openNode(e)))})();let S="",A=0,C=0,T=0,R=!1;try{ +for(O.matcher.considerAll();;){ +T++,R?R=!1:O.matcher.considerAll(),O.matcher.lastIndex=C +;const e=O.matcher.exec(t);if(!e)break;const n=y(t.substring(C,e.index),e) +;C=e.index+n}return y(t.substr(C)),M.closeAllNodes(),M.finalize(),k=M.toHTML(),{ +language:e,value:k,relevance:A,illegal:!1,_emitter:M,_top:O}}catch(n){ +if(n.message&&n.message.includes("Illegal"))return{language:e,value:J(t), +illegal:!0,relevance:0,_illegalBy:{message:n.message,index:C, +context:t.slice(C-100,C+100),mode:n.mode,resultSoFar:k},_emitter:M};if(s)return{ +language:e,value:J(t),illegal:!1,relevance:0,errorRaised:n,_emitter:M,_top:O} +;throw n}}function E(e,t){t=t||d.languages||Object.keys(n);const a=(e=>{ +const n={value:J(e),illegal:!1,relevance:0,_top:l,_emitter:new d.__emitter(d)} +;return n._emitter.addText(e),n})(e),i=t.filter(v).filter(O).map((n=>f(n,e,!1))) +;i.unshift(a);const r=i.sort(((e,n)=>{ +if(e.relevance!==n.relevance)return n.relevance-e.relevance +;if(e.language&&n.language){if(v(e.language).supersetOf===n.language)return 1 +;if(v(n.language).supersetOf===e.language)return-1}return 0})),[s,o]=r,c=s +;return c.secondBest=o,c}function y(e){let n=null;const t=(e=>{ +let n=e.className+" ";n+=e.parentNode?e.parentNode.className:"" +;const t=d.languageDetectRe.exec(n);if(t){const n=v(t[1]) +;return n||(H(o.replace("{}",t[1])), +H("Falling back to no-highlight mode for this block.",e)),n?t[1]:"no-highlight"} +return n.split(/\s+/).find((e=>_(e)||v(e)))})(e);if(_(t))return +;if(x("before:highlightElement",{el:e,language:t +}),e.children.length>0&&(d.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."), +console.warn("https://github.com/highlightjs/highlight.js/wiki/security"), +console.warn("The element with unescaped HTML:"), +console.warn(e)),d.throwUnescapedHTML))throw new V("One of your code blocks includes unescaped HTML.",e.innerHTML) +;n=e;const a=n.textContent,r=t?h(a,{language:t,ignoreIllegals:!0}):E(a) +;e.innerHTML=r.value,((e,n,t)=>{const a=n&&i[n]||t +;e.classList.add("hljs"),e.classList.add("language-"+a) +})(e,t,r.language),e.result={language:r.language,re:r.relevance, +relevance:r.relevance},r.secondBest&&(e.secondBest={ +language:r.secondBest.language,relevance:r.secondBest.relevance +}),x("after:highlightElement",{el:e,result:r,text:a})}let w=!1;function N(){ +"loading"!==document.readyState?document.querySelectorAll(d.cssSelector).forEach(y):w=!0 +}function v(e){return e=(e||"").toLowerCase(),n[e]||n[i[e]]} +function k(e,{languageName:n}){"string"==typeof e&&(e=[e]),e.forEach((e=>{ +i[e.toLowerCase()]=n}))}function O(e){const n=v(e) +;return n&&!n.disableAutodetect}function x(e,n){const t=e;r.forEach((e=>{ +e[t]&&e[t](n)}))} +"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(()=>{ +w&&N()}),!1),Object.assign(e,{highlight:h,highlightAuto:E,highlightAll:N, +highlightElement:y, +highlightBlock:e=>(q("10.7.0","highlightBlock will be removed entirely in v12.0"), +q("10.7.0","Please use highlightElement now."),y(e)),configure:e=>{d=Y(d,e)}, +initHighlighting:()=>{ +N(),q("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")}, +initHighlightingOnLoad:()=>{ +N(),q("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.") +},registerLanguage:(t,a)=>{let i=null;try{i=a(e)}catch(e){ +if(K("Language definition for '{}' could not be registered.".replace("{}",t)), +!s)throw e;K(e),i=l} +i.name||(i.name=t),n[t]=i,i.rawDefinition=a.bind(null,e),i.aliases&&k(i.aliases,{ +languageName:t})},unregisterLanguage:e=>{delete n[e] +;for(const n of Object.keys(i))i[n]===e&&delete i[n]}, +listLanguages:()=>Object.keys(n),getLanguage:v,registerAliases:k, +autoDetection:O,inherit:Y,addPlugin:e=>{(e=>{ +e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=n=>{ +e["before:highlightBlock"](Object.assign({block:n.el},n)) +}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=n=>{ +e["after:highlightBlock"](Object.assign({block:n.el},n))})})(e),r.push(e)} +}),e.debugMode=()=>{s=!1},e.safeMode=()=>{s=!0 +},e.versionString="11.5.0",e.regex={concat:m,lookahead:g,either:p,optional:b, +anyNumberOfTimes:u};for(const e in T)"object"==typeof T[e]&&t(T[e]) +;return Object.assign(e,T),e})({});const te=e=>({IMPORTANT:{scope:"meta", +begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{ +scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/}, +FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/}, +ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$", +contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{ +scope:"number", +begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?", +relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/} +}),ae=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],ie=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],re=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],se=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],oe=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse(),le=re.concat(se) +;var ce="\\.([0-9](_*[0-9])*)",de="[0-9a-fA-F](_*[0-9a-fA-F])*",ge={ +className:"number",variants:[{ +begin:`(\\b([0-9](_*[0-9])*)((${ce})|\\.)?|(${ce}))[eE][+-]?([0-9](_*[0-9])*)[fFdD]?\\b` +},{begin:`\\b([0-9](_*[0-9])*)((${ce})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{ +begin:`(${ce})[fFdD]?\\b`},{begin:"\\b([0-9](_*[0-9])*)[fFdD]\\b"},{ +begin:`\\b0[xX]((${de})\\.?|(${de})?\\.(${de}))[pP][+-]?([0-9](_*[0-9])*)[fFdD]?\\b` +},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${de})[lL]?\\b`},{ +begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}], +relevance:0};function ue(e,n,t){return-1===t?"":e.replace(n,(a=>ue(e,n,t-1)))} +const be="[A-Za-z$_][0-9A-Za-z$_]*",me=["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"],pe=["true","false","null","undefined","NaN","Infinity"],_e=["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"],he=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],fe=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Ee=["arguments","this","super","console","window","document","localStorage","module","global"],ye=[].concat(fe,_e,he) +;function we(e){const n=e.regex,t=be,a={begin:/<[A-Za-z0-9\\._:-]+/, +end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,n)=>{ +const t=e[0].length+e.index,a=e.input[t] +;if("<"===a||","===a)return void n.ignoreMatch();let i +;">"===a&&(((e,{after:n})=>{const t="",O={ +match:[/const|var|let/,/\s+/,t,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(k)], +keywords:"async",className:{1:"keyword",3:"title.function"},contains:[_]} +;return{name:"Javascript",aliases:["js","jsx","mjs","cjs"],keywords:i,exports:{ +PARAMS_CONTAINS:p,CLASS_REFERENCE:f},illegal:/#(?![$_A-z])/, +contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{ +label:"use_strict",className:"meta",relevance:10, +begin:/^\s*['"]use (strict|asm)['"]/ +},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,d,g,u,o,f,{className:"attr", +begin:t+n.lookahead(":"),relevance:0},O,{ +begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*", +keywords:"return throw case",relevance:0,contains:[u,e.REGEXP_MODE,{ +className:"function",begin:k,returnBegin:!0,end:"\\s*=>",contains:[{ +className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{ +className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0, +excludeEnd:!0,keywords:i,contains:p}]}]},{begin:/,/,relevance:0},{match:/\s+/, +relevance:0},{variants:[{begin:"<>",end:""},{ +match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:a.begin, +"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{ +begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},E,{ +beginKeywords:"while if switch catch for"},{ +begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{", +returnBegin:!0,label:"func.def",contains:[_,e.inherit(e.TITLE_MODE,{begin:t, +className:"title.function"})]},{match:/\.\.\./,relevance:0},N,{match:"\\$"+t, +relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"}, +contains:[_]},y,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/, +className:"variable.constant"},h,v,{match:/\$[(.]/}]}} +const Ne=e=>m(/\b/,e,/\w$/.test(e)?/\b/:/\B/),ve=["Protocol","Type"].map(Ne),ke=["init","self"].map(Ne),Oe=["Any","Self"],xe=["actor","associatedtype","async","await",/as\?/,/as!/,"as","break","case","catch","class","continue","convenience","default","defer","deinit","didSet","do","dynamic","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],Me=["false","nil","true"],Se=["assignment","associativity","higherThan","left","lowerThan","none","right"],Ae=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warn_unqualified_access","#warning"],Ce=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],Te=p(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),Re=p(Te,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),De=m(Te,Re,"*"),Ie=p(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Le=p(Ie,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Be=m(Ie,Le,"*"),$e=m(/[A-Z]/,Le,"*"),ze=["autoclosure",m(/convention\(/,p("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",m(/objc\(/,Be,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","testable","UIApplicationMain","unknown","usableFromInline"],Fe=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"] +;var Ue=Object.freeze({__proto__:null,grmr_bash:e=>{const n=e.regex,t={},a={ +begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[t]}]} +;Object.assign(t,{className:"variable",variants:[{ +begin:n.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},a]});const i={ +className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},r={ +begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/, +end:/(\w+)/,className:"string"})]}},s={className:"string",begin:/"/,end:/"/, +contains:[e.BACKSLASH_ESCAPE,t,i]};i.contains.push(s);const o={begin:/\$\(\(/, +end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,t] +},l=e.SHEBANG({binary:"(fish|bash|zsh|sh|csh|ksh|tcsh|dash|scsh)",relevance:10 +}),c={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:[l,e.SHEBANG(),c,o,e.HASH_COMMENT_MODE,r,{match:/(\/[a-z._-]+)+/},s,{ +className:"",begin:/\\"/},{className:"string",begin:/'/,end:/'/},t]}}, +grmr_c:e=>{const n=e.regex,t=e.COMMENT("//","$",{contains:[{begin:/\\\n/}] +}),a="[a-zA-Z_]\\w*::",i="(decltype\\(auto\\)|"+n.optional(a)+"[a-zA-Z_]\\w*"+n.optional("<[^<>]+>")+")",r={ +className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{ +match:/\batomic_[a-z]{3,6}\b/}]},s={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})"/})]},o={ +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},l={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(s,{className:"string"}),{ +className:"string",begin:/<.*?>/},t,e.C_BLOCK_COMMENT_MODE]},c={ +className:"title",begin:n.optional(a)+e.IDENT_RE,relevance:0 +},d=n.optional(a)+e.IDENT_RE+"\\s*\\(",g={ +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" +},u=[l,r,t,e.C_BLOCK_COMMENT_MODE,o,s],b={variants:[{begin:/=/,end:/;/},{ +begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}], +keywords:g,contains:u.concat([{begin:/\(/,end:/\)/,keywords:g, +contains:u.concat(["self"]),relevance:0}]),relevance:0},m={ +begin:"("+i+"[\\*&\\s]+)+"+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0, +keywords:g,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)", +keywords:g,relevance:0},{begin:d,returnBegin:!0,contains:[e.inherit(c,{ +className:"title.function"})],relevance:0},{relevance:0,match:/,/},{ +className:"params",begin:/\(/,end:/\)/,keywords:g,relevance:0, +contains:[t,e.C_BLOCK_COMMENT_MODE,s,o,r,{begin:/\(/,end:/\)/,keywords:g, +relevance:0,contains:["self",t,e.C_BLOCK_COMMENT_MODE,s,o,r]}] +},r,t,e.C_BLOCK_COMMENT_MODE,l]};return{name:"C",aliases:["h"],keywords:g, +disableAutodetect:!0,illegal:"=]/,contains:[{ +beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:l, +strings:s,keywords:g}}},grmr_cpp:e=>{const n=e.regex,t=e.COMMENT("//","$",{ +contains:[{begin:/\\\n/}] +}),a="[a-zA-Z_]\\w*::",i="(?!struct)(decltype\\(auto\\)|"+n.optional(a)+"[a-zA-Z_]\\w*"+n.optional("<[^<>]+>")+")",r={ +className:"type",begin:"\\b[a-z\\d_]*_t\\b"},s={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})"/})]},o={ +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},l={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(s,{className:"string"}),{ +className:"string",begin:/<.*?>/},t,e.C_BLOCK_COMMENT_MODE]},c={ +className:"title",begin:n.optional(a)+e.IDENT_RE,relevance:0 +},d=n.optional(a)+e.IDENT_RE+"\\s*\\(",g={ +type:["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"], +keyword:["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"], +literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"], +_type_hints:["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"] +},u={className:"function.dispatch",relevance:0,keywords:{ +_hint:["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"] +}, +begin:n.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,n.lookahead(/(<[^<>]+>|)\s*\(/)) +},b=[u,l,r,t,e.C_BLOCK_COMMENT_MODE,o,s],m={variants:[{begin:/=/,end:/;/},{ +begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}], +keywords:g,contains:b.concat([{begin:/\(/,end:/\)/,keywords:g, +contains:b.concat(["self"]),relevance:0}]),relevance:0},p={className:"function", +begin:"("+i+"[\\*&\\s]+)+"+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0, +keywords:g,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)", +keywords:g,relevance:0},{begin:d,returnBegin:!0,contains:[c],relevance:0},{ +begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[s,o]},{ +relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:g, +relevance:0,contains:[t,e.C_BLOCK_COMMENT_MODE,s,o,r,{begin:/\(/,end:/\)/, +keywords:g,relevance:0,contains:["self",t,e.C_BLOCK_COMMENT_MODE,s,o,r]}] +},r,t,e.C_BLOCK_COMMENT_MODE,l]};return{name:"C++", +aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:g,illegal:"",keywords:g,contains:["self",r]},{begin:e.IDENT_RE+"::",keywords:g},{ +match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/], +className:{1:"keyword",3:"title.class"}}])}},grmr_csharp:e=>{const n={ +keyword:["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"].concat(["add","alias","and","ascending","async","await","by","descending","equals","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","remove","select","set","unmanaged","value|0","var","when","where","with","yield"]), +built_in:["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"], +literal:["default","false","null","true"]},t=e.inherit(e.TITLE_MODE,{ +begin:"[a-zA-Z](\\.?\\w)*"}),a={className:"number",variants:[{ +begin:"\\b(0b[01']+)"},{ +begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{ +begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)" +}],relevance:0},i={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}] +},r=e.inherit(i,{illegal:/\n/}),s={className:"subst",begin:/\{/,end:/\}/, +keywords:n},o=e.inherit(s,{illegal:/\n/}),l={className:"string",begin:/\$"/, +end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/ +},e.BACKSLASH_ESCAPE,o]},c={className:"string",begin:/\$@"/,end:'"',contains:[{ +begin:/\{\{/},{begin:/\}\}/},{begin:'""'},s]},d=e.inherit(c,{illegal:/\n/, +contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},o]}) +;s.contains=[c,l,i,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.C_BLOCK_COMMENT_MODE], +o.contains=[d,l,r,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.inherit(e.C_BLOCK_COMMENT_MODE,{ +illegal:/\n/})];const g={variants:[c,l,i,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE] +},u={begin:"<",end:">",contains:[{beginKeywords:"in out"},t] +},b=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",m={ +begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"], +keywords:n,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0, +contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{ +begin:"\x3c!--|--\x3e"},{begin:""}]}] +}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#", +end:"$",keywords:{ +keyword:"if else elif endif define undef warning error line region endregion pragma checksum" +}},g,a,{beginKeywords:"class interface",relevance:0,end:/[{;=]/, +illegal:/[^\s:,]/,contains:[{beginKeywords:"where class" +},t,u,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace", +relevance:0,end:/[{;=]/,illegal:/[^\s:]/, +contains:[t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{ +beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/, +contains:[t,u,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta", +begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{ +className:"string",begin:/"/,end:/"/}]},{ +beginKeywords:"new return throw await else",relevance:0},{className:"function", +begin:"("+b+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0, +end:/\s*[{;=]/,excludeEnd:!0,keywords:n,contains:[{ +beginKeywords:"public private protected static internal protected abstract async extern override unsafe virtual new sealed partial", +relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0, +contains:[e.TITLE_MODE,u],relevance:0},{match:/\(\)/},{className:"params", +begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:n,relevance:0, +contains:[g,a,e.C_BLOCK_COMMENT_MODE] +},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},m]}},grmr_css:e=>{ +const n=e.regex,t=te(e),a=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{ +name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{ +keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"}, +contains:[t.BLOCK_COMMENT,{begin:/-(webkit|moz|ms|o)-(?=[a-z])/ +},t.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0 +},{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0 +},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{ +begin:":("+re.join("|")+")"},{begin:":(:)?("+se.join("|")+")"}] +},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+oe.join("|")+")\\b"},{ +begin:/:/,end:/[;}{]/, +contains:[t.BLOCK_COMMENT,t.HEXCOLOR,t.IMPORTANT,t.CSS_NUMBER_MODE,...a,{ +begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri" +},contains:[{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}] +},t.FUNCTION_DISPATCH]},{begin:n.lookahead(/@/),end:"[{;]",relevance:0, +illegal:/:/,contains:[{className:"keyword",begin:/@-?\w[\w]*(-\w+)*/},{ +begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{ +$pattern:/[a-z-]+/,keyword:"and or not only",attribute:ie.join(" ")},contains:[{ +begin:/[a-z-]+(?=:)/,className:"attribute"},...a,t.CSS_NUMBER_MODE]}]},{ +className:"selector-tag",begin:"\\b("+ae.join("|")+")\\b"}]}},grmr_diff:e=>{ +const n=e.regex;return{name:"Diff",aliases:["patch"],contains:[{ +className:"meta",relevance:10, +match:n.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/) +},{className:"comment",variants:[{ +begin:n.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/), +end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{ +className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/, +end:/$/}]}},grmr_go:e=>{const n={ +keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"], +type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"], +literal:["true","false","iota","nil"], +built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"] +};return{name:"Go",aliases:["golang"],keywords:n,illegal:"{ +const n=e.regex,t={className:"number",relevance:0,variants:[{ +begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},a=e.COMMENT();a.variants=[{ +begin:/;/,end:/$/},{begin:/#/,end:/$/}];const i={className:"variable", +variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},r={ +className:"literal",begin:/\bon|off|true|false|yes|no\b/},s={className:"string", +contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{ +begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}] +},o={begin:/\[/,end:/\]/,contains:[a,r,i,s,t,"self"],relevance:0 +},l=n.either(/[A-Za-z0-9_-]+/,/"(\\"|[^"])*"/,/'[^']*'/);return{ +name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/, +contains:[a,{className:"section",begin:/\[+/,end:/\]+/},{ +begin:n.concat(l,"(\\s*\\.\\s*",l,")*",n.lookahead(/\s*=\s*[^#\s]/)), +className:"attr",starts:{end:/$/,contains:[a,o,r,i,s,t]}}]}},grmr_java:e=>{ +const n=e.regex,t="[\xc0-\u02b8a-zA-Z_$][\xc0-\u02b8a-zA-Z_$0-9]*",a=t+ue("(?:<"+t+"~~~(?:\\s*,\\s*"+t+"~~~)*>)?",/~~~/g,2),i={ +keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed"], +literal:["false","true","null"], +type:["char","boolean","long","float","int","byte","short","double"], +built_in:["super","this"]},r={className:"meta",begin:"@"+t,contains:[{ +begin:/\(/,end:/\)/,contains:["self"]}]},s={className:"params",begin:/\(/, +end:/\)/,keywords:i,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0} +;return{name:"Java",aliases:["jsp"],keywords:i,illegal:/<\/|#/, +contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/, +relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{ +begin:/import java\.[a-z]+\./,keywords:"import",relevance:2 +},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/, +className:"string",contains:[e.BACKSLASH_ESCAPE] +},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{ +match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,t],className:{ +1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{ +begin:[n.concat(/(?!else)/,t),/\s+/,t,/\s+/,/=/],className:{1:"type", +3:"variable",5:"operator"}},{begin:[/record/,/\s+/,t],className:{1:"keyword", +3:"title.class"},contains:[s,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{ +beginKeywords:"new throw return else",relevance:0},{ +begin:["(?:"+a+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{ +2:"title.function"},keywords:i,contains:[{className:"params",begin:/\(/, +end:/\)/,keywords:i,relevance:0, +contains:[r,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,ge,e.C_BLOCK_COMMENT_MODE] +},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},ge,r]}},grmr_javascript:we, +grmr_json:e=>({name:"JSON",contains:[{className:"attr", +begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{match:/[{}[\],:]/, +className:"punctuation",relevance:0},e.QUOTE_STRING_MODE,{ +beginKeywords:"true false null" +},e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}), +grmr_kotlin:e=>{const n={ +keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual", +built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing", +literal:"true false null"},t={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@" +},a={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},i={ +className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},r={className:"string", +variants:[{begin:'"""',end:'"""(?=[^"])',contains:[i,a]},{begin:"'",end:"'", +illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/, +contains:[e.BACKSLASH_ESCAPE,i,a]}]};a.contains.push(r);const s={ +className:"meta", +begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?" +},o={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/, +end:/\)/,contains:[e.inherit(r,{className:"string"})]}] +},l=ge,c=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),d={ +variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/, +contains:[]}]},g=d;return g.variants[1].contains=[d],d.variants[1].contains=[g], +{name:"Kotlin",aliases:["kt","kts"],keywords:n, +contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag", +begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,c,{className:"keyword", +begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol", +begin:/@\w+/}]}},t,s,o,{className:"function",beginKeywords:"fun",end:"[(]|$", +returnBegin:!0,excludeEnd:!0,keywords:n,relevance:5,contains:[{ +begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0, +contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin://, +keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/, +endsParent:!0,keywords:n,relevance:0,contains:[{begin:/:/,end:/[=,\/]/, +endsWithParent:!0,contains:[d,e.C_LINE_COMMENT_MODE,c],relevance:0 +},e.C_LINE_COMMENT_MODE,c,s,o,r,e.C_NUMBER_MODE]},c]},{className:"class", +beginKeywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0, +illegal:"extends implements",contains:[{ +beginKeywords:"public protected internal private constructor" +},e.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0, +excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,]|$/, +excludeBegin:!0,returnEnd:!0},s,o]},r,{className:"meta",begin:"^#!/usr/bin/env", +end:"$",illegal:"\n"},l]}},grmr_less:e=>{ +const n=te(e),t=le,a="([\\w-]+|@\\{[\\w-]+\\})",i=[],r=[],s=e=>({ +className:"string",begin:"~?"+e+".*?"+e}),o=(e,n,t)=>({className:e,begin:n, +relevance:t}),l={$pattern:/[a-z-]+/,keyword:"and or not only", +attribute:ie.join(" ")},c={begin:"\\(",end:"\\)",contains:r,keywords:l, +relevance:0} +;r.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,s("'"),s('"'),n.CSS_NUMBER_MODE,{ +begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]", +excludeEnd:!0} +},n.HEXCOLOR,c,o("variable","@@?[\\w-]+",10),o("variable","@\\{[\\w-]+\\}"),o("built_in","~?`[^`]*?`"),{ +className:"attribute",begin:"[\\w-]+\\s*:",end:":",returnBegin:!0,excludeEnd:!0 +},n.IMPORTANT);const d=r.concat({begin:/\{/,end:/\}/,contains:i}),g={ +beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not" +}].concat(r)},u={begin:a+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0, +contains:[{begin:/-(webkit|moz|ms|o)-/},n.CSS_VARIABLE,{className:"attribute", +begin:"\\b("+oe.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0, +illegal:"[<=$]",relevance:0,contains:r}}]},b={className:"keyword", +begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b", +starts:{end:"[;{}]",keywords:l,returnEnd:!0,contains:r,relevance:0}},m={ +className:"variable",variants:[{begin:"@[\\w-]+\\s*:",relevance:15},{ +begin:"@[\\w-]+"}],starts:{end:"[;}]",returnEnd:!0,contains:d}},p={variants:[{ +begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:a,end:/\{/}],returnBegin:!0, +returnEnd:!0,illegal:"[<='$\"]",relevance:0, +contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,g,o("keyword","all\\b"),o("variable","@\\{[\\w-]+\\}"),{ +begin:"\\b("+ae.join("|")+")\\b",className:"selector-tag" +},n.CSS_NUMBER_MODE,o("selector-tag",a,0),o("selector-id","#"+a),o("selector-class","\\."+a,0),o("selector-tag","&",0),n.ATTRIBUTE_SELECTOR_MODE,{ +className:"selector-pseudo",begin:":("+re.join("|")+")"},{ +className:"selector-pseudo",begin:":(:)?("+se.join("|")+")"},{begin:/\(/, +end:/\)/,relevance:0,contains:d},{begin:"!important"},n.FUNCTION_DISPATCH]},_={ +begin:`[\\w-]+:(:)?(${t.join("|")})`,returnBegin:!0,contains:[p]} +;return i.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,b,m,_,u,p),{ +name:"Less",case_insensitive:!0,illegal:"[=>'/<($\"]",contains:i}},grmr_lua:e=>{ +const n="\\[=*\\[",t="\\]=*\\]",a={begin:n,end:t,contains:["self"] +},i=[e.COMMENT("--(?!\\[=*\\[)","$"),e.COMMENT("--\\[=*\\[",t,{contains:[a], +relevance:10})];return{name:"Lua",keywords:{$pattern:e.UNDERSCORE_IDENT_RE, +literal:"true false nil", +keyword:"and break do else elseif end for goto if in local not or repeat return then until while", +built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove" +},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)", +contains:[e.inherit(e.TITLE_MODE,{ +begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params", +begin:"\\(",endsWithParent:!0,contains:i}].concat(i) +},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string", +begin:n,end:t,contains:[a],relevance:5}])}},grmr_makefile:e=>{const n={ +className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)", +contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%{ +const n=e.regex,t=n.concat(/[A-Z_]/,n.optional(/[A-Z0-9_.-]*:/),/[A-Z0-9_.-]*/),a={ +className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/, +contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}] +},r=e.inherit(i,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{ +className:"string"}),o=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),l={ +endsWithParent:!0,illegal:/`]+/}]}]}]};return{ +name:"HTML, XML", +aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"], +case_insensitive:!0,contains:[{className:"meta",begin://, +relevance:10,contains:[i,o,s,r,{begin:/\[/,end:/\]/,contains:[{className:"meta", +begin://,contains:[i,r,o,s]}]}]},e.COMMENT(//,{ +relevance:10}),{begin://,relevance:10},a,{ +className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[o] +},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/, +keywords:{name:"style"},contains:[l],starts:{end:/<\/style>/,returnEnd:!0, +subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/, +keywords:{name:"script"},contains:[l],starts:{end:/<\/script>/,returnEnd:!0, +subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/ +},{className:"tag", +begin:n.concat(//,/>/,/\s/)))), +end:/\/?>/,contains:[{className:"name",begin:t,relevance:0,starts:l}]},{ +className:"tag",begin:n.concat(/<\//,n.lookahead(n.concat(t,/>/))),contains:[{ +className:"name",begin:t,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]} +},grmr_markdown:e=>{const n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml", +relevance:0},t={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{ +begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/, +relevance:2},{ +begin:e.regex.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/), +relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{ +begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/ +},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0, +returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)", +excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[", +end:"\\]",excludeBegin:!0,excludeEnd:!0}]},a={className:"strong",contains:[], +variants:[{begin:/_{2}/,end:/_{2}/},{begin:/\*{2}/,end:/\*{2}/}]},i={ +className:"emphasis",contains:[],variants:[{begin:/\*(?!\*)/,end:/\*/},{ +begin:/_(?!_)/,end:/_/,relevance:0}]},r=e.inherit(a,{contains:[] +}),s=e.inherit(i,{contains:[]});a.contains.push(s),i.contains.push(r) +;let o=[n,t];return[a,i,r,s].forEach((e=>{e.contains=e.contains.concat(o) +})),o=o.concat(a,i),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{ +className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:o},{ +begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n", +contains:o}]}]},n,{className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)", +end:"\\s+",excludeEnd:!0},a,i,{className:"quote",begin:"^>\\s+",contains:o, +end:"$"},{className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{ +begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{ +begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))", +contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},{ +begin:"^[-\\*]{3,}",end:"$"},t,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{ +className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{ +className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]}]}},grmr_objectivec:e=>{ +const n=/[a-zA-Z@][a-zA-Z0-9_]*/,t={$pattern:n, +keyword:["@interface","@class","@protocol","@implementation"]};return{ +name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"], +keywords:{"variable.language":["this","super"],$pattern:n, +keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"], +literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"], +built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"], +type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"] +},illegal:"/,end:/$/,illegal:"\\n" +},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class", +begin:"("+t.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:t, +contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE, +relevance:0}]}},grmr_perl:e=>{const n=e.regex,t=/[dualxmsipngr]{0,12}/,a={ +$pattern:/[\w.]+/, +keyword:"abs accept alarm and atan2 bind binmode bless break caller chdir chmod chomp chop chown chr chroot close closedir connect continue cos crypt dbmclose dbmopen defined delete die do dump each else elsif endgrent endhostent endnetent endprotoent endpwent endservent eof eval exec exists exit exp fcntl fileno flock for foreach fork format formline getc getgrent getgrgid getgrnam gethostbyaddr gethostbyname gethostent getlogin getnetbyaddr getnetbyname getnetent getpeername getpgrp getpriority getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid getservbyname getservbyport getservent getsockname getsockopt given glob gmtime goto grep gt hex if index int ioctl join keys kill last lc lcfirst length link listen local localtime log lstat lt ma map mkdir msgctl msgget msgrcv msgsnd my ne next no not oct open opendir or ord our pack package pipe pop pos print printf prototype push q|0 qq quotemeta qw qx rand read readdir readline readlink readpipe recv redo ref rename require reset return reverse rewinddir rindex rmdir say scalar seek seekdir select semctl semget semop send setgrent sethostent setnetent setpgrp setpriority setprotoent setpwent setservent setsockopt shift shmctl shmget shmread shmwrite shutdown sin sleep socket socketpair sort splice split sprintf sqrt srand stat state study sub substr symlink syscall sysopen sysread sysseek system syswrite tell telldir tie tied time times tr truncate uc ucfirst umask undef unless unlink unpack unshift untie until use utime values vec wait waitpid wantarray warn when while write x|0 xor y|0" +},i={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:a},r={begin:/->\{/, +end:/\}/},s={variants:[{begin:/\$\d/},{ +begin:n.concat(/[$%@](\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])") +},{begin:/[$%@][^\s\w{]/,relevance:0}] +},o=[e.BACKSLASH_ESCAPE,i,s],l=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],c=(e,a,i="\\1")=>{ +const r="\\1"===i?i:n.concat(i,a) +;return n.concat(n.concat("(?:",e,")"),a,/(?:\\.|[^\\\/])*?/,r,/(?:\\.|[^\\\/])*?/,i,t) +},d=(e,a,i)=>n.concat(n.concat("(?:",e,")"),a,/(?:\\.|[^\\\/])*?/,i,t),g=[s,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{ +endsWithParent:!0}),r,{className:"string",contains:o,variants:[{ +begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[", +end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{ +begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">", +relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'", +contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`", +contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{ +begin:"-?\\w+\\s*=>",relevance:0}]},{className:"number", +begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b", +relevance:0},{ +begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*", +keywords:"split return print reverse grep",relevance:0, +contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{ +begin:c("s|tr|y",n.either(...l,{capture:!0}))},{begin:c("s|tr|y","\\(","\\)")},{ +begin:c("s|tr|y","\\[","\\]")},{begin:c("s|tr|y","\\{","\\}")}],relevance:2},{ +className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{ +begin:d("(?:m|qr)?",/\//,/\//)},{begin:d("m|qr",n.either(...l,{capture:!0 +}),/\1/)},{begin:d("m|qr",/\(/,/\)/)},{begin:d("m|qr",/\[/,/\]/)},{ +begin:d("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub", +end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE]},{ +begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$", +subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}] +}];return i.contains=g,r.contains=g,{name:"Perl",aliases:["pl","pm"],keywords:a, +contains:g}},grmr_php:e=>{ +const n=e.regex,t=/(?![A-Za-z0-9])(?![$])/,a=n.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,t),i=n.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,t),r={ +scope:"variable",match:"\\$+"+a},s={scope:"subst",variants:[{begin:/\$\w+/},{ +begin:/\{\$/,end:/\}/}]},o=e.inherit(e.APOS_STRING_MODE,{illegal:null +}),l="[ \t\n]",c={scope:"string",variants:[e.inherit(e.QUOTE_STRING_MODE,{ +illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(s) +}),o,e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*(\w+)\n/,end:/[ \t]*(\w+)\b/, +contains:e.QUOTE_STRING_MODE.contains.concat(s)})]},d={scope:"number", +variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{ +begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{ +begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{ +begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?" +}],relevance:0 +},g=["false","null","true"],u=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],b=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],m={ +keyword:u,literal:(e=>{const n=[];return e.forEach((e=>{ +n.push(e),e.toLowerCase()===e?n.push(e.toUpperCase()):n.push(e.toLowerCase()) +})),n})(g),built_in:b},p=e=>e.map((e=>e.replace(/\|\d+$/,""))),_={variants:[{ +match:[/new/,n.concat(l,"+"),n.concat("(?!",p(b).join("\\b|"),"\\b)"),i],scope:{ +1:"keyword",4:"title.class"}}]},h=n.concat(a,"\\b(?!\\()"),f={variants:[{ +match:[n.concat(/::/,n.lookahead(/(?!class\b)/)),h],scope:{2:"variable.constant" +}},{match:[/::/,/class/],scope:{2:"variable.language"}},{ +match:[i,n.concat(/::/,n.lookahead(/(?!class\b)/)),h],scope:{1:"title.class", +3:"variable.constant"}},{match:[i,n.concat("::",n.lookahead(/(?!class\b)/))], +scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class", +3:"variable.language"}}]},E={scope:"attr", +match:n.concat(a,n.lookahead(":"),n.lookahead(/(?!::)/))},y={relevance:0, +begin:/\(/,end:/\)/,keywords:m,contains:[E,r,f,e.C_BLOCK_COMMENT_MODE,c,d,_] +},w={relevance:0, +match:[/\b/,n.concat("(?!fn\\b|function\\b|",p(u).join("\\b|"),"|",p(b).join("\\b|"),"\\b)"),a,n.concat(l,"*"),n.lookahead(/(?=\()/)], +scope:{3:"title.function.invoke"},contains:[y]};y.contains.push(w) +;const N=[E,f,e.C_BLOCK_COMMENT_MODE,c,d,_];return{case_insensitive:!1, +keywords:m,contains:[{begin:n.concat(/#\[\s*/,i),beginScope:"meta",end:/]/, +endScope:"meta",keywords:{literal:g,keyword:["new","array"]},contains:[{ +begin:/\[/,end:/]/,keywords:{literal:g,keyword:["new","array"]}, +contains:["self",...N]},...N,{scope:"meta",match:i}] +},e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{ +scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/, +keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE, +contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},{scope:"meta",variants:[{ +begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{ +begin:/\?>/}]},{scope:"variable.language",match:/\$this\b/},r,w,f,{ +match:[/const/,/\s/,a],scope:{1:"keyword",3:"variable.constant"}},_,{ +scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/, +excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use" +},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params", +begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:m, +contains:["self",r,f,e.C_BLOCK_COMMENT_MODE,c,d]}]},{scope:"class",variants:[{ +beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait", +illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{ +beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{ +beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/, +contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{ +beginKeywords:"use",relevance:0,end:";",contains:[{ +match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},c,d]} +},grmr_php_template:e=>({name:"PHP template",subLanguage:"xml",contains:[{ +begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*", +end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0 +},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null, +skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null, +contains:null,skip:!0})]}]}),grmr_plaintext:e=>({name:"Plain text", +aliases:["text","txt"],disableAutodetect:!0}),grmr_python:e=>{ +const n=e.regex,t=/[\p{XID_Start}_]\p{XID_Continue}*/u,a=["and","as","assert","async","await","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],i={ +$pattern:/[A-Za-z]\w+|__\w+__/,keyword:a, +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"] +},r={className:"meta",begin:/^(>>>|\.\.\.) /},s={className:"subst",begin:/\{/, +end:/\}/,keywords:i,illegal:/#/},o={begin:/\{\{/,relevance:0},l={ +className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{ +begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/, +contains:[e.BACKSLASH_ESCAPE,r],relevance:10},{ +begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/, +contains:[e.BACKSLASH_ESCAPE,r],relevance:10},{ +begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/, +contains:[e.BACKSLASH_ESCAPE,r,o,s]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/, +end:/"""/,contains:[e.BACKSLASH_ESCAPE,r,o,s]},{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,o,s]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/, +contains:[e.BACKSLASH_ESCAPE,o,s]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE] +},c="[0-9](_?[0-9])*",d=`(\\b(${c}))?\\.(${c})|\\b(${c})\\.`,g="\\b|"+a.join("|"),u={ +className:"number",relevance:0,variants:[{ +begin:`(\\b(${c})|(${d}))[eE][+-]?(${c})[jJ]?(?=${g})`},{begin:`(${d})[jJ]?`},{ +begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${g})`},{ +begin:`\\b0[bB](_?[01])+[lL]?(?=${g})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${g})` +},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${g})`},{begin:`\\b(${c})[jJ](?=${g})` +}]},b={className:"comment",begin:n.lookahead(/# type:/),end:/$/,keywords:i, +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:i, +contains:["self",r,u,l,e.HASH_COMMENT_MODE]}]};return s.contains=[l,u,r],{ +name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:i, +illegal:/(<\/|->|\?)|=>/,contains:[r,u,{begin:/\bself\b/},{beginKeywords:"if", +relevance:0},l,b,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,t],scope:{ +1:"keyword",3:"title.function"},contains:[m]},{variants:[{ +match:[/\bclass/,/\s+/,t,/\s*/,/\(\s*/,t,/\s*\)/]},{match:[/\bclass/,/\s+/,t]}], +scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{ +className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[u,m,l]}]}}, +grmr_python_repl:e=>({aliases:["pycon"],contains:[{className:"meta.prompt", +starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{ +begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}),grmr_r:e=>{ +const n=e.regex,t=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,a=n.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,r=n.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/) +;return{name:"R",keywords:{$pattern:t, +keyword:"function if in break next repeat else for while", +literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10", +built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm" +},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/, +starts:{end:n.lookahead(n.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)), +endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{ +scope:"variable",variants:[{match:t},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0 +}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}] +}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE], +variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/ +}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/ +}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/ +}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/ +}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/ +}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"', +relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{ +1:"operator",2:"number"},match:[i,a]},{scope:{1:"operator",2:"number"}, +match:[/%[^%]*%/,a]},{scope:{1:"punctuation",2:"number"},match:[r,a]},{scope:{ +2:"number"},match:[/[^a-zA-Z0-9._]|^/,a]}]},{scope:{3:"operator"}, +match:[t,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{ +match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:r},{begin:"`",end:"`", +contains:[{begin:/\\./}]}]}},grmr_ruby:e=>{ +const n=e.regex,t="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",a=n.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=n.concat(a,/(::\w+)*/),r={ +"variable.constant":["__FILE__","__LINE__"], +"variable.language":["self","super"], +keyword:["alias","and","attr_accessor","attr_reader","attr_writer","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","include","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield"], +built_in:["proc","lambda"],literal:["true","false","nil"]},s={ +className:"doctag",begin:"@[A-Za-z]+"},o={begin:"#<",end:">" +},l=[e.COMMENT("#","$",{contains:[s]}),e.COMMENT("^=begin","^=end",{ +contains:[s],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],c={ +className:"subst",begin:/#\{/,end:/\}/,keywords:r},d={className:"string", +contains:[e.BACKSLASH_ESCAPE,c],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/ +},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/, +end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{ +begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/, +end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{ +begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{ +begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{ +begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{ +begin:n.concat(/<<[-~]?'?/,n.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)), +contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/, +contains:[e.BACKSLASH_ESCAPE,c]})]}]},g="[0-9](_?[0-9])*",u={className:"number", +relevance:0,variants:[{ +begin:`\\b([1-9](_?[0-9])*|0)(\\.(${g}))?([eE][+-]?(${g})|r)?i?\\b`},{ +begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b" +},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{ +begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{ +begin:"\\b0(_?[0-7])+r?i?\\b"}]},b={variants:[{match:/\(\)/},{ +className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0, +keywords:r}]},m=[d,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{ +match:[/class\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"}, +keywords:r},{relevance:0,match:[i,/\.new[ (]/],scope:{1:"title.class"}},{ +relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{ +match:[/def/,/\s+/,t],scope:{1:"keyword",3:"title.function"},contains:[b]},{ +begin:e.IDENT_RE+"::"},{className:"symbol", +begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol", +begin:":(?!\\s)",contains:[d,{begin:t}],relevance:0},u,{className:"variable", +begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{ +className:"params",begin:/\|/,end:/\|/,excludeBegin:!0,excludeEnd:!0, +relevance:0,keywords:r},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*", +keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,c], +illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{ +begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[", +end:"\\][a-z]*"}]}].concat(o,l),relevance:0}].concat(o,l) +;c.contains=m,b.contains=m;const p=[{begin:/^\s*=>/,starts:{end:"$",contains:m} +},{className:"meta.prompt", +begin:"^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]|(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>)(?=[ ])", +starts:{end:"$",keywords:r,contains:m}}];return l.unshift(o),{name:"Ruby", +aliases:["rb","gemspec","podspec","thor","irb"],keywords:r,illegal:/\/\*/, +contains:[e.SHEBANG({binary:"ruby"})].concat(p).concat(l).concat(m)}}, +grmr_rust:e=>{const n=e.regex,t={className:"title.function.invoke",relevance:0, +begin:n.concat(/\b/,/(?!let\b)/,e.IDENT_RE,n.lookahead(/\s*\(/)) +},a="([ui](8|16|32|64|128|size)|f(32|64))?",i=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","panic!","file!","format!","format_args!","include_bin!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"] +;return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?", +type:["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"], +keyword:["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","unsafe","unsized","use","virtual","where","while","yield"], +literal:["true","false","Some","None","Ok","Err"],built_in:i},illegal:""},t]}}, +grmr_scss:e=>{const n=te(e),t=se,a=re,i="@[a-z-]+",r={className:"variable", +begin:"(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b",relevance:0};return{name:"SCSS", +case_insensitive:!0,illegal:"[=/|']", +contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,n.CSS_NUMBER_MODE,{ +className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{ +className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0 +},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag", +begin:"\\b("+ae.join("|")+")\\b",relevance:0},{className:"selector-pseudo", +begin:":("+a.join("|")+")"},{className:"selector-pseudo", +begin:":(:)?("+t.join("|")+")"},r,{begin:/\(/,end:/\)/, +contains:[n.CSS_NUMBER_MODE]},n.CSS_VARIABLE,{className:"attribute", +begin:"\\b("+oe.join("|")+")\\b"},{ +begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b" +},{begin:/:/,end:/[;}{]/, +contains:[n.BLOCK_COMMENT,r,n.HEXCOLOR,n.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,n.IMPORTANT] +},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{ +begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/, +keyword:"and or not only",attribute:ie.join(" ")},contains:[{begin:i, +className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute" +},r,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,n.HEXCOLOR,n.CSS_NUMBER_MODE] +},n.FUNCTION_DISPATCH]}},grmr_shell:e=>({name:"Shell Session", +aliases:["console","shellsession"],contains:[{className:"meta.prompt", +begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/, +subLanguage:"bash"}}]}),grmr_sql:e=>{ +const n=e.regex,t=e.COMMENT("--","$"),a=["true","false","unknown"],i=["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"],r=["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=r,l=["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=>!r.includes(e))),c={ +begin:n.concat(/\b/,n.either(...o),/\s*\(/),relevance:0,keywords:{built_in:o}} +;return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{ +$pattern:/\b[\w\.]+/,keyword:((e,{exceptions:n,when:t}={})=>{const a=t +;return n=n||[],e.map((e=>e.match(/\|\d+$/)||n.includes(e)?e:a(e)?e+"|0":e)) +})(l,{when:e=>e.length<3}),literal:a,type:i, +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:n.either(...s),relevance:0,keywords:{$pattern:/[\w\.]+/, +keyword:l.concat(s),literal:a,type:i}},{className:"type", +begin:n.either("double precision","large object","with timezone","without timezone") +},c,{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}]}}, +grmr_swift:e=>{const n={match:/\s+/,relevance:0},t=e.COMMENT("/\\*","\\*/",{ +contains:["self"]}),a=[e.C_LINE_COMMENT_MODE,t],i={match:[/\./,p(...ve,...ke)], +className:{2:"keyword"}},r={match:m(/\./,p(...xe)),relevance:0 +},s=xe.filter((e=>"string"==typeof e)).concat(["_|0"]),o={variants:[{ +className:"keyword", +match:p(...xe.filter((e=>"string"!=typeof e)).concat(Oe).map(Ne),...ke)}]},l={ +$pattern:p(/\b\w+/,/#\w+/),keyword:s.concat(Ae),literal:Me},c=[i,r,o],d=[{ +match:m(/\./,p(...Ce)),relevance:0},{className:"built_in", +match:m(/\b/,p(...Ce),/(?=\()/)}],u={match:/->/,relevance:0},b=[u,{ +className:"operator",relevance:0,variants:[{match:De},{match:`\\.(\\.|${Re})+`}] +}],_="([0-9a-fA-F]_*)+",h={className:"number",relevance:0,variants:[{ +match:"\\b(([0-9]_*)+)(\\.(([0-9]_*)+))?([eE][+-]?(([0-9]_*)+))?\\b"},{ +match:`\\b0x(${_})(\\.(${_}))?([pP][+-]?(([0-9]_*)+))?\\b`},{ +match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},f=(e="")=>({ +className:"subst",variants:[{match:m(/\\/,e,/[0\\tnr"']/)},{ +match:m(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),E=(e="")=>({className:"subst", +match:m(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/)}),y=(e="")=>({className:"subst", +label:"interpol",begin:m(/\\/,e,/\(/),end:/\)/}),w=(e="")=>({begin:m(e,/"""/), +end:m(/"""/,e),contains:[f(e),E(e),y(e)]}),N=(e="")=>({begin:m(e,/"/), +end:m(/"/,e),contains:[f(e),y(e)]}),v={className:"string", +variants:[w(),w("#"),w("##"),w("###"),N(),N("#"),N("##"),N("###")]},k={ +match:m(/`/,Be,/`/)},O=[k,{className:"variable",match:/\$\d+/},{ +className:"variable",match:`\\$${Le}+`}],x=[{match:/(@|#(un)?)available/, +className:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:Fe, +contains:[...b,h,v]}]}},{className:"keyword",match:m(/@/,p(...ze))},{ +className:"meta",match:m(/@/,Be)}],M={match:g(/\b[A-Z]/),relevance:0,contains:[{ +className:"type", +match:m(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Le,"+") +},{className:"type",match:$e,relevance:0},{match:/[?!]+/,relevance:0},{ +match:/\.\.\./,relevance:0},{match:m(/\s+&\s+/,g($e)),relevance:0}]},S={ +begin://,keywords:l,contains:[...a,...c,...x,u,M]};M.contains.push(S) +;const A={begin:/\(/,end:/\)/,relevance:0,keywords:l,contains:["self",{ +match:m(Be,/\s*:/),keywords:"_|0",relevance:0 +},...a,...c,...d,...b,h,v,...O,...x,M]},C={begin://,contains:[...a,M] +},T={begin:/\(/,end:/\)/,keywords:l,contains:[{ +begin:p(g(m(Be,/\s*:/)),g(m(Be,/\s+/,Be,/\s*:/))),end:/:/,relevance:0, +contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Be}] +},...a,...c,...b,h,v,...x,M,A],endsParent:!0,illegal:/["']/},R={ +match:[/func/,/\s+/,p(k.match,Be,De)],className:{1:"keyword",3:"title.function" +},contains:[C,T,n],illegal:[/\[/,/%/]},D={ +match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"}, +contains:[C,T,n],illegal:/\[|%/},I={match:[/operator/,/\s+/,De],className:{ +1:"keyword",3:"title"}},L={begin:[/precedencegroup/,/\s+/,$e],className:{ +1:"keyword",3:"title"},contains:[M],keywords:[...Se,...Me],end:/}/} +;for(const e of v.variants){const n=e.contains.find((e=>"interpol"===e.label)) +;n.keywords=l;const t=[...c,...d,...b,h,v,...O];n.contains=[...t,{begin:/\(/, +end:/\)/,contains:["self",...t]}]}return{name:"Swift",keywords:l, +contains:[...a,R,D,{beginKeywords:"struct protocol class extension enum actor", +end:"\\{",excludeEnd:!0,keywords:l,contains:[e.inherit(e.TITLE_MODE,{ +className:"title.class",begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...c] +},I,L,{beginKeywords:"import",end:/$/,contains:[...a],relevance:0 +},...c,...d,...b,h,v,...O,...x,M,A]}},grmr_typescript:e=>{ +const n=we(e),t=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],a={ +beginKeywords:"namespace",end:/\{/,excludeEnd:!0, +contains:[n.exports.CLASS_REFERENCE]},i={beginKeywords:"interface",end:/\{/, +excludeEnd:!0,keywords:{keyword:"interface extends",built_in:t}, +contains:[n.exports.CLASS_REFERENCE]},r={$pattern:be, +keyword:me.concat(["type","namespace","interface","public","private","protected","implements","declare","abstract","readonly","enum","override"]), +literal:pe,built_in:ye.concat(t),"variable.language":Ee},s={className:"meta", +begin:"@[A-Za-z$_][0-9A-Za-z$_]*"},o=(e,n,t)=>{ +const a=e.contains.findIndex((e=>e.label===n)) +;if(-1===a)throw Error("can not find mode to replace");e.contains.splice(a,1,t)} +;return Object.assign(n.keywords,r), +n.exports.PARAMS_CONTAINS.push(s),n.contains=n.contains.concat([s,a,i]), +o(n,"shebang",e.SHEBANG()),o(n,"use_strict",{className:"meta",relevance:10, +begin:/^\s*['"]use strict['"]/ +}),n.contains.find((e=>"func.def"===e.label)).relevance=0,Object.assign(n,{ +name:"TypeScript",aliases:["ts","tsx"]}),n},grmr_vbnet:e=>{ +const n=e.regex,t=/\d{1,2}\/\d{1,2}\/\d{4}/,a=/\d{4}-\d{1,2}-\d{1,2}/,i=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,r=/\d{1,2}(:\d{1,2}){1,2}/,s={ +className:"literal",variants:[{begin:n.concat(/# */,n.either(a,t),/ *#/)},{ +begin:n.concat(/# */,r,/ *#/)},{begin:n.concat(/# */,i,/ *#/)},{ +begin:n.concat(/# */,n.either(a,t),/ +/,n.either(i,r),/ *#/)}] +},o=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}] +}),l=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]}) +;return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0, +classNameAliases:{label:"symbol"},keywords:{ +keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield", +built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort", +type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort", +literal:"true false nothing"}, +illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[{ +className:"string",begin:/"(""|[^/n])"C\b/},{className:"string",begin:/"/, +end:/"/,illegal:/\n/,contains:[{begin:/""/}]},s,{className:"number",relevance:0, +variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/ +},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{ +begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},{ +className:"label",begin:/^\w+:/},o,l,{className:"meta", +begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/, +end:/$/,keywords:{ +keyword:"const disable else elseif enable end externalsource if region then"}, +contains:[l]}]}},grmr_yaml:e=>{ +const n="true false yes no null",t="[\\w#;/?:@&=+$,.~*'()[\\]]+",a={ +className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/ +},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,{className:"template-variable", +variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]}]},i=e.inherit(a,{ +variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),r={ +end:",",endsWithParent:!0,excludeEnd:!0,keywords:n,relevance:0},s={begin:/\{/, +end:/\}/,contains:[r],illegal:"\\n",relevance:0},o={begin:"\\[",end:"\\]", +contains:[r],illegal:"\\n",relevance:0},l=[{className:"attr",variants:[{ +begin:"\\w[\\w :\\/.-]*:(?=[ \t]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ \t]|$)'},{ +begin:"'\\w[\\w :\\/.-]*':(?=[ \t]|$)"}]},{className:"meta",begin:"^---\\s*$", +relevance:10},{className:"string", +begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{ +begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0, +relevance:0},{className:"type",begin:"!\\w+!"+t},{className:"type", +begin:"!<"+t+">"},{className:"type",begin:"!"+t},{className:"type",begin:"!!"+t +},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta", +begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)", +relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:n,keywords:{literal:n}},{ +className:"number", +begin:"\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b" +},{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},s,o,a],c=[...l] +;return c.pop(),c.push(i),r.contains=c,{name:"YAML",case_insensitive:!0, +aliases:["yml"],contains:l}}});const je=ne;for(const e of Object.keys(Ue)){ +const n=e.replace("grmr_","").replace("_","-");je.registerLanguage(n,Ue[e])} +return je}() +;"object"==typeof exports&&"undefined"!=typeof module&&(module.exports=hljs); \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..d17e86a --- /dev/null +++ b/index.html @@ -0,0 +1,121 @@ + + + + + + + Welcome - CSL_Chinese + + + + + + + + + + + + + + +
+ + +
+

Welcome

+

欢迎来到 CSL 的中文文档,本文档使用 Julialang 的 Books.jl 包构建,参考了 Julia data science 项目。

+

Welcome! This is an open source and open access book on how to do Data Science using Julia. Our target audience are researchers from all fields of applied sciences. Of course, we hope to be useful for industry too. You can navigate through the pages of the ebook by using the arrow keys (left/right) on your keyboard.

+

The book is also available as PDF.

+

The source code is available at GitHub.

+ + +
+ +
+ + +
+
+
+ CC BY-NC-SA 4.0 + Mao Zhou +
+
+
+ + \ No newline at end of file diff --git a/julia.min.js b/julia.min.js new file mode 100644 index 0000000..7314a4c --- /dev/null +++ b/julia.min.js @@ -0,0 +1,18 @@ +/*! `julia` grammar compiled for Highlight.js 11.5.0 */ +(()=>{var e=(()=>{"use strict";return e=>{ +const r="[A-Za-z_\\u00A1-\\uFFFF][A-Za-z_0-9\\u00A1-\\uFFFF]*",t={$pattern:r, +keyword:["baremodule","begin","break","catch","ccall","const","continue","do","else","elseif","end","export","false","finally","for","function","global","if","import","in","isa","let","local","macro","module","quote","return","true","try","using","where","while"], +literal:["ARGS","C_NULL","DEPOT_PATH","ENDIAN_BOM","ENV","Inf","Inf16","Inf32","Inf64","InsertionSort","LOAD_PATH","MergeSort","NaN","NaN16","NaN32","NaN64","PROGRAM_FILE","QuickSort","RoundDown","RoundFromZero","RoundNearest","RoundNearestTiesAway","RoundNearestTiesUp","RoundToZero","RoundUp","VERSION|0","devnull","false","im","missing","nothing","pi","stderr","stdin","stdout","true","undef","\u03c0","\u212f"], +built_in:["AbstractArray","AbstractChannel","AbstractChar","AbstractDict","AbstractDisplay","AbstractFloat","AbstractIrrational","AbstractMatrix","AbstractRange","AbstractSet","AbstractString","AbstractUnitRange","AbstractVecOrMat","AbstractVector","Any","ArgumentError","Array","AssertionError","BigFloat","BigInt","BitArray","BitMatrix","BitSet","BitVector","Bool","BoundsError","CapturedException","CartesianIndex","CartesianIndices","Cchar","Cdouble","Cfloat","Channel","Char","Cint","Cintmax_t","Clong","Clonglong","Cmd","Colon","Complex","ComplexF16","ComplexF32","ComplexF64","CompositeException","Condition","Cptrdiff_t","Cshort","Csize_t","Cssize_t","Cstring","Cuchar","Cuint","Cuintmax_t","Culong","Culonglong","Cushort","Cvoid","Cwchar_t","Cwstring","DataType","DenseArray","DenseMatrix","DenseVecOrMat","DenseVector","Dict","DimensionMismatch","Dims","DivideError","DomainError","EOFError","Enum","ErrorException","Exception","ExponentialBackOff","Expr","Float16","Float32","Float64","Function","GlobalRef","HTML","IO","IOBuffer","IOContext","IOStream","IdDict","IndexCartesian","IndexLinear","IndexStyle","InexactError","InitError","Int","Int128","Int16","Int32","Int64","Int8","Integer","InterruptException","InvalidStateException","Irrational","KeyError","LinRange","LineNumberNode","LinearIndices","LoadError","MIME","Matrix","Method","MethodError","Missing","MissingException","Module","NTuple","NamedTuple","Nothing","Number","OrdinalRange","OutOfMemoryError","OverflowError","Pair","PartialQuickSort","PermutedDimsArray","Pipe","ProcessFailedException","Ptr","QuoteNode","Rational","RawFD","ReadOnlyMemoryError","Real","ReentrantLock","Ref","Regex","RegexMatch","RoundingMode","SegmentationFault","Set","Signed","Some","StackOverflowError","StepRange","StepRangeLen","StridedArray","StridedMatrix","StridedVecOrMat","StridedVector","String","StringIndexError","SubArray","SubString","SubstitutionString","Symbol","SystemError","Task","TaskFailedException","Text","TextDisplay","Timer","Tuple","Type","TypeError","TypeVar","UInt","UInt128","UInt16","UInt32","UInt64","UInt8","UndefInitializer","UndefKeywordError","UndefRefError","UndefVarError","Union","UnionAll","UnitRange","Unsigned","Val","Vararg","VecElement","VecOrMat","Vector","VersionNumber","WeakKeyDict","WeakRef"] +},n={keywords:t,illegal:/<\//},a={className:"subst",begin:/\$\(/,end:/\)/, +keywords:t},i={className:"variable",begin:"\\$"+r},o={className:"string", +contains:[e.BACKSLASH_ESCAPE,a,i],variants:[{begin:/\w*"""/,end:/"""\w*/, +relevance:10},{begin:/\w*"/,end:/"\w*/}]},s={className:"string", +contains:[e.BACKSLASH_ESCAPE,a,i],begin:"`",end:"`"},l={className:"meta", +begin:"@"+r};return n.name="Julia",n.contains=[{className:"number", +begin:/(\b0x[\d_]*(\.[\d_]*)?|0x\.\d[\d_]*)p[-+]?\d+|\b0[box][a-fA-F0-9][a-fA-F0-9_]*|(\b\d[\d_]*(\.[\d_]*)?|\.\d[\d_]*)([eEfF][-+]?\d+)?/, +relevance:0},{className:"string",begin:/'(.|\\[xXuU][a-zA-Z0-9]+)'/},o,s,l,{ +className:"comment",variants:[{begin:"#=",end:"=#",relevance:10},{begin:"#", +end:"$"}]},e.HASH_COMMENT_MODE,{className:"keyword", +begin:"\\b(((abstract|primitive)\\s+)type|(mutable\\s+)?struct)\\b"},{begin:/<:/ +}],a.contains=n.contains,n}})();hljs.registerLanguage("julia",e)})(); \ No newline at end of file diff --git a/locale-file.html b/locale-file.html new file mode 100644 index 0000000..a500cdf --- /dev/null +++ b/locale-file.html @@ -0,0 +1,117 @@ + + + + + + + Locale File - CSL_Chinese + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git "a/locale-files\346\234\254\345\234\260\345\214\226\346\226\207\344\273\266.html" "b/locale-files\346\234\254\345\234\260\345\214\226\346\226\207\344\273\266.html" new file mode 100644 index 0000000..d83fbcc --- /dev/null +++ "b/locale-files\346\234\254\345\234\260\345\214\226\346\226\207\344\273\266.html" @@ -0,0 +1,203 @@ + + + + + + + Locale Files(本地化文件) - CSL_Chinese + + + + + + + + + + + + + + +
+ + +
+

3.7 Locale Files(本地化文件)

+

尽管本地化数据可以包括在 csl 文件中(见Locale),但是本地化文件可以方便的提供本地化数据的设置,包括术语,日期格式以及语法选项。

+

每个本地化文件包括了一种语言方言的本地化数据。本地化文件中根元素为cs:locale(样式/style中则为cs:style元素)。在cs:locale根元素中,属性xml:lang用来设置方言。同时这一设置选项也用来对本地化文件命名("xx-XX"文件名为locales-xx-XX.xml)。此外,根元素必须携带version属性,表明本地化文件的 CSL 版本(对 CSL 1.0 兼容的 locale file 必须设置为"1.0")。本地化文件有和样式同样的命名空间。cs:locale元素可能包含cs:info作为第一个子元素,同时,必须含有cs:termscs:datecs:style-options子元素。下面是一个 本地化文件的部分示例:

+
<?xml version="1.0" encoding="UTF-8"?>
+<locale xml:lang="en-US" version="1.0" xmlns="http://purl.org/net/xbiblio/csl">
+  <style-options punctuation-in-quote="true"/>
+  <date form="text">
+    <date-part name="month" suffix=" "/>
+    <date-part name="day" suffix=", "/>
+    <date-part name="year"/>
+  </date>
+  <date form="numeric">
+    <date-part name="year"/>
+    <date-part name="month" form="numeric" prefix="-" range-delimiter="/"/>
+    <date-part name="day" prefix="-" range-delimiter="/"/>
+  </date>
+  <terms>
+    <term name="no date">n.d.</term>
+    <term name="et-al">et al.</term>
+    <term name="page">
+      <single>page</single>
+      <multiple>pages</multiple>
+    </term>
+    <term name="page" form="short">
+      <single>p.</single>
+      <multiple>pp.</multiple>
+    </term>
+  </terms>
+</locale>
+

3.7.1 Info

+

cs:info元素用来给出本地化文件的元数据。它含有以下子元素:

+

cs:translator(可选)

+

cs:translator用来致谢翻译者,并且能使用多次。在这个元素中。子元素cs:name必须出现一次,cs:uri则是可选的。这些子元素应该分别包括翻译者的名字,地址和 URI。(与样式中类似)

+

cs:rights(可选)

+

​ 可能出现一次。cs:rights的内容用来指定本地化文件发布版本的 license。该元素可能会携带license属性来指定license的 URI,xml:lang属性则用来指定元素内容的语言(值必须是xsd:language locale code)。

+

cs:updates(可选)

+

cs:updated元素的内容必须是一个时间戳来指定本地化文件最后一次更新的时间。

+

3.7.2 Terms(术语)

+

术语是本地化的字符串,比如通过使用"and"术语,"Doe and Smith"在语言环境从英语到德语的转换中会自动变为"Doe und Smith"。术语用cs:term元素定义,是cs:terms元素的子元素。每个cs:term元素必须携带一个name属性,其属性值可以设置为附录II 术语列表中的值。

+

术语可以直接在cs:term的内容中定义,或者,在某些情况下,比如在需要单数和复数的情况下可以分别在子元素cs:singlecs:multiple中定义, (例如:"page""pages")。

+

术语必须使用cs:term元素来定义,并在其中使用form属性来设置特定格式,form可以设置的值为:

+
    +
  • "long" - (默认值), e.g. “editor” and “editors” for the “editor” term

  • +
  • "short" - e.g. “ed.” and “eds.” for the term “editor”

  • +
  • "verb" - e.g. “edited by” for the term “editor”

  • +
  • "verb-short" - e.g. “ed.” for the term “editor”

  • +
  • "symbol" - e.g. “§” and “§§” for the term “section”

  • +
+

如果一个样式使用了一个没有定义的格式,则会会退到其他形式,比如 "werb-short"会回退到"verb""symbol"会回退到"short""verb""short"都会回退到"long"。如果没有可以用的语言环境或者 form 格式,改术语的渲染结果就会显示为空字符串。

+

cs:term元素可以使用matchgendergender-form属性来设置数字变量渲染为序数(比如,first2nd)。具体见下面的序数后缀特定序数

+

术语内容不应该包括 Latex 以及 HTML 等标记。上标可以使用 Unicode 上标字符。

+

3.7.2.1 序数后缀

+

数字变量可以使用cs:number元素以"ordinal"格式(即序数格式)渲染,比如:2nd。序数的后缀则是使用术语来定义的。

+

"ordinal"术语定义了默认的序数后缀格式,但这些默认的后缀可以被下面的术语对某些数字进行覆盖:

+
    +
  • "ordinal-00""ordinal-09" - 默认地,当术语名称的最后一位数字与要渲染的数字的最后一个数字相同时,将使用在这个范围内的对应的术语。比如:"ordinal-00" 能够匹配数字 0 、10、20 等等。通过设置属性match"last-two-difits"(默认值为"last-digit"),匹配范围将为变为两位,例如:0、100、200等。当match术语设置为"whole-number"时,只有术语与要渲染的数字相同时,才会实现匹配。
  • +
  • "ordinal-10""ordinal-99"- 默认地,当要渲染的数字的最后两位和术语中相同时,使用这个范围的术语。当match属性设置为"whole-number"时(默认为"last-two-digits"),只有术语与要渲染的数字相同时,才会实现匹配。
  • +
+

当渲染的数据对上面的两组都匹配时(比如:13 可以同时匹配 "ordinal-03""ordinal-13"),则使用"ordinal-10""ordinal-99"

+

序数术语在 CSL 1.0.1 和 CSL 1.0 中表现时不同的。当样式和本地化文件中都没有定义"ordinal"术语,但是定义了"ordinal-00""ordinal-04",原始的 CSL 1.0 的方案被使用,"ordinal-01"用于以1结尾的数字(以11结尾的数字除外)," ordinal-02"用于以2结尾的数字(以12结尾的数字除外),"ordinal -03"表示以3结尾(那些以13结尾的除外),"ordinal-04"表示所有其他数字。

+

3.7.2.2 性别特定序数

+

一些语言使用特定的有别于性别的序数。例如,如果目标名词是男性,英语中的 “1st” 和 “first” 在法语中就翻译为 “1er” 和 “premier”,如果目标名词是女性,就翻译为 “1re” 和 “première”。

+

女性和男性在术语使用上的不同可以使用性别格式gender-form的属性来设置(分别设置为femininemasculine),详情见Ordinals序数(没有性别的术语表示中性)。这里涉及到两类目标名词:a) 数字变量附带的术语,b)月份术语(见Months/月)。在术语设置为"long"(默认),并且在gender属性被设置时(设置为"feminine""masculine"),这些名词即使用相应的性别变体。当数字变量以序数"ordinal"或者long-ordinal形式时,将使用相同性别的序数词,如果没定义女性或男性变体,则使用中性变体。当"day"日期部分以序数"ordinal"形式呈现时,序数性别和月的术语匹配。

+

下面给出1re éd."1st ed.")、"1er janvier""January 1st")和"3e édition""3rd edition")的示例:

+
<?xml version="1.0" encoding="UTF-8"?>
+<locale xml:lang="fr-FR">
+  <terms>
+    <term name="edition" gender="feminine">
+      <single>édition</single>
+      <multiple>éditions</multiple>
+    </term>
+    <term name="edition" form="short">éd.</term>
+    <term name="month-01" gender="masculine">janvier</term>
+    <term name="ordinal">e</term>
+    <term name="ordinal-01" gender-form="feminine" match="whole-number">re</term>
+    <term name="ordinal-01" gender-form="masculine" match="whole-number">er</term>
+  </terms>
+</locale>
+

3.7.3 本地化日期格式

+

cs:date元素中,本地化数据格式有两种格式:一种是"numeric"(例:12-15-2005),另外一种是 "text"(例:December 15,2005)。格式在cs:date元素中,使用form属性来设置。

+

日期格式使用cs:date-part子元素来构建(见Date-part)。当cs:date-partname属性设置为"day""month"、或"year"时,反应了日期显示的顺序为日、月河年。日期可以使用cs:datecs:date-part元素中的formattingtext-case属性设置。cs:date元素中的delimiter属性用来设置cs:date-part中不同部分的间隔,并且词缀也可以应用于cs:date-part元素。(译注:这里的词缀指的是前后的括号等等。)

+

:定义本地化日期格式时,不允许在cs:date上使用词缀。此限制适用于将特定于语言环境的词缀(在cs:date-part元素上设置)与任何特定于样式的词缀(在调用cs:date元素上设置)分开,例如括号:

+
<macro name="issued">
+ <date variable="issued" form="numeric" prefix="(" suffix=")"/>
+</macro>
+

3.7.4 本地化选项

+

本地化选项有两个,limit-day-ordinals-to-day-1punctuation-in-quote (见Locale Options)。这些全局选项(同时影响引文和参考文献条目)在cs:style-options中被设置为可选属性。

+ + +
+ +
+ + +
+
+
+ CC BY-NC-SA 4.0 + Mao Zhou +
+
+
+ + \ No newline at end of file diff --git a/mousetrap.min.js b/mousetrap.min.js new file mode 100644 index 0000000..185c42f --- /dev/null +++ b/mousetrap.min.js @@ -0,0 +1,11 @@ +/* mousetrap v1.6.5 craig.is/killing/mice */ +(function(q,u,c){function v(a,b,g){a.addEventListener?a.addEventListener(b,g,!1):a.attachEvent("on"+b,g)}function z(a){if("keypress"==a.type){var b=String.fromCharCode(a.which);a.shiftKey||(b=b.toLowerCase());return b}return n[a.which]?n[a.which]:r[a.which]?r[a.which]:String.fromCharCode(a.which).toLowerCase()}function F(a){var b=[];a.shiftKey&&b.push("shift");a.altKey&&b.push("alt");a.ctrlKey&&b.push("ctrl");a.metaKey&&b.push("meta");return b}function w(a){return"shift"==a||"ctrl"==a||"alt"==a|| +"meta"==a}function A(a,b){var g,d=[];var e=a;"+"===e?e=["+"]:(e=e.replace(/\+{2}/g,"+plus"),e=e.split("+"));for(g=0;gc||n.hasOwnProperty(c)&&(p[n[c]]=c)}g=p[e]?"keydown":"keypress"}"keypress"==g&&d.length&&(g="keydown");return{key:m,modifiers:d,action:g}}function D(a,b){return null===a||a===u?!1:a===b?!0:D(a.parentNode,b)}function d(a){function b(a){a= +a||{};var b=!1,l;for(l in p)a[l]?b=!0:p[l]=0;b||(x=!1)}function g(a,b,t,f,g,d){var l,E=[],h=t.type;if(!k._callbacks[a])return[];"keyup"==h&&w(a)&&(b=[a]);for(l=0;l":".","?":"/","|":"\\"},B={option:"alt",command:"meta","return":"enter", +escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},p;for(c=1;20>c;++c)n[111+c]="f"+c;for(c=0;9>=c;++c)n[c+96]=c.toString();d.prototype.bind=function(a,b,c){a=a instanceof Array?a:[a];this._bindMultiple.call(this,a,b,c);return this};d.prototype.unbind=function(a,b){return this.bind.call(this,a,function(){},b)};d.prototype.trigger=function(a,b){if(this._directMap[a+":"+b])this._directMap[a+":"+b]({},a);return this};d.prototype.reset=function(){this._callbacks={}; +this._directMap={};return this};d.prototype.stopCallback=function(a,b){if(-1<(" "+b.className+" ").indexOf(" mousetrap ")||D(b,this.target))return!1;if("composedPath"in a&&"function"===typeof a.composedPath){var c=a.composedPath()[0];c!==a.target&&(b=c)}return"INPUT"==b.tagName||"SELECT"==b.tagName||"TEXTAREA"==b.tagName||b.isContentEditable};d.prototype.handleKey=function(){return this._handleKey.apply(this,arguments)};d.addKeycodes=function(a){for(var b in a)a.hasOwnProperty(b)&&(n[b]=a[b]);p=null}; +d.init=function(){var a=d(u),b;for(b in a)"_"!==b.charAt(0)&&(d[b]=function(b){return function(){return a[b].apply(a,arguments)}}(b))};d.init();q.Mousetrap=d;"undefined"!==typeof module&&module.exports&&(module.exports=d);"function"===typeof define&&define.amd&&define(function(){return d})}})("undefined"!==typeof window?window:null,"undefined"!==typeof window?document:null); diff --git a/section.html b/section.html new file mode 100644 index 0000000..3faf27d --- /dev/null +++ b/section.html @@ -0,0 +1,117 @@ + + + + + + + - CSL_Chinese + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/style.css b/style.css new file mode 100644 index 0000000..7744643 --- /dev/null +++ b/style.css @@ -0,0 +1,496 @@ +:root { + --black: hsl(0, 0%, 15%); + --gray: hsl(0, 0%, 40%); + --accent: #3D93F6; + --normal-size: 19px; + --small-size: 14px; + --tiny-size: 11px; + --block-background: hsl(0, 0%, 96%); + --output-background: hsl(120, 100%, 94%); + --menu-width: 224px; + --max-body-width: 960px; + --content-left-margin: 62px; +} + +.menu-level-2 { + margin-left: 1.2rem; +} + +.bottom-nav { + color: var(--gray); + margin-top: 2em; + font-size: var(--small-size); +} + +.bottom-nav a { + color: var(--gray) !important; +} + +.bottom-nav .menu-level-2 { + margin-left: 0em; +} + +.books-menu-content { + max-height: 0; + overflow: hidden; + font-size: var(--small-size); +} + +.books-list-module { + display: block; + font-size: var(--tiny-size); + margin: 0 0; + text-align: right; +} + +@media only screen and (min-width: calc(720px)) { + .books-container { + display: flex; + } + + .books-menu { + flex: 0 0 var(--menu-width); + } + + .books-menu label { + display: none !important; + } + + .books-menu-content { + max-height: 100%; + } +} + +.books-title { + display: inline-block; + margin-bottom: 0px; +} + +.books-subtitle { + color: var(--gray); + display: inline-block; + font-style: italic; + margin-bottom: 1.4rem; +} + +.books-menu { + margin-top: 0rem; +} + +.books-menu label { + cursor: pointer; + display:inline-block; + font-size: 32px; + margin-right: 16px; +} + +.books-menu label { +} + +input#menu { + display: none; +} + +.books-menu li { + list-style: none; + margin: 3px 0; +} + +input:checked ~ .books-menu-content { + max-height: 100%; +} + +.books-menu a { + color: var(--gray) !important; +} + +@media only screen and (min-width: 900px) { + .books-content { + margin-left: var(--content-left-margin); + display: flex; + flex-direction: column; + /* If the text is placed too low, users get a scroll bar even for a near empty page. */ + min-height: 92vh; + } +} + +.books-title { + font-size: 1.4rem; + color: var(--gray); +} + +.subtitle { + color: var(--gray); + font-style: italic; + margin-bottom: 50px; +} + +table { + font-size: var(--small-size); + margin-left: auto; + margin-right: auto; +} + +.subfigures { + font-size: var(--small-size); +} + +html { + font-color: var(--black); + font-size: var(--normal-size); + overflow-y: scroll; + -webkit-text-size-adjust: 100%; + -ms-text-size-adjust: 100%; +} + +body { + color: var(--black); + font-family: Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', serif; + font-size: var(--normal-size); + line-height: 1.7; + padding: 1em; + margin-left: auto; + margin-right: auto; + max-width: var(--max-body-width); +} + +a { + color: var(--accent); + text-decoration: none; +} + +/* Source: https://stackoverflow.com/questions/1899772. */ +a[target="_blank"]::after { + content: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAQElEQVR42qXKwQkAIAxDUUdxtO6/RBQkQZvSi8I/pL4BoGw/XPkh4XigPmsUgh0626AjRsgxHTkUThsG2T/sIlzdTsp52kSS1wAAAABJRU5ErkJggg==); + margin: 0 4px 0 5px; +} + +p { + margin: 0.6em 0; +} + +img { + max-width: 100%; + /* Center images without a caption or label. */ + display: block; + margin-left: auto; + margin-right: auto; +} + +h1, h2, h3, h4, h5, h6 { + color: var(--black); + line-height: 125%; + margin-top: 1.5em; + font-weight: normal; +} + +h4, h5, h6 { + font-weight: bold; +} + +h1 { + font-size: 2.5em; + +} + +h2 { + font-size: 2em; +} + +h3 { + font-size: 1.5em; +} + +h4 { + font-size: 1.2em; +} + +h5 { + font-size: 1em; +} + +h6 { + font-size: 0.9em; +} + +blockquote { + color: #666666; + margin: 0; + padding-left: 2em; + border-left: 0.3em #EEE solid; +} + +hr { + display: block; + height: 2px; + border: 0; + border-top: 1px solid #aaa; + border-bottom: 1px solid #eee; + margin: 1em 0; + padding: 0; +} + +pre, code, kbd, samp { + font-family: "JuliaMono-Regular", "SFMono-Regular", "DejaVu Sans Mono"; + font-variant-ligatures: none; + font-size: var(--small-size); + color: #000; + /* Using !important to override github.min.css settings. */ + background: var(--block-background) !important; + margin-top: 0.6em; + margin-bottom: 0.6em; + padding-top: 0.3em; + padding-left: 0.3em; + padding-right: 0.3em; + padding-bottom: 0.3em; + border-radius: 4px; +} + +pre code { + /* Without this, padding is only applied to the first line. */ + display: block; + padding-top: 0px; + padding-bottom: 0px; + margin-top: 0.0em; + margin-bottom: 0.0em; +} + +pre { + white-space: pre; + white-space: pre-wrap; + word-wrap: break-word; + border: 1px solid #dbdbdb; + + overflow-x: scroll; + display: block; + /* Hide the scroll bar if not used. */ + overflow: auto; + white-space: pre; + /* Fine tuned based on max-width. */ + max-width: 640px; + word-wrap: normal; +} + +pre { +} + +pre.output { + background: hsl(0, 0%, 98%) !important; + border: 1px dashed #dbdbdb; +} + +.output code { + background: hsl(0, 0%, 98%) !important; +} + +b, strong { + font-weight: bold; +} + +dfn { + font-style: italic; +} + +ins { + background: #ff9; + color: #000; + text-decoration: none; +} + +mark { + background: #ff0; + color: #000; + font-style: italic; + font-weight: bold; +} + +sub, sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sup { + top: -0.5em; +} + +sub { + bottom: -0.25em; +} + +ul, ol { + margin: 1em 0; + padding: 0 0 0 2em; +} + +li p:last-child { + margin-bottom: 0; +} + +ul ul, ol ol { + margin: .3em 0; +} + +dl { + margin-bottom: 1em; +} + +dt { + font-weight: bold; + margin-bottom: .8em; +} + +dd { + margin: 0 0 .8em 2em; +} + +dd:last-child { + margin-bottom: 0; +} + +figure { + display: block; + text-align: center; + margin: 1em 0; +} + +figure img { + border: none; + /* For detailed images, we need the full width. */ + max-width: 100%; +} + + +figcaption { + font-size: 0.8em; + font-style: italic; + margin: 0 0 .8em; +} + +table { + margin-top: 0.4em; + margin-bottom: 2em; + border-bottom: 1px solid #ddd; + border-right: 1px solid #ddd; + border-spacing: 0; + border-collapse: collapse; +} + +table th { + padding: .2em 1em; + background-color: #eee; + border-top: 1px solid #ddd; + border-left: 1px solid #ddd; +} + +table td { + padding: .2em 1em; + border-top: 1px solid #ddd; + border-left: 1px solid #ddd; + vertical-align: top; +} + +.author { + font-size: 1.2em; + text-align: center; +} + +html { + text-rendering: optimizeLegibility; +} + +@media print { + * { + background: transparent !important; + color: black !important; + filter: none !important; + -ms-filter: none !important; + } + + body { + font-size: 12pt; + max-width: 100%; + } + + a, a:visited { + text-decoration: underline; + } + + hr { + height: 1px; + border: 0; + border-bottom: 1px solid black; + } + + a[href]:after { + content: " (" attr(href) ")"; + } + + abbr[title]:after { + content: " (" attr(title) ")"; + } + + .ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { + content: ""; + } + + pre, blockquote { + border: 1px solid #999; + padding-right: 1em; + page-break-inside: avoid; + } + + tr, img { + page-break-inside: avoid; + } + + img { + max-width: 100% !important; + } + + @page :left { + margin: 15mm 20mm 15mm 10mm; +} + + @page :right { + margin: 15mm 10mm 15mm 20mm; +} + + p, h2, h3 { + orphans: 3; + widows: 3; + } + + h2, h3 { + page-break-after: avoid; + } +} + +.license { + margin-top: auto; + text-align: center; + color: var(--gray); + font-size: var(--small-size); +} + +.csl-entry { + margin-bottom: var(--small-size); +} + +kbd { + border: 1px solid; + border-radius: 6px; + display: inline-block; + line-height: 10px; + padding: 4px 4px; + vertical-align: middle; +} + +.footnotes { + font-size: var(--small-size); +} + +.footnotes ol { + list-style-type: none; +} diff --git a/welcome-1.html b/welcome-1.html new file mode 100644 index 0000000..2361ec4 --- /dev/null +++ b/welcome-1.html @@ -0,0 +1,121 @@ + + + + + + + Welcome - CSL_Chinese + + + + + + + + + + + + + + +
+ + +
+

Welcome

+

欢迎来到 CSL 的中文文档,本文档使用 Julialang 的 Books.jl 包构建,参考了 Julia data science 项目。

+

Welcome! This is an open source and open access book on how to do Data Science using Julia. Our target audience are researchers from all fields of applied sciences. Of course, we hope to be useful for industry too. You can navigate through the pages of the ebook by using the arrow keys (left/right) on your keyboard.

+

The book is also available as PDF.

+

The source code is available at GitHub.

+ + +
+ +
+ + +
+
+
+ CC BY-NC-SA 4.0 + Mao Zhou +
+
+
+ + \ No newline at end of file diff --git "a/xml-\345\243\260\346\230\216.html" "b/xml-\345\243\260\346\230\216.html" new file mode 100644 index 0000000..adf1c9f --- /dev/null +++ "b/xml-\345\243\260\346\230\216.html" @@ -0,0 +1,119 @@ + + + + + + + XML 声明 - CSL_Chinese + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git "a/xml\345\237\272\347\241\200.html" "b/xml\345\237\272\347\241\200.html" new file mode 100644 index 0000000..97e9398 --- /dev/null +++ "b/xml\345\237\272\347\241\200.html" @@ -0,0 +1,130 @@ + + + + + + + XML基础 - CSL_Chinese + + + + + + + + + + + + + + +
+ + +
+

2 XML基础

+
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>  # 文档声明
+
+<!-- 这是一个注释 -->     # 注释
+
+<hello> # 根元素,文档的第一个元素,有且仅有一个
+    # 子元素
+    # 属性
+    # 元素文本
+</hello>
+

上面的代码时一个简单的 XML 结构。为了方便说明使用了#符号作为注释符号,#并不是真正的注释符号, XML 的注释格式为文档中的第二行所示的形式。

+

第一行为声明,或者称为序言,总是在文档的最前面。包括了 XML 的版本、编码信息以及是否依赖外部文档等。这一行代码会告诉解析器或浏览器这个文件应该按照XML规则进行解析。

+

第二行为 XML 文档的注释。格式为<!--注释-->

+

剩下的代码为 XML 文件的根元素,根元素也是元素,根元素是文档的第一个元素,有且仅有一个。

+ + +
+ +
+ + +
+
+
+ CC BY-NC-SA 4.0 + Mao Zhou +
+
+
+ + \ No newline at end of file diff --git "a/\344\273\213\347\273\215.html" "b/\344\273\213\347\273\215.html" new file mode 100644 index 0000000..880621d --- /dev/null +++ "b/\344\273\213\347\273\215.html" @@ -0,0 +1,128 @@ + + + + + + + 介绍 - CSL_Chinese + + + + + + + + + + + + + + +
+ + +
+

3.1 介绍

+

CSL 是一种基于 XML 的格式,用来描述引用的格式,注释和参考文献,提供了

+
    +
  • 一种开放的(开源的)格式

  • +
  • 紧凑并且稳定的格式

  • +
  • 对格式要求的外部支持

  • +
  • 对格式的发布和更新的基本支持

  • +
  • 数千种免费提供 的样式

  • +
+

有关的其他文档,CSL 介绍,样式和本地化文件详见 CSL 项目主页

+

3.1.1 术语

+

关键字 MUST,MUST NOT,REQUIRED,SHALL,SHALL NOT,SHOULD,SHOULD NOT,RECOMMENDED,MAY 和 OPTIONAL 将按IETF RFC 2119中的描述解释。

+ + +
+ +
+ + +
+
+
+ CC BY-NC-SA 4.0 + Mao Zhou +
+
+
+ + \ No newline at end of file diff --git "a/\345\205\203\347\264\240.html" "b/\345\205\203\347\264\240.html" new file mode 100644 index 0000000..0c43731 --- /dev/null +++ "b/\345\205\203\347\264\240.html" @@ -0,0 +1,140 @@ + + + + + + + 元素 - CSL_Chinese + + + + + + + + + + + + + + +
+ + +
+

2.1 元素

+

元素由开始标签,元素内容和结束标签构成。其中可以包含属性、元素和注释。根元素包含了其他所有元素。

+
<title>内容</title>
+

title 为元素名。

+

元素有4种形式。

+
1. 空元素
+<RAM> </RAM>  或者 <RAM/>
+
+2. 带有属性的空元素
+<RAM width="100"/>  或者 <RAM width="100"> <RAM/>
+
+3. 带有内容的元素
+<Price>21000</Price>
+    
+4. 带有内容和属性的元素
+<Price MoneyKind="RMB">21000</Price>  # MoneyKind 为属性  21000为元素值
+或者是
+<NotebookComputer>
+Style =" LX2000"
+CPU =" PIII600"
+RAM ="128M "
+</NotebookComputer>
+
+

所有的元素都包含在根元素中,为根元素的子元素,子元素还还可以包含子元素。

+ + +
+ +
+ + +
+
+
+ CC BY-NC-SA 4.0 + Mao Zhou +
+
+
+ + \ No newline at end of file diff --git "a/\345\211\215\350\250\200-1.html" "b/\345\211\215\350\250\200-1.html" new file mode 100644 index 0000000..99c09fd --- /dev/null +++ "b/\345\211\215\350\250\200-1.html" @@ -0,0 +1,121 @@ + + + + + + + 前言 - CSL_Chinese + + + + + + + + + + + + + + +
+ + +
+

4.1 前言

+

​ 这篇文档描述了如何帮助改进 CSL 样式的语言支持,主要是将CSL locale file翻译为需要的语言。

+

​ 用户总是会选择一个特定的语言环境或者CSL语言环境,例如:“British Psychological Society” 的 CSL 样式将会生成英式英语的引文和参考文献目录,中国使用的国标将会生成中文的引文和参考文献目录(可以有英文条目)。在使用的语言环境不是 CSL 定义的语言环境时,使用 Locale file 就会实现自动的本地化。

+

​ 所有的 CSL 样式,都依赖于 locale file,这些本地化文件中包含了本地化数据,用来指定引文和参考文献目录中的术语,日期格式和语法规则怎么本地化。在单独的本地化文件保存这些数据,而不是在 CSL 样式文件中(尽管CSL样式文件中可以使用cs:locale元素对本地化文件中的设置进行覆盖),有很多好处:1. 本地化更加容易维护;2. 样式文件更加的紧凑; 3. 样式可以是语言无关的。

+

​ 下面,我们将描述本地化文件的结构,给出如何转换所有部分的指示,并且解释如何提交这些转换。如果想获得更多的有关本地化的信息,可以查看 CSL规范

+ + +
+ +
+ + +
+
+
+ CC BY-NC-SA 4.0 + Mao Zhou +
+
+
+ + \ No newline at end of file diff --git "a/\345\211\215\350\250\200.html" "b/\345\211\215\350\250\200.html" new file mode 100644 index 0000000..c172a9f --- /dev/null +++ "b/\345\211\215\350\250\200.html" @@ -0,0 +1,118 @@ + + + + + + + 前言 - CSL_Chinese + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git "a/\345\221\275\345\220\215\344\271\240\346\203\257.html" "b/\345\221\275\345\220\215\344\271\240\346\203\257.html" new file mode 100644 index 0000000..0e0e1dc --- /dev/null +++ "b/\345\221\275\345\220\215\344\271\240\346\203\257.html" @@ -0,0 +1,118 @@ + + + + + + + 命名习惯 - CSL_Chinese + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git "a/\345\261\236\346\200\247.html" "b/\345\261\236\346\200\247.html" new file mode 100644 index 0000000..130f51b --- /dev/null +++ "b/\345\261\236\346\200\247.html" @@ -0,0 +1,134 @@ + + + + + + + 属性 - CSL_Chinese + + + + + + + + + + + + + + +
+ + +
+

2.2 属性

+

属性是对元素及其内容的描述,用=隔开。属性必须包含在一对单引号或者双引号之间。

+
<Movie ID="09001">   # 其中的 id 就是属性  后面的值就是属性值
+<title>非诚勿扰</title>  # 子元素
+<price>70</price>
+</Movie>
+
+# 空元素的属性
+<Rectangle Width="100" Height="80"/>
+
+# 属性的另外一种形式
+<NotebookComputer>
+Style =" LX2000"
+CPU =" PIII600"
+RAM ="128M "
+</NotebookComputer>
+

每个元素中,一个属性最多出现一次,一个属性只能有一个值。

+

如果属性有多个值,这需要采取 XML 协议以外的方式来表示,如采用逗号或分号间隔,对于CSS类或标识符的名字可用空格来分隔。

+ + +
+ +
+ + +
+
+
+ CC BY-NC-SA 4.0 + Mao Zhou +
+
+
+ + \ No newline at end of file diff --git "a/\345\274\200\345\247\213.html" "b/\345\274\200\345\247\213.html" new file mode 100644 index 0000000..26f3363 --- /dev/null +++ "b/\345\274\200\345\247\213.html" @@ -0,0 +1,119 @@ + + + + + + + 开始 - CSL_Chinese + + + + + + + + + + + + + + +
+ + +
+

4.2 开始

+

​ CSL 本地化文件在Github的仓库地址为https://github.com/citation-style-language/locales/

+

​ 每个本地化文件都包含一种对应语言的本地化数据。本地化文件的名字为 “locales-xx-XX.xml”,这里的”xx-XX”是 BCP 47 langues code 语言代码中的一种。这个github wiki仓库列出了本地化 code,对应的语言和该仓库中储存的所有语言环境的软换状态(是否完成,或在制作中)。

+ + +
+ +
+ + +
+
+
+ CC BY-NC-SA 4.0 + Mao Zhou +
+
+
+ + \ No newline at end of file diff --git "a/\345\274\225\347\224\250\346\240\274\345\274\217.html" "b/\345\274\225\347\224\250\346\240\274\345\274\217.html" new file mode 100644 index 0000000..a5270de --- /dev/null +++ "b/\345\274\225\347\224\250\346\240\274\345\274\217.html" @@ -0,0 +1,166 @@ + + + + + + + 引用格式 - CSL_Chinese + + + + + + + + + + + + + + +
+ + +
+

1.3 引用格式

+

引用格式有很多很多种,我们最常用的就是国标(信息与文献 参考文献著录规则),最新的国标代号是(GB/T 7714-2015)。大多数的引用格式都属于几个基本类别,如下:

+

1.3.1 In-text Styles

+

引用格式可以分为两个主要的类型。第一种就是in-text styles,正文中的引用直接指向参考文献目录中的一个或者多个条目。in-text styles还可以细分为author-date,author,numericlabel格式。

+

在 CSL 中,每个单独的pointer称为一个引用。例如,引文“(Doe et al. 2002, Smith 1997)”包含两个引用:一个是Doe et al.在2002年发表的文献,另外一个是Smith1997年发表的文献。

+

1.3.1.1 “author-date” 和 “author” 格式

+

author-date引用格式会显示作者的名字和发表的日期,比如:(Van der Klei et al. 1991; Zwart et al. 1983)author只显示作者名字,例如:(Gidijala et al.)。参考文献条目一般使用字母表顺序对作者进行排序。

+

应该注意的是,许多引用格式使用了令人疑惑的Harvard术语来指代author-date格式,但是大多数这些格式与哈佛大学并没有关系。而且也并不存在一个官方的Harvard格式。

+

参考文献条目实例

+
+

Gidijala L, Bovenberg RA, Klaassen P, van der Klei IJ, Veenhuis M, et al. (2008) Production of functionally active Penicillium chrysogenum isopenicillin N synthase in the yeast Hansenula polymorpha. BMC Biotechnol 8: 29.

+

van der Klei IJ, Harder W, Veenhuis M (1991) Methanol metabolism in a peroxisome-deficient mutant of Hansenula polymorpha: a physiological study. Arch Microbiol 156: 15-23.

+

Zwart KB, Veenhuis M, Harder W (1983) Significance of yeast peroxisomes in the metabolism of choline and ethanolamine. Antonie van Leeuwenhoek 49: 369-385.

+
+

1.3.1.2 “numeric”格式

+

numeric格式由数字组成,比如[1,2][3]。参考文献条目一般使用作者首字母排序或者使用第一次在正文中的引用顺序排序。国标就是一种典型的numeric格式。

+

参考文献条目实例

+
+
    +
  1. Gidijala L, Bovenberg RA, Klaassen P, van der Klei IJ, Veenhuis M, et al. (2008) Production of functionally active Penicillium chrysogenum isopenicillin N synthase in the yeast Hansenula polymorpha. BMC Biotechnol 8: 29.
  2. +
  3. Zwart KB, Veenhuis M, Harder W (1983) Significance of yeast peroxisomes in the metabolism of choline and ethanolamine. Antonie van Leeuwenhoek 49: 369-385.
  4. +
  5. van der Klei IJ, Harder W, Veenhuis M (1991) Methanol metabolism in a peroxisome-deficient mutant of Hansenula polymorpha: a physiological study. Arch Microbiol 156: 15-23.
  6. +
+
+

1.3.1.3 “numeric” 复合格式

+

复合格式是numeric格式的变体。这种风格在化学领域很流行。 CSL 中暂时不支持这种格式,这里也不多作介绍。

+

参考文献条目实例

+
+
    +
  1. Gidijala L, et al. (2008) BMC Biotechnol 8: 29.
  2. +
    1. +
    2. Zwart KB, et al. (1983) Antonie van Leeuwenhoek 49: 369-385, b) van der Klei IJ, et al. (1991) Arch Microbiol 156: 15-23.
    3. +
  3. +
+
+

1.3.1.4 标签格式

+

这种引用格式由keys构成,例GBKv2008][ZwVH1983; vaHV1991]。 CSL 对这种格式支持有限,这里也不多作介绍。

+

参考文献条目实例

+
+

[GBKv2008] Gidijala L, Bovenberg RA, Klaassen P, van der Klei IJ, Veenhuis M, et al. (2008) Production of functionally active Penicillium chrysogenum isopenicillin N synthase in the yeast Hansenula polymorpha. BMC Biotechnol 8: 29.

+

[vaHV1991] van der Klei IJ, Harder W, Veenhuis M (1991) Methanol metabolism in a peroxisome-deficient mutant of Hansenula polymorpha: a physiological study. Arch Microbiol 156: 15-23.

+

[ZwVH1983] Zwart KB, Veenhuis M, Harder W (1983) Significance of yeast peroxisomes in the metabolism of choline and ethanolamine. Antonie van Leeuwenhoek 49: 369-385.

+
+

1.3.2 Note Styles

+

引用格式的第二类为Note格式。引用中的marker可以是数字或者符号,例如[*]或者[†]。每个marker指向脚注或者尾注。 CSL 不能设置使用哪些数字或者符号用于marker,这些应该用字处理软件(比如 word)设置。与上面的in-text格式不同,尾注或者脚注通常显示的信息更多。

+

参考文献条目实例

+
+

[*] Voyage to St. Kilda’ (3rd edit. 1753), p. 37.

+

[†] Sir J. E. Tennent, ‘Ceylon,’ vol. ii. 1859, p. 107.

+
+ + +
+ +
+ + +
+
+
+ CC BY-NC-SA 4.0 + Mao Zhou +
+
+
+ + \ No newline at end of file diff --git "a/\346\226\207\344\273\266\347\261\273\345\236\213.html" "b/\346\226\207\344\273\266\347\261\273\345\236\213.html" new file mode 100644 index 0000000..90ac5b3 --- /dev/null +++ "b/\346\226\207\344\273\266\347\261\273\345\236\213.html" @@ -0,0 +1,124 @@ + + + + + + + 文件类型 - CSL_Chinese + + + + + + + + + + + + + + +
+ + +
+

3.4 文件类型

+

这里有 3 种 CSL 文件类型:从属样式和独立样式 (都使用.csl作为扩展名),以及 本地化文件 (名字为"locales-xx-XX.xml",其中 "xx-XX"表示语言以及其方言,e.g. "en-US" 表示美式英语)。

+

3.4.1 独立样式

+

独立样式包含用来描述引文,笔记以及参考文献的格式的元数据。虽然它们大多数自包含的(即不依赖其他样式),但是依赖于本地化文件。

+

3.4.2 从属样式

+

从属样式的内容仅包含样式元数据,不包括任何格式说明。通过将具有相同引用风格的期刊(e.g., “Nature Biotechnology”, “Nature Nanotechnology”)的从属样式链接到独立样式(e.g., “Nature Journals”),从属样式就不再需要重复的格式说明。(也就是说从属样式是依赖其他样式的,被依赖的样式成为称为父样式

+

3.4.3 本地化文件

+

每个本地化文件包含一系列对某种语言/方言的本地化数据(词语翻译,本地化日期格式以及语法选项)。(本地化文件主要用于在不同的语言环境中使用样式,比如在中文环境中使用,中文对应的本地化文件可以将英文中的"et al."替换为等.

+ + +
+ +
+ + +
+
+
+ CC BY-NC-SA 4.0 + Mao Zhou +
+
+
+ + \ No newline at end of file diff --git "a/\346\233\264\350\277\233\344\270\200\346\255\245.html" "b/\346\233\264\350\277\233\344\270\200\346\255\245.html" new file mode 100644 index 0000000..9a26a53 --- /dev/null +++ "b/\346\233\264\350\277\233\344\270\200\346\255\245.html" @@ -0,0 +1,119 @@ + + + + + + + 更进一步 - CSL_Chinese + + + + + + + + + + + + + + +
+ + +
+

1.6 更进一步

+

这里只给出了一个基本的介绍。有关 CSL 更详细的介绍可以查看CSL 标准文档或者其他参考文档。

+

CSL 基于 XML(eXtensible Markup Language)。XML 是一种标记语言,这里只介绍基本的术语,以理解 CSL 文件格式。

+ + +
+ +
+ + +
+
+
+ CC BY-NC-SA 4.0 + Mao Zhou +
+
+
+ + \ No newline at end of file diff --git "a/\346\240\267\345\274\217\347\273\223\346\236\204.html" "b/\346\240\267\345\274\217\347\273\223\346\236\204.html" new file mode 100644 index 0000000..16d0e48 --- /dev/null +++ "b/\346\240\267\345\274\217\347\273\223\346\236\204.html" @@ -0,0 +1,304 @@ + + + + + + + 样式结构 - CSL_Chinese + + + + + + + + + + + + + + +
+ + +
+

3.6 样式结构

+

3.6.1 根元素 cs:style

+

样式的根元素是cs:style。在独立格式中,根元素携带以下几种属性:

+

class

+

​ 决定样式的引文类型是 in-text (值是 "in-text") 或者 note (值是"note") 。in-text表示引文在文字中,note 表示引文不在文字中,可能是脚注等等。

+

default-locale (可选)

+

​ 为本地化设值默认的 locale。值必须是 locale code

+

version

+

​ 样式的 CSL 版本。对于 CSL 1.0 兼容样式,必须是 "1.0"

+

此外,cs:style可能携带任意的全局选项可继承名称选项

+

在这些属性中,从属格式中,只有version是必须的, default-locale 属性可以设置用来代替的默认的本地化文件 。其他的属性是可以忽略的。

+

下面是一个独立样式的 cs:style示例,最前面是 XML 声明:

+
<?xml version="1.0" encoding="UTF-8"?>
+<style xmlns="http://purl.org/net/xbiblio/csl" version="1.0" class="in-text" default-locale="fr-FR"/>
+

3.6.2 cs:style的子元素

+

在独立格式中,cs:style有以下子元素:

+

cs:info

+

info元素必须是cs:style的第一个子元素。其中包括了用来描述样式的元数据 (style name, ID, authors,也就是样式名称、样式ID以及样式的作者)。

+

cs:citation

+

​ 必要元素,用来描述 in-text 引文或者 notes 引文的具体格式。

+

cs:bibliography (可选)

+

​ 可能会出现一次。描述参考文献列表的格式。

+

cs:macro (可选)

+

​ 可能多次出现。宏通过格式化指示来重复使用,可以使样式更加的紧凑和易维护。

+

cs:locale (可选)

+

​ 可能多次出现。用于指定或者覆盖当前的本地化数据。

+

从属格式中,cs:style只有一个子元素,cs:info

+

3.6.2.1 Info

+

cs:info包含了样式的元数据。其结构基于Atom Syndication Format。在独立格式中,cs:info有下面的几个子元素:

+

cs:authorcs:contributor (可选)

+

cs:authorcs:contributor分别用来致谢样式的作者和贡献者,可能被使用多次。在这些元素中,必须包含子元素cs:namecs:emailcs:uri则可能有,也可能没有,这些子元素分别代表作者或者贡献者的名字,邮箱和URI。(即,作者和贡献者的名字是必须的,邮箱和 URI 则是可选的)

+

cs:category (可选)

+

​ 样式可能被分类到一个或者多个类别,cs:category可能被使用一次,用来描述 in-text 引文怎么渲染。使用citation-format属性设置其为以下几种情形:

+
    +
  • “author-date” - 例如 “… (Doe, 1999)”

  • +
  • “author” - 例如 “… (Doe)”

  • +
  • “numeric” - 例如 “… [1]”

  • +
  • “label” - 例如 “… [doe99]”

  • +
  • “note” - 因为在边注或者脚注出现。

    +

    cs:categroy也可能在携带field属性时多次使用,用来对学科进行分类(见附录I 学科分类)。

  • +
+

cs:id

+

​ 必须出现一次。该元素应该包含一个 URI 以建立样式的ID,对于公开可用的样式,需要一个稳定、唯一的并可以引用的 URI。

+

cs:issn/cs:essn/cs:issnl(可选)

+

cs:issn元素可以多次使用,用来表示该 CSL 对应的期刊的 ISSN 。 cs:eissncs:issnl 可以分别用来表示 eISSN 和 ISSN-L

+

cs:link (可选)

+

​ 可以使用多次。cs:link必须携带两个属性hrefrelhref用来设置 URI (通常情况下为 URL),rel表明 URI 与当前样式的关系,它的值可能是:

+
    +
  • “self” - 该 URI 值为样式的 URI
  • +
  • “template” - 该 URI 是用来编写该样式的模板的 URI
  • +
  • “documentation” - 该 URI 是该样式的文档
  • +
+

cs:published (可选)

+

cs:published必须是一个时间戳,用来表明样式创建的时间或者可获得的时间。

+

cs:rights (可选)

+

cs:rights表明了该 CSL 的 license,可能会携带license属性。

+

cs:summary (可选)

+

​ 给出该 CSL 的简单描述。

+

cs:title

+

​ 其内容应该是该 CSL 展示给使用者的名字。

+

cs:title-short (可选)

+

​ 是上述名字的缩写,比如APA

+

cs:updated

+

​ 内容是一个时间戳,用来表示该 CSL 的最后更新时间。

+

cs:link, cs:rights, cs:summary, cs:titlecs:title-short元素可以携带xml:lang属性用来表示元素内容的语言(值必须是xsd:language locale code中的一个)。对于cs:link,该属性可以用来表示链接目标的语言。

+

在从属格式中,当cs:link中的 href为其父格式的 URI 时,rel属性必须设置为"independent-parent"。此外,从属格式的ref不能设置为"template",这在独立格式中才能使用。

+

下面是一个独立样式cs:info的例子:

+
<info>
+  <title>Style Title</title>
+  <id>http://www.zotero.org/styles/style-title</id>
+  <link href="http://www.zotero.org/styles/style-title" rel="self"/>
+  <author>
+    <name>Author Name</name>
+    <email>name@domain.com</email>
+    <uri>http://www.domain.com/name</uri>
+  </author>
+  <category citation-format="author-date"/>
+  <category field="zoology"/>
+  <updated>2008-10-29T21:01:24+00:00</updated>
+  <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work
+  is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported
+  License</rights>
+</info>
+

3.6.2.2 Citation

+

cs:citation元素描述了引文的格式,其中引文可以是一条或者多条。引文的格式可能是 in-text citations(即文字中的引文)和 notes(注记)。in-text citations 包括 ("author",例: [Doe]"author-date",例: [Doe 1999]"label",例: [doe99]"author",例: [Doe] 或者 "number",例:[1] ) 。这要求cs:layout子元素来描述什么样的数据,以及怎么被引用(见Layout)。在cs:layout之前可能会有cs:sort元素,用来描述引文的排序(见排序)。此外,cs:style可能携带任意的引文选项可继承名称选项中的属性。下面是一个cs:citation的例子:

+
<citation>
+  <sort>
+    <key variable="citation-number"/>
+  </sort>
+  <layout>
+    <text variable="citation-number"/>
+  </layout>
+</citation>
+

对 CSL 处理器开发者的一个建议

+

在 note 格式中,引文通常是一个句子。因此,当注释前面没有内容时,引文的首字母最好大写。在其他情况,引文应该是用原样打印。

+

3.6.2.3 Bioliography

+

cs:bioliography元素描述了参考文献条目的格式。同cs:citation相同,其子元素cs:layout用来描述每个条目的格式,cs:sort元素用来描述条目的排序。此外,cs:bibliography可能携带任意的参考文献目录选项可继承名称选项中的属性。下面是一个cs:bioliography的例子:

+
<bibliography>
+  <sort>
+    <key macro="author"/>
+  </sort>
+  <layout>
+    <group delimiter=". ">
+      <text macro="author"/>
+      <text variable="title"/>
+    </group>
+  </layout>
+</bibliography>
+

3.6.2.4 Macro

+

宏,使用cs:macro元素定义,包含了格式的指令。宏可以在其他宏,cs:layout元素(cs:citationcs:bioliography中),cs:key元素(cs:sort元素)中通过cs:text调用。宏在文件中位置的通常建议是:放在cs:locale元素后以及cs:citation元素前。

+

宏通过cs:macro元素的属性name的值来调用。cs:macro必须包含一个或者多个渲染元素

+

使用宏可以提高样式的可读性,紧凑性以及可维护性。通过过宏调用来保持cs:citation元素和cs:bioliography元素的内容紧凑通常是推荐的做法。为了在其他样式中方便的重复使用,宏名字建议使用通用的名字。

+

下面是一个实例:引文中包括项目题目,并当条目为"book"时,设置字体为italic

+
<style>
+  <macro name="title">
+    <choose>
+      <if type="book">
+        <text variable="title" font-style="italic"/>
+      </if>
+      <else>
+        <text variable="title"/>
+      </else>
+    </choose>
+  </macro>
+  <citation>
+    <layout>
+      <text macro="title"/>
+    </layout>
+  </citation>
+</style>
+

3.6.2.5 Locale

+

来自"locales-xx-XX.xml"locale file 的本地化数据可以通过cs:locale元素来重定义或者补充定义。cs:locale元素应该放在cs:info元素后。

+

cs:locale元素的xml:lang属性是可选的,必须设置为xsd:language locale code中的一种,用来确定使用的语言环境(或方言,见 locale fallback)。

+

对于cs:locale元素的详细使用,另见 术语本地化日期格式本地化选项

+

下面是一个cs:locale元素的例子:

+
<style>
+  <locale xml:lang="en">
+    <terms>
+      <term name="editortranslator" form="short">
+        <single>ed. &amp; trans.</single>
+        <multiple>eds. &amp; trans.</multiple>
+      </term>
+    </terms>
+  </locale>
+</style>
+

Locale Fallback

+

本地化文件为语言方言提供了本地化数据;可选的cs:locale元素的xml:lang属性设置为一种语言(例如, "en" 代表英语 ) 或者方言(例如, "en-US" 代表美式英语 ) ,xml:lang属性也可能缺失。Localr fallback 是一种在上述的属性设置中检索来确定本地化单元的机制。这些本地化单元包括日期格式,本地化选项或者术语的特定形式。

+

对于同一种语言的方言,一种被称为初级方言,其他都是二级方言。下面展示了部分语言的初级方言和二级方言:

+ + + + + + + + + + + + + + + + + + + + + + + + + +
初级方言二级方言
de-DEde-AT, de-CH
en-USen-GB
pt-PTpt-BR
zh-CNzh-TW
+

这里用一个例子来描述 Locale fallback。如果要选择 "de-AT"(Austrian German)作为使用环境,本地化单元可以来自下面的源(优先级逐渐降低):

+

A. 样式文件中的 cs:locale元素

+
    +
  • xml:lang设置为方言 "de-AT"
  • +
  • xml:lang设置为 "de"
  • +
  • xml:lang不设置
  • +
+

B. Locale files/本地化文件

+
    +
  • xml:lang设置为方言 "de-AT"
  • +
  • xml:lang设置为对应的初级方言 "de-DE" (standard german)
  • +
  • xml:lang设置为"en-US"
  • +
+

也就是说,如果要使用"de-AT"语言,首先在 Locale files 中寻找"de"对应的 locales-de-XX.xml 文件,即"locales-de-AT.xml""locales-de-DE.xml",由于要设置的语言环境是方言"de-AT",所以选择de-AT对应的 locale file locales-de-AT.xml。接下来,如果 csl 文件中包含 cs:locale元素,将会覆盖 locales-de-AT.xml 文件的设置。

+ + + + + +
+
+
+ CC BY-NC-SA 4.0 + Mao Zhou +
+
+
+ + \ No newline at end of file diff --git "a/\346\240\267\345\274\217\350\241\214\344\270\272.html" "b/\346\240\267\345\274\217\350\241\214\344\270\272.html" new file mode 100644 index 0000000..779bc70 --- /dev/null +++ "b/\346\240\267\345\274\217\350\241\214\344\270\272.html" @@ -0,0 +1,514 @@ + + + + + + + 样式行为 - CSL_Chinese + + + + + + + + + + + + + + +
+ + +
+

3.9 样式行为

+

3.9.1 选项

+

样式可以使用不同的元素来进行特定的配置。在cs:citation元素中设置元素可以配置特定的引文选项;在cs:bibliography元素和全局选项(同时影响引文和参考文献条目)中,可以配置特定的参考文献条目。继承的名字选项可以在cs:style,cs:stylecs:bibliography中设置。最后,本地化选项可以在cs:locale元素中设置。

+

3.9.1.1 引文选项

+
3.9.1.1.1 消除歧义
+

当一个引用对应多个参考文献条目的时候会产生歧义。下面有四种方法用来消除歧义:

+
    +
  1. 显示更多作者姓名
  2. +
  3. 扩展姓名(添加缩写或者完整的名)
  4. +
  5. 添加年份后缀
  6. +
  7. cs:choosedisambiguate属性为 true 的时候,实行渲染
  8. +
+

方法2也可以在全局名称歧义消除异己整个文档中有歧义的地方。

+

消除歧义的方法在下面属性被设置的时候,将会被激活,并且按上述列表中的方法进行尝试:

+

disambiguate-add-names 步骤1

+

​ 如果设置为"true"(默认为false),使用 et-al 缩写锁代替的名字列表会逐个的加入到渲染列表中,知道添加的名字可以消除引用歧义为止。

+

disambiguate-add-givenname 步骤2

+

​ 如果设置为"true"(默认为false),产生歧义的名字将被扩展。名字扩展可以使用givenname-disambiguation-rule设置。下面是一个例子。 

+ + + + + + + + + + + + + + + + + +
含有歧义的引用消除歧义的引用
(Simpson 2005; Simpson 2005)(H. Simpson 2005; B. Simpson 2005)
(Doe 1950; Doe 1950)(John Doe 1950; Jane Doe 1950)
+

如果不能通过扩展名字来实现消除歧义,当disambiguate-add-names属性设置为"true", the names still hidden as a result of et-al abbreviation after the disambiguation attempt of disambiguate-add-names are added one by one to all members of a set of ambiguous cites, until no more cites in the set can be disambiguated by adding expanded names.

+

givenname-disambiguation-rule

+

用来指定 a) 名字扩展的目的是不是仅限于消除歧义,还是对消除歧义的名字有其他的目的(只有在后面的情况中,有歧义的名字才会在明确的引用中扩展,例如:从(Doe 1950; Doe 2000)扩展到(Jane Doe 1950; John Doe 2000)) b)名称扩展是针对全部还是针对每个引用的名字 c)扩展名字的方法。

+

扩展单个名字

+

​ 扩展单个名字的步骤是:

+
    +
  1. 如果initialize-with被设置并且initialize的值为默认的 true: +
      +
    1. 可以通过"long"而不是"short"的形式来渲染首字母 (e.g. Doe 变为 J. Doe)
    2. +
    3. 如果initialize设置为"flase",完整的姓名被渲染,而不是首字母(J. Doe 变为 John Doe)
    4. +
  2. +
  3. 如果initialize-with没有被设置,使用"long"格式渲染完整的姓名(Doe 变为 John Doe)
  4. +
+

消除歧义法则

+

givenname-disambiguation-rule属性可设置的值为:

+

​ “all-name”

+

​ 名字扩展具有消除名字歧义和消除引用歧义的双重目的。在渲染的有歧义的名称中,所有的有歧义的或者没有歧义的名字都将被消除歧义。

+

​ “all-names-with-initials”

+

​ 和 “all-name” 一样,但是名称的扩展仅限于缩写。当initialize-with没被设置或者initialize被设置为"false"时,不会进行消除歧义的尝试。

+

​ “primary-name”

+

​ 和 “all-name” 一样,但是消除歧义仅限于每个引用的第一个名字。

+

​ “primary-name-with-initials”

+

​ 和 “all-names-with-initials” 一样,但是消除歧义仅限于每个引用的第一个名字。

+

​ “by-cite”

+

​ 默认,和 “all-name” 一样,但是名称扩展的目的仅限于消除引用的歧义,只有有歧义的名字在有歧义的引用中才会被影响,并且在引用的第一个名字消除歧义后就停止消除歧义。

+

disambiguate-add-year-suffix 步骤3

+

如果设置为"true"(默认为"false"),字母序的年后缀将会被添加到有歧义的名字上(“Doe 2007, Doe 2007” 变为 “Doe 2007a, Doe 2007b”)。当字母序到达"z",后,就会启用两个字母(“z”, “aa”, “ab”, …, “az”, “ba” 等等)。

+
+

如果应用上述的歧义消除方法后仍然存在歧义,则尝试通过disambiguate条件来渲染不同的引用[步骤4] (见choose)。

+
3.9.1.1.2 引用分组
+

通过引用分组,可以将相同名称的文本引用放在一起,比如:(Doe 1999; Smith 2002; Doe 2006; Doe et al. 2007)将会变为(Doe 1999; Doe 2006; Smith 2002; Doe et al. 2007)。引用分组在引用排序和消除歧义后执行。分组后的引用保持其相对顺序,并移到第一个改组中引用出现的第一个位置。

+

引用分组可以在cs:citation元素中通过设置cite-group-delimiter属性或者collapse属性(见cite collapsing)激活。

+

cite-group-delimiter

+

激活引用分组并为引用组中的引用指定分隔符,默认为","。例如,当cs:citation元素中的cs:layout中的delimiter设置为";"时,collapse设置为"year"cite-group-delimiter设置为",",将生成类似 “(Doe 1999,2001; Jones 2000)” 的引用。

+
3.9.1.1.3 cite collapsing/引用折叠
+

author或者author-date类型的引用格式中的引用分组和数字格式中的引用范围可以通过collapse属性来折叠。折叠引用组中分隔符可以是使用year-suffix-delimiterafter-collapse-delimiter属性来设置:

+

collapse

+

激活引用分组和折叠。允许的值为:

+
    +
  • “citation-number” - 当使用数字样式的时候,折叠引用数字的范围(通过"citation-number"变量来渲染) ,例如:“[1, 2, 3, 5]” 变为 “[1–3, 5]”。只有升序的引用才可以折叠,比如: “[3, 2, 1]” 将不会折叠。
  • +
  • “year” - 通过压缩相同的名字来折叠引用分组,例如: “(Doe 2000, Doe 2001)” 变为 “(Doe 2000, 2001)”。
  • +
  • “year-suffix” - 对名字相同的折叠项,折叠相同的年份,例如: “(Doe 2000a, 2000b)”变为”(Doe 2000a, b)“。
  • +
  • “year-suffix-ranged” - 对名字相同的折叠项,折叠年份范围,例如: “(Doe 2000a, b, c, e)”变为”(Doe 2000a–c,e)“。
  • +
+

disambiguate-add-year-suffix设置为"false"时,或者引用中包含位置(例如:“(Doe 2000a-c, 2000d, p. 5, 2000e,f)”,“Doe 2000d”有一个页码位置),“year-suffix”和”year-suffix-ranged”回退到”year”。

+

year-suffix-delimiter

+

​ 设置年份后缀的分隔符。默认在cs:citation元素的cs:layout中设置。例如:当collapse设置为"year-suffix"cs:citation中的cs:layoutdelimiter元素设置为";",并且year-suffix-delimiter设置为","时,渲染结果将类似于 “(Doe 1999a,b; Jones 2000)”。

+

after-collapse-delimiter

+

​ 设置折叠后的引用组要使用的分隔符。默认在cs:citation元素的cs:layout中设置。例如:当collapse设置为"year"cs:citation中的cs:layoutdelimiter元素设置为",",并且after-collapse-delimiter设置为";"时,渲染结果将类似于 “(Doe 1999, 2001; Jones 2000, Brown 2001)”。

+
3.9.1.1.4 标注距离
+

near-note-distance

+

当有一个预先的标注时,"near-note"位置是我引用被判断为真,这种预先的标注可以为 a) 指向同一个项目 b) 当前注视以前的脚注或尾注。(译注:不知道讲了什么)

+

3.9.1.2 参考文献目录选项

+
3.9.1.2.1 空白
+

hanging-indent

+

​ 如果设置为 "true"(默认为"false"),参考文献列表将采用悬挂缩进渲染。

+

second-field-align

+

​ 如果该属性被设置,则书目条目的后续行沿第二字段对齐。 使用”flush”时,第一个字段与边距齐平。 对于”margin”,第一个字段放在margin中,随后的行与margin对齐。例如,当第一个字段设置为<text variable="citation-number" suffix=". "/>

+
9.  Adams, D. (2002). The Ultimate Hitchhiker's Guide to the
+    Galaxy (1st ed.).
+10. Asimov, I. (1951). Foundation.
+

line-spacing

+

​ 指定垂直方向的行距。默认值为"1",即单倍行距。可以被设置为任意正整数,用来表示对应倍数的行距。

+

entry-spacing

+

​ 指定不同条目垂直方向的距离,默认值为"1",即一倍距离,可以被设置为任意正整数,用来表示对应倍数的距离。

+
3.9.1.2.2 参考文献分组
+

subsequent-author-substitute

+

​ 如果该属性被设置,则此属性将用上一条条目中的名称替换参考文献条目中的名字。具体的代替方案取决于subsequent-author-substitute-rule属性的值。替换仅限于cs:names元素中渲染的第一个名字。

+

subsequent-author-substitute-rule

+

​ 用来指定subsequent-author-substitute的结果怎么替换。允许的值为:

+
    +
  • “complete-all” - 默认值,当名字变量中的所有渲染的名字和上一个参考文献条目相同时,subsequent-author-substitute 属性的值将代替整个名字列表(包括标点和术语,比如 et-al 和 and 等术语),但cs:names元素中设置的后缀将不会被代替。
  • +
  • “complete-each” - 和”complete-all”一样,需要完整的匹配,但是subsequent-author-substitute 属性的值将会代替所有被渲染的名字。
  • +
  • “partial-each” - 当有一个或者多个名字变量中的渲染名字和上一个条目中相同时,使用subsequent-author-substitute 属性代替对应的值。匹配从第一个名字开始,直到不匹配的名字为止。
  • +
  • “partial-first” - 和”partial-each”相同,但是替换仅限于第一个名字。
  • +
+

对下面的例子:

+
Doe. 1999.
+Doe. 2000.
+Doe, Johnson & Williams. 2001.
+Doe & Smith. 2002.
+Doe, Stevens & Miller. 2003.
+Doe, Stevens & Miller. 2004.
+Doe, Williams et al. 2005.
+Doe, Williams et al. 2006.
+

subsequent-author-substitute设置为"-",并且subsequent-author-substitute-rule设置为"complete-all",渲染结果将变为:

+
Doe. 1999.
+---. 2000.
+Doe, Johnson & Williams. 2001.
+Doe & Smith. 2002.
+Doe, Stevens & Miller. 2003.
+---. 2004.
+Doe, Williams et al. 2005.
+---. 2005.
+

subsequent-author-substitute-rule设置为"complete-each"时,渲染的结果为:

+
Doe. 1999.
+---. 2000.
+Doe, Johnson & Williams. 2001.
+Doe & Smith. 2002.
+Doe, Stevens & Miller. 2003.
+---, --- & ---. 2004.
+Doe, Williams et al. 2005.
+---, --- et al. 2006.
+

subsequent-author-substitute-rule设置为"partial-each"时,渲染的结果为:

+
Doe. 1999.
+---. 2000.
+Doe, Johnson & Williams. 2001.
+--- & Smith. 2002.
+Doe, Stevens & Miller. 2003.
+---, --- & ---. 2004.
+Doe, Williams et al. 2005.
+---, --- et al. 2005.
+

subsequent-author-substitute-rule设置为"partial-first"时,渲染的结果为:

+
Doe. 1999.
+---. 2000.
+Doe, Johnson & Williams. 2001.
+--- & Smith. 2002.
+Doe, Stevens & Miller. 2003.
+---, Stevens & Miller. 2004.
+Doe, Williams et al. 2005.
+---, Williams et al. 2005.
+

3.9.1.3 全局选项

+

人名中的连字符

+

initialize-with-hyphen

+

​ 该属性用来制定合成名字中间是不是使用连字符。例如,"Jean-Luc"是一个合成名字,如果该属性设置为"true"(默认),渲染结果为"J.-L.",如果设置为"false",渲染结果为"J.L."

+

页码范围

+

page-range-format

+

​ 用来设置页码范围的格式,是不是使用简写来压缩。其可选的值有:"chicago" (“321–28”), "expanded" ( “321–328”), "minimal" (“321–8”), 或者" minimal-two" (“321–28”)。每一组值前面表示可选的属性值,后面是渲染结果的例子。也可见附录V 页码范围格式。使用page-range-delimiter属性可以用来设置页面范围分割的符号,该属性在 CSL 1.0.1 中引入,默认是一个破折号。如果改属性没有设置,就默认使用破折号。

+

Name Particles

+

​ 西方人的名字中经常包括一个或者多个小部分,例如,"de"在荷兰人的名字中"W. de Koning"。在仅显示姓氏时,这些小部分可以分为必须保留和可删除(或译为不可省略和可省略)两种类型:这两种类型分别称为non-dropping部分和dropping部分。一个单个的名字可以同时包括这两种类型(不能删除的类型始终位于可删除类型的后面)。例如,"W. de Koning"和法国名字"Jean de la Fontaine"可以被解构为:

+
{
+    "author": [
+        {
+            "given": "W.",
+            "non-dropping-particle": "de",
+            "family": "Koning"
+        },
+        {
+            "given": "Jean",
+            "dropping-particle": "de",
+            "non-dropping-particle": "La",
+            "family": "Fontaine"
+        }
+    ]
+}
+

在仅显示姓氏的时候,只保留不能删除的部分,"De koning""La Fontaine"

+

在名字倒写的情况下,即姓氏在名字之前,在姓氏后面始终添加dropping particle,但是non-dropping部分可以前置(例如,"de Koning, W.")或者后置(Koning, W. de)。在名字倒写,不可省略粒子前置时,可以使用下面的方式对名字进行排序:排序A:将不可省略粒子和姓一起保留作为主排序键值的一部分;排序B:通过将不可省略粒子和姓分开,并使其成为二级排序键值,并加入可省略粒子(如果有):

+

Sort order A: 不可省略粒子不降级

+
    +
  • 主排序键值 “La Fontaine”
  • +
  • 次排序键值 “de”
  • +
  • 第三排序键值: “Jean”
  • +
+

Sort order B: 不可省略粒子降级

+
    +
  • 主排序键值 “Fontaine”
  • +
  • 次排序键值 “de La”
  • +
  • 第三排序键值 “Jean”
  • +
+

对不可省略粒子的设置可以使用demote-non-dropping-particle选项:

+

demote-non-dropping-particle

+

​ 用来设置在倒写的名字中不可省略粒子的显示和排序方式(例如 Koning W. de)。可设置的值为:

+
    +
  • “never”: 不可省略粒子被作为姓中的一部分对待,并附加可省略粒子(“de Koning, W.” “La Fontaine, Jean de”)。不可省略粒子作为主排序键值的一部分(排序A,例如. “de Koning, W.” 将出现在首字母 “D”的区域).
  • +
  • “sort-only”: 显示的方式和 “never” 相同,但是不可省略粒子降级作为二级排序键值。(排序B, “de Koning, W.”出现在首字母”K”的区域).
  • +
  • “display-and-sort” (默认),可省略粒子和不可省略粒子在最后( “Koning, W. de” 和 “Fontaine, Jean de La”)。对名字排序,所有的粒子都是二级排序键值的一部分。(排序B,“Koning, W. de” 出现在首字母”K”的区域).
  • +
+

某些名字中包含的粒子禁止被降级。在这些情况中,粒子将和姓合并到一起,比如,对于法国名字 Charles de Gaulle

+
{
+    "author": [
+        {
+            "family": "de Gaulle",
+            "given": "Charles"
+        }
+    ]
+}
+

3.9.1.4 可继承的名称选项

+

cs:namescs:name元素的属性也可以在cs:stylecs:citationcs:bibliography元素中设置。这样就不需要每次在cs:namescs:name出现的时候赋值。

+

​ 可以在cs:name元素中继承的属性有 and, delimiter-precedes-et-al, delimiter-precedes-last, et-al-min, et-al-use-first, et-al-use-last, et-al-subsequent-min, et-al-subsequent-use-first, initialize, initialize-with, name-as-sort-ordersort-separatorname-form属性和name-delimiter属性对英语cs:name元素中的formdelimiter属性。同样地,names-delimiter属性对应cs:names元素中的delimiter属性。

+

​ 当一个可继承的名称属性在cs:stylecs:citationcs:bibliography中设置时,其值将作用于改元素包含的所有的cs:names元素。如果一个属性在多个可继承的层次设置,最底层的值发挥作用。

+

3.9.1.5 局部选项

+

limit-day-ordinals-to-day-1

+

​ 日期格式在cs:datecs:date-part元素中定义。默认地,当cs:date-part元素中的name设置为"day"form属性设置为"ordinal"时,所有的天(1到31)将会以序数形式渲染,例如:“January 1st”,“January 2nd”等等。通过将limit-day-ordinals-to-day-1属性设置为"true"(默认值为"false"),序数格式将仅限于每个月的第一天,其他的天将不使用序数格式。这在某些语言中出现,比如法语,“1er janvier”,“2 janvier”,“3 janvier”。

+

punctuation-in-quote

+

​ 当cs:text元素渲染时,如果quotes属性设置为"true"(见格式化),并且在输出后有逗号或者句号,punctuation-in-quote属性可以控制标点放在括号的内还是外,"false"为外(默认),"true"为内。

+

3.9.2 排序 ***

+

cs:citationcs:bibliography元素可以在cs:layout元素之前携带一个cs:sort子元素,来实现对引文或者参考文献条目的排序。在缺失cs:sort元素时,引文和文献条目将会使用他们在文章中出现的顺序来排序。

+

cs:sort元素必须包含一个或者多个cs:key子元素,可以在该元素中设置变量(附录 IV 变量)或者宏名来实现排序。对于每个cs:key元素,排序的顺序可以通过设置sort属性来设置为升序("ascending",默认)或者降序("descending")。属性names-min,names-use-first,names-use-last可以用来覆盖et-al-min/et-al-subsequent-min, et-al-use-first/et-al-subsequent-use-firstet-al-use-last 属性的值,并且可以通过cs:key影响所有的名字.

+

​ 排序的键值是按顺序求值的,也就是说:首先,使用第一个排序键值对所有的项目进行排序。然后使用第二个键值对第一个键值排序后的结果进行排序,直到所有的键值都完成排序为止。如果键值为空,就放到最后。

+

​ 这里给出一个例子:其中首先引用"author"宏进行排序,并且使用et al.来对较长的作者序列进行代替。然后,使用"issued"变量来进行第二次排序,使用降序:

+
<citation>
+  <sort>
+    <key macro="author" names-min="3" names-use-first="3"/>
+    <key variable="issued" sort="descending"/>
+  </sort>
+  <layout>
+    <!-- rendering elements -->
+  </layout>
+</citation>
+

​ 变量或者宏的排序键值可以与"normal"渲染的输出不同,具体要依赖下面的细节:

+

3.9.2.1 排序变量

+

cs:key元素通过variable变量属性调用变量的排序键值。名称变量、日期变量和数字变量除外:

+

名称: 名字变量通过变量属性被调用,例如 <key variable="author"/>,当form属性设置为"long"name-as-sort-order属性设置为"all",返回名字列表字符串。

+

日期日期变量通过variable属性被调用,返回 YYYYMMDD格式。使用0代替缺失的日期部分,例如:December 2000渲染为20001200。因此,简略的日期在升序排列的时候更加靠前,例如:2000, May 2000, May 1st 2000。负数的年份(即公元前)将被反向排序,比如:100BC, 50BC, 50AD, 100AD。排序过程中,季节将被忽略,因为南北半球的季节顺序不同。在日期范围中,开始的日期用于主要排序,结束日期用于次要排序,例如:2000–2001, 2000–2005, 2002–2003, 2002–2009。在具有相同的开始日期时,日期范围将放在单独的日期后,例如:2000, 2000–2002。

+

数字数字变量通过variable属性来调用,返回整数(form设置为"numeric")如果原始的变量值仅由非数字文本组成,则将该值作为文本字符串返回。

+

3.9.2.2 排序宏

+

​ 变量排序的键值是由字符串值组成,没有富文本标记。通过宏属性中的键值cs:key来调用。下面为一些特殊情况。

+

​ 对于名字排序,使用相同的宏而不是直接使用名字变量来渲染和排序有4个好处。第一,可以使用替换,例如:可以使用"editor"变量代替空的"author"变量。第二,可以使用 et-al 缩写,在宏里使用 et-al-min/et-al-subsequent-min, et-al-use-first/et-al-subsequent-use-firstet-al-use-last 可选属性,或者覆盖 cs:key元素中的names-min, names-use-firstnames-use-last 。当 et-al 缩写出现的时候,"et-al""and others"术语不会包括在排序键值中。第三,名字可以只使用姓来排序,即使用宏,其中的cs:nameform属性设置为"short"。最后,通过调用宏,将cs:name中的form属性设置为"count",可以按姓名列表中姓名的数目进行排序。至于使用variable属性对姓名进行排序,将cs:name中的name-as-sort-order属性设置为"all",返回值为排序后的名称列表。

+

​ 在宏中带有cs:number数字变量的和日期变量的渲染方法和通过变量的调用相同。唯一的区别是:如果通过variable属性调用日期变量,将返回完整的日期。相反地,宏调用则只返回原本要渲染的日期部分。例如:

+

3.9.3 范围分隔符

+

​ “citation-number”和”year-suffix”变量的折叠范围以短划线分隔,例如”(1-3,5)“和”(Doe 2000a-c,e)“。

+

​ “locator” 变量总是使用一个短划线代替任意的连字符。 对 “page” 变量来说,只有cs:style中的page-ran ge-format属性被设置时,替换才会执行(见页码范围)。

+

3.9.4 格式化

+

​ 下面的属性可以在cs:date, cs:date-part, cs:et-al, cs:group, cs:label, cs:layout, cs:name, cs:name-part, cs:names, cs:numbercs:text中设置:

+

font-style

+

用来设置字体,可能的值为:

+
    +
  • “normal” 默认
  • +
  • “italic” 设置文字的斜体
  • +
  • “oblique” 设置没有斜体的文字倾斜
  • +
+

font-variant

+

Allows for the use of small capitals, 值可以设置为:

+
    +
  • “normal” 默认
  • +
  • “small-caps”
  • +
+

font-weight

+

设置字宽,值可以为:

+
    +
  • “normal” 默认
  • +
  • “bold”
  • +
  • “light”
  • +
+

text-decoration

+

设置下划线,值可以为:

+
    +
  • “none” 默认
  • +
  • “underline”
  • +
+

vertical-align

+

设置垂直对齐,值可以为:

+
    +
  • “baseline” 默认
  • +
  • “sup” 上标
  • +
  • “sub” 下标
  • +
+

3.9.5 词缀

+

​ 前缀属性prefix和后缀属性suffix可以在cs:date(使用cs:date定义本地化格式除外),cs:date-partcs:date调用本地化格式除外)、cs:groupcs:labelcs:layoutcs:namecs:namescs:number以及cs:text中设置。属性值用来在输出的前面或者后面添加东西,但是只有输出的时候才会渲染。除在cs:layout中设置外,词缀将出现在同一个元素的格式化引用strip-periodstext-case的影响范围的外面,也就是这些属性的设置对前缀和后缀没有影响。作为一种解决方法,在父元素cs:group中设置上述属性,会产生影响。

+

3.9.6 分隔符

+

delimiter属性可以在cs:date(用来分隔日期的各部分,如年和月;在cs:date调用本地化格日期格式时,分隔符将被禁用)、cs:name(分隔名字变量中不同的名字列表)、cs:name(分隔名字列表中的名字)、cs:group以及cs;layout(分隔子元素的输出)中设置分隔符。

+

3.9.7 显示

+

display属性可用于将各个参考文献条目构成一个或者多个文本块。如果使用该属性,所有的渲染元素都在该属性的控制下。(译注:是用来设置对齐效果的)属性可能的值为:

+
    +
  • “block” - 两边对其
  • +
  • “left-margin” - 左对齐。
  • +
  • “right-inline” - 右对齐
  • +
  • “indent” - 缩进。
  • +
+

+

A. 除使用second-field-align外,使用"left-margin""roght-inline"可以实现相同的渲染效果。这种操作方式潜在的好处是,可以在最终的输出中进一步控制块的格式,例如,在HTML 的 CSS 或者 word 的样式中。

+
<bibliography>
+  <layout>
+    <text display="left-margin" variable="citation-number"
+        prefix="[" suffix="]"/>
+    <group display="right-inline">
+      <!-- rendering elements -->
+    </group>
+  </layout>
+</bibliography>
+

B. 每个作者的出版物列表。当subsequent-author-substitute设置为空字符串时,具有相同作者的条目的作者名字只渲染一次。

+
<bibliography subsequent-author-substitute="">
+  <sort>
+    <key variable="author"/>
+    <key variable="issued"/>
+  </sort>
+  <layout>
+    <group display="block">
+      <names variable="author"/>
+    </group>
+    <group display="left-margin">
+      <date variable="issued">
+        <date-part name="year" />
+      </date>
+    </group>
+    <group display="right-inline">
+      <text variable="title"/>
+    </group>
+  </layout>
+</bibliography>
+

渲染结果将类似下面:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Author1
year-publication1title-publication1
year-publication2title-publication2
Author2
year-publication3title-publication3
year-publication4title-publication4
+

C. 带有注释的条目,注释显示在参下方的缩进块中。

+
<bibliography>
+  <layout>
+    <group display="block">
+      <!-- rendering elements -->
+    </group>
+    <text display="indent" variable="abstract" />
+  </layout>
+</bibliography>
+

3.9.8 引用

+

quotes属性可以在cs:text中设置。当设置为"true"时(默认为"false"),渲染文本将会被包含在引用中。本地化的punctuation-in-quote选项控制用来连接的逗号或者句号是出现在引号的内部还是外部(默认外部),见Locale options

+

3.9.9 Strip-periods

+

strip-periods属性可以在cs:label或者cd:text中设置,此外,当name被设置为"month"时,也可以在cs:date-part中设置。当该属性被设置为true的时候(默认的是"false"),所有文本中的句号(英文中为点)将会被删除。

+

3.9.10 文字大小写

+

text-case 属性可以在cs:date,cs:date-part,cs:label,cs:name-part,cs:numbercs:text中设置,可设置的值为:

+
    +
  • “lowercase”: 使用小写字母渲染文本
  • +
  • “uppercase”: 使用大写字母渲染文本
  • +
  • “capitalize-first”: 如果第一个词是小写的,将首字母设置为大写
  • +
  • “capitalize-all”: 将每个小写词的首字母设置为大写
  • +
  • “sentence”: renders text in sentence case(以句子的格式设置?)
  • +
  • “title”: renders text in title case(以标题的格式来设置?)
  • +
+

3.9.10.1 句子大小写转换

+

句子大小写转换(在”Text-case”中设置为”sentence”),

+
    +
  1. 对于大写字符串,字符串的第一个字符保持为大写。其它字母表示为小写
  2. +
  3. 对于大小写混合的字符串,如果单词是小写,第一个单词的首字符大写,其它所有单词的大小写保持不变。
  4. +
+

CSL 处理器不能识别专有名词。因此,可以将句子大小写的字符转缺的转换为标题大小写,反之亦然。因此,通常最好在句子大小写的情况下存储注入标题之类的字符串,并且仅在样式需要其它大小写的情况下菜使用文本大小写。

+

3.9.10.2 标题大小写转换

+

标题大小写转换(在”Text-case”中设置为”title”)对英语来说:

+
    +
  1. 对大写的字符串,每个单词的第一个字母保持大写,其它的字母保持小写。
  2. +
  3. 对于小写或者是混合的字符串,每个小写字符串的首字母大写。大写的字符串或者是混合的字符串保持原样。
  4. +
+

两种情况下,stop words必须是小写的,除非他们是第一个或者对后一个单词,或者跟在冒号后面。stop words包括:"a", "an", "and", "as", "at", "but", "by", "down", "for", "from", "in", "into", "nor", "of", "on", "onto", "or", "over", "so", "the", "till", "to", "up", "via", "with", "yet".

+

非英语项目

+

​ 由于许多语言不使用标题大小写,标题大小写转换(在”Text-case”中设置为”title”)仅影响英语项目。

+

​ 如果cs:style中的default-locale属性没有设置,或者设置为en开头的单词,则假定为英语环境。如果某项的元数据包含一个语言字段,而且该字段不是以"en"开头的,才被视为是非英语环境。

+

​ 同样的,default-locale被这是为除en开头的字段,就假定为非英语。如果项目是以en开头的字段,就被视为是英语。

+ + + + + +
+
+
+ CC BY-NC-SA 4.0 + Mao Zhou +
+
+
+ + \ No newline at end of file diff --git "a/\346\270\262\346\237\223\345\205\203\347\264\240.html" "b/\346\270\262\346\237\223\345\205\203\347\264\240.html" new file mode 100644 index 0000000..a915647 --- /dev/null +++ "b/\346\270\262\346\237\223\345\205\203\347\264\240.html" @@ -0,0 +1,479 @@ + + + + + + + 渲染元素 - CSL_Chinese + + + + + + + + + + + + + + +
+ + +
+

3.8 渲染元素

+

渲染元素指定了在引文或参考文献条目中需要包含哪些条目元数据,以及以何种方式排序,并对其格式进行控制。

+

3.8.1 Layout

+

cs:layout渲染元素是cs:citation元素和cs:bibliography元素的的必要子元素。cs:layout必须包含一个或者多个渲染元素,并且可能携带affixesformattig属性。在cs:citation元素中,delimiter属性用来指定一个引文中的不同引用的间隔符。例如:一个"(1,2)"类型的引文可以使用下面的代码实现:

+
<citation>
+  <layout prefix="(" suffix=")" delimiter=", ">
+    <text variable="citation-number"/>
+  </layout>
+</citation>
+

3.8.2 Text

+

cs:text渲染元素用来输出文字。其必须携带下面的属性来确定什么部分需要渲染:

+
    +
  • variable- 渲染一个变量的文本内容。属性值必须是标准变量。可以与form属性一起选择变量的"long"(默认)或"short"形式(例如:设置题目,完整题目或者简写)。如果选择了"short"形式,但是却没法获得,就使用"long"形式来渲染。
  • +
  • macro - 渲染宏的文字输出。属性值必须和cs:macro元素的name属性的值相匹配。
  • +
  • term - 渲染术语。属性必须是附录II 术语中的术语列表中的一个。通过设置复数属性plura l来这只其使用单数还是复数形式,其中"true"为默认,表示使用复数形式,设置为"false"表示使用单数形式。 使用form属性可以设置术语的形式,其值可以为"long" (默认)、"short""verb""verb-short"或者"symbol" (见术语).
  • +
  • value - 渲染属性值自己。
  • +
+

一个cs:text的渲染title变量的例子:

+
<text variable="title"/>
+

cs:text 可能会携带 affixesdisplayformattingquotesstrip-periodstext-case 属性。

+

3.8.3 Date

+

cs:date渲染元素输出必须从日期变量列表中的选择。日期可以以本地化或者非本地化格式呈现。

+

本地化的日期格式通过可选的form属性来选择,其值必须设置为"numeric"(完全的数字格式 ,例如:12-15-2005)或者"text"(非数字的月份格式,例如: December 15, 2005)。本地化日期格式可以通过两种方式进行自定义。第一种:date-parts属性可以用来设置不同的日期组成部分。其值可以设置为:

+
    +
  • "year-month-day" - 默认值,渲染年,月,日
  • +
  • "year-month" - 渲染年月
  • +
  • "year" - 只渲染年
  • +
+

第二种,cs:date可以含有一个或者多个cs:date-part子元素(见Date-part)。在这些子元素中可以设置属性来覆盖之前的本地化设置(例如:要获得所有语言环境的缩写月份,可以将月份的cs:date-part元素的form属性设置为"short")。这些cs:date-part子元素不影响各个日期部分渲染的顺序和以及其是否渲染。cs:date-part元素中不能使用词缀 Affixes.

+

没有属性form的情况下,cs:date则描述了一个自带的非本地化的日期格式。其日期格式使用cs:date-part子元素来构建。在使用name属性并设置为daymonthyear时,这些元素的顺序反应了其显示顺序。日期可以在cs:date-part元素中使用formatting属性以及多个cs:date-part的属性来格式化(见Date-part)。cs:date中的delimiter属性可以用来设置cs:date-part元素不同日期部分的分隔符,此外,词缀可以用在 cs:date-part elements。

+

本地化的日期或者是非本地化的日期,, cs:date 都可能携带 affixesdisplayformattingtext-case 属性。

+

3.8.3.1 Date-part

+

cs:date-part元素用来控制日期的各个部分怎么渲染。除了其父元素cs:date调用了本地化日期格式,这些子元素同样可以决定哪些部分出现以及各部分的渲染顺序。cs:date-part元素描述了name属性选择的日期部分,其name值可以是:

+

“day”

+

​ 对于"day"来说,cs:date-part可能会携带form属性,值可以设置为:

+
    +
  • “numeric” - (默认),例如,每个月第一天显示为 1

  • +
  • “numeric-leading-zeros” - 不够的位数用0补齐,例如,01

  • +
  • “ordinal” - 使用序数形式,例如,1st

    +

    有的语言种,比如法语,只在月份的第一天使用"oridinal"也就是序数形式(“1er janvier”,“2 janvier”,“3 janvier”等)。这种输出可以通过"oridinal"以及limit-day-oridinals-to-day-1属性来设置 (see 本地化选项)。

  • +
+

“month”

+

​ 对于"month"来说,cs:date-part可能会携带strip-periodsform属性。在locale files中,月份缩写应该后面要加点(例如: “Jan.”, “Feb.”)。点可以设置strip-periods"true"去掉。form属性可以设置为:

+
    +
  • “long” - 默认,例如:January
  • +
  • “short” - 例如:Jan.
  • +
  • “numeric” - 例如:1
  • +
  • “numeric-leading-zeros” - 例如:01
  • +
+

“year”

+

​ 对"year"来说,cs:date-part可能会携带form属性,值可以设置为:

+
    +
  • “long” - 默认,例如:2020
  • +
  • “short” - 例如:20
  • +
+

cs:date-part 也可能携带formattingtext-caserange-delimiter 属性。除在cs:date元素中使用,其他情况下,cs:date-part是可以使用词缀的。

+

3.8.3.2 Date Ranges

+

默认的日期范围中的分隔符是短线(en-dash),比如:May–July 2008。可以在cs:date-part元素中通过range-delimiter属性来设置常用的分隔符。当日期范围被渲染的时候,范围分隔符从cs:date-part元素中提取,并且匹配两个日期差别中最大的部分(“year”,“month”,或 “day”)。如下面的例子,将会渲染出类似"1-4 May 2008", "May–July 2008""May 2008/June 2009"的日期范围。

+
<style>
+  <citation>
+    <layout>
+      <date variable="issued">
+        <date-part name="day" suffix=" " range-delimiter="-"/>
+        <date-part name="month" suffix=" "/>
+        <date-part name="year" range-delimiter="/"/>
+      </date>
+    </layout>
+  </citation>
+</style>
+

3.8.3.3 AD and BC

+

"ad"一词(Anno Domini)自动附加到小于四位数的正年份(例如,"79"变为"79AD")。"bc"一词(Before Christ)自动附加到负年份(例如,"-2500"变为"2500BC")。

+

3.8.3.4 Seasons

+

如果日期中包含了季节而不是月份,日期术语("season-01""season-04", 分别代表春夏秋冬)将取代月份术语。比如,下面将会被渲染为"May 2008""Winter 2009"

+
<style>
+  <citation>
+    <layout>
+      <date variable="issued">
+        <date-part name="month" suffix=" "/>
+        <date-part name="year"/>
+      </date>
+    </layout>
+  </citation>
+</style>
+

3.8.3.5 Approximate Dates

+

近似日期,在is-uncertain-date属性设置为"true"时即渲染(见choose)。例如:下面的例子讲渲染出2005(正常日期)和ca.2003(近似日期)的结果。

+
<style>
+  <citation>
+    <layout>
+      <choose>
+        <if is-uncertain-date="issued">
+          <text term="circa" form="short" suffix=" "/> # circa 是大约的意思
+        </if>
+      </choose>
+      <date variable="issued">
+        <date-part name="year"/>
+      </date>
+    </layout>
+  </citation>
+</style>
+

3.8.4 Number

+

cs:number渲染元素输出variable属性选择的数字变量。数字变量标准变量的子集。

+

使用cs:number元素来渲染数字变量时,如果只包含数字内容(使用is-numeric属性设置,见 Choose),数字就被提取出来并渲染。变量内容包含非数字内容时,变量内容将呈现为原样。

+

在提取的过程中,用连字符分隔的数字将去掉中间的空格(“2 - 4” 变为 “2-4”)。用逗号分隔的数字在逗号后会添加一个空格,并删掉其余的空格(“2,3” 和 “2 , 3” 变为 “2, 3”)。当数字使用&分隔时,在前后各添加一个空格(“2&3” 变为 “2 & 3”)。

+

提取的数字可以通过form属性行进格式化,其值可以设置为:

+
    +
  • “numeric” - 默认,例如: “1”, “2”, “3”
  • +
  • “ordinal” - 序数数字,例如: “1st”, “2nd”, “3rd”。序数后缀可以使用术语定义 (见 序数后缀.
  • +
  • “long-ordinal” - 长序数,例如: “first”, “second”, “third”。畅序数使用术语”long-ordinal-01” 到 “long-ordinal-10”定义, 用来在数字1到10使用。对于其他的数字,长序数渲染的结果讲和序数相同.
  • +
  • “roman” - 罗马数字,例如:“i”, “ii”, “iii”
  • +
+

带有前缀或者后缀的数字不能使用罗马数字进行排序或者渲染(例如:“2E” 仍然时 “2E”)。没有词缀的数字可以被分别转换(“2, 3” 可以转换为 “2nd, 3rd”, “second, third” 或者 “ii, iii”)。

+

cs:number元素可能会携带affixesdisplayformattingtext-case 属性。

+

3.8.5 Names

+

cs:names元素用来输出一个或多个名字变量(或名称变量)的内容(通过必选属性variable来选择),每个names元素可以包含一个或者多个名称变量(例如:"author"名称变量会携带引用项中所有的作者名称)。如果选择了多个变量,每个变量将会按顺序单独渲染,但当选择中包括编辑和翻译("editor""translator")不适用。当包含的内容中有两个名字变量相同时,则只渲染一个。另外,如果cs:names元素中包含cs:label元素,"editortranslator"将用来代替"editor""translator"(例如:Doe(editor & tranlator))。cs:names元素中的delimiter属性可以用来分割不同的名字变量(例如:Doe, Smith (editors); Johnson (translator)中间使用了分号隔开)。

+
<names variable="editor translator" delimiter="; ">
+  <label prefix=" (" suffix=")"/>
+</names>
+

cs:names有四个子元素:cs:namecs:et-alcs:substitutecs:labelcs:names 元素可能会携带 affixes, displayformatting 属性。

+

3.8.5.1 Name

+

cs:name元素的一个可选的子元素cs:names可以用来描述单个names的格式,以及名称变量中不同names的分隔。cs:name可能携带下面的属性:

+

and

+

​ 在名称变量中用来设置倒数第二个名字和倒数第一个名字的分隔符。可选的值为"text"(“Doe, Johnson and Smith”)或者"symbol"(eg: “Doe, Johnson & Smith”)。

+

delimiter

+

​ 在名称变量中设置字符串来分隔名称。默认的是","(e.g. “Doe, Smith”)。

+

delimiter-precedes-et-al

+

​ 确定在使用et-al缩写的情况下,在截断的姓名列表和et-al术语之间何时使用分隔符或者空格。该属性可选的值有:

+
    +
  • “contextual” - (default), 在作者列表中有2个及以上的人时使用 +
      +
    • 1 name: “J. Doe et al.”
    • +
    • 2 names: “J. Doe, S. Smith, et al.” 两个人,则在最后一个人名和et-al间使用,分隔
    • +
  • +
  • “after-inverted-name” - 在name-as-sort-order属性使当前的名字发生了颠倒时使用。例如:当name-as-sort-order属性设置为"first"时,第一个名字的前后部分 Doe 和 J 发生了反转,因此在第一个名字后面使用了分隔符, +
      +
    • “Doe, J., et al.”
    • +
    • “Doe, J., S. Smith et al.”
    • +
  • +
  • “always” - 不论几个名字或者怎样的设置,总是使用 +
      +
    • 1 name: “J. Doe, et al.”
    • +
    • 2 names: “J. Doe, S. Smith, et al.”
    • +
  • +
  • “never” - 禁止使用分隔符,不论几个名字。 +
      +
    • 1 name: “J. Doe et al.”
    • +
    • 2 names: “J. Doe, S. Smith et al.”
    • +
  • +
+

delimiter-precedes-last

+

在名字列表中确定何时使用分隔符来分割最后一个作者和倒数第二个作者。如果and没有被设置,则不论delimiter-precedes-last属性的值,名字分隔符总是使用。

+
    +
  • “contextual” - 默认,当名字列表中的名字有3个或以上时使用。下面在使用3个名字时,在and前使用了分隔符, +
      +
    • 2 个名字: “J. Doe and T. Williams”
    • +
    • 3 个名字: “J. Doe, S. Smith, and T. Williams”
    • +
  • +
  • “after-inverted-name” - 在name-as-sort-order属性使当前的名字发生了颠倒时使用。例如:当name-as-sort-order属性设置为"first"时,仅在第一个名字后使用了分隔符, +
      +
    • “Doe, J., and T. Williams”
    • +
    • “Doe, J., S. Smith and T. Williams”
    • +
  • +
  • “always” - 分隔符一直使用。 +
      +
    • 2 names: “J. Doe, and T. Williams”
    • +
    • 3 names: “J. Doe, S. Smith, and T. Williams”
    • +
  • +
  • “never” - 禁用分隔符 +
      +
    • 2 names: “J. Doe and T. Williams”
    • +
    • 3 names: “J. Doe, S. Smith and T. Williams”
    • +
  • +
+

et-al-min/et-al-use-first

+

通过设置这两个属性,可是使用et-al对名字列表进行缩写。如果名字变量中的名字的数目超过了et-al-min属性设置的值,则达到et-al-use-first设置的名称数量后,渲染的名字列表将被截断。"et-al"(或者"and others")术语用来添加到截断列表的后面(见et-al)。默认地,当名字列表被截断到单个名字,则名字和"et-al"术语之间使用空格进行隔开(例如:Doe et al.)。当一个名字列表被截断到两个或者三个名字,则使用分隔符(例如:Doe, Smith, et al.)。这些行为可以使用delimiter-precedes-et-al属性来设置。

+

et-al-subsequent-min/st-al-subsequent-use-first

+

如果使用了这两个属性,则属性的值分别替换et-al-minet-al-use-first的值以便后续引用。

+

et-al-use-last

+

当该属性设置为"true"时,(默认为"false"),则使用下面的格式:截断的名称列表,分隔符,省略号,名称列表最后一个名字。这个属性只能在名称列表有多余两个的名称时使用。例:

+
A. Goffeau, B. G. Barrell, H. Bussey, R. W. Davis, B. Dujon, H.
+Feldmann, … S. G. Oliver
+
+

下面讨论的属性将只会影响单个人的名字,这里先给出名字的组成部分。单个人的名字必须含有 “family” 部分,还可以含有 “given”,“suffix”,“non-dropping-particle”,和”dropping particle” 等部分。下面对这些部分分别进行解释:

+
    +
  • “family” - 姓氏,必须去掉 particle(译注:暂译为粒子)和后缀
  • +
  • “given” - 全名 “John Edward”或者 J. E.
  • +
  • “suffix” - 名字后缀,比如:外国人常用的 Jr 或者罗马数字(经常翻译为 xx世,比如伊丽莎白二世) “Jr.” in “John Smith Jr.” 或者 “III” in “Bill Gates III”
  • +
  • “non-dropping-particle” - 不可删除(省略)的粒子。当只显示姓氏的时候,不能省略(“de” in the Dutch surname “de Koning”) ,但是可能会在姓氏中分别对待,比如在排序的时候
  • +
  • “dropping-particle” - 可删除的粒子。当只显示姓氏的是欧,可以省略 (“van” in “Ludwig van Beethoven”, which becomes “Beethoven”)
  • +
+

下面的属性将会影响单个人的名称的渲染:

+

form

+

指定是否显示名字的所有部分(默认为"long"),或者只显示姓氏和不可省略粒子(值为"short")。除这两种情况外,还可以设置为"count",返回使用cs:names元素渲染的部分的总数(考虑et-al缩写和编辑/翻译等折叠的影响)。

+

initialize

+

当该属性设置为"false时(默认的结果为"true"),并且"initialize-with"属性被设置时,全名将不使用缩写。但是,如果在全名中有单独的大写字母的时候,仍然会添加`"initialize-with"的值。例如:当initialize设置为"false",并且initialize-with设置为"."时,James T kirk 将会变为 James T. Kirk。

+

initialize-with

+

当该实行被设置时,全名将会使用缩写。该属性将会在每个首字母后添加属性值,比如:上述的名字会变为 J.J. Doe。对于合成的全名,例如:Jean-luc,可以使用全局的带有连字符的initialize-with-hyphen属性来设置其缩写形式(见人名中的连字符)。

+

name-as-sort-order

+

指定名字的显示顺序为:姓,然后是名,例如:John Doe 变为 Doe,John。该属性值可以设置为:

+
    +
  • “first” - 属性只影响名字变量中的第一个名字
  • +
  • “all” - 属性将会影响所有的名字
  • +
+

注意:即使name-as-sort-order改变了名字内部的顺序,最终显示的顺序不一定与包含粒子和后缀的名字的相同(见名字内部顺序)。name-as-sort-order只影响以拉丁字母或者西里尔字母书写的名字。其他字母书写的名字(比如,亚洲的大部分名字)总是将全名中的姓显示在前面。

+

sort-separator

+

设置名字的不同部分由于name-as-sort-order属性导致的内部位置变换后的分隔符。默认值为","(Doe, John)。和name-as-sort-order属性相同,该属性只适用于拉丁字母和西里尔字母的名字。

+

cs:name元素也可以携带词缀格式化

+

3.8.5.2 名字内部顺序

+

名字内部各部分的顺序取决于cs:name元素中formname-as-sort-order属性和cs:style元素中的demote-non-droping-particle属性的设置。名称各部分的显示和排序的属性通常是不同的。下面将对名字顺序进行简单的介绍:

+

拉丁/西里尔名字的显示顺序

+
+

条件:form属性设置为"long"

+

顺序:1. 名 2. 可省略粒子 3. 不可省略粒子 4. 姓 5. 后缀

+

示例:Jean de La Fontaine III

+
+

条件:form属性设置为"long"name-as-sort-order属性激活,demote-non-dropping-particle属性设置为"never"或者"sort-only"

+

顺序:1. 不可省略粒子 2. 姓 3. 名 4. 可省略粒子 5. 后缀

+

示例:La Fontaine, Jean de, III

+
+

条件:form属性设置为"long"name-as-sort-order属性激活,demote-non-dropping-particle属性设置为"display-and-sort"

+

顺序:1. 姓 2. 名 3. 可省略粒子 4. 不可省略粒子 5. 后缀

+

示例:Fontaine, Jean de La III

+
+

条件:form属性设置为"short"

+

顺序:1. 不可省略粒子 2. 姓

+

示例:La Fontaine

+
+

拉丁/西里尔名字的排序顺序

+
+

条件:demote-non-dropping-particle属性设置为"never"

+

顺序:1. 不可省略粒子+姓 2. 可省略粒子 3. 名 4. 后缀

+

示例:La Fontaine de Jean III

+
+

条件:demote-non-dropping-particle属性设置为"sort-only"或者"display-and-sort"

+

顺序:1. 姓 2. 可省略粒子+不可省略粒子 3. 名 4. 后缀

+

示例:Fontaine de La Jean III

+
+

非拉丁和非西里尔名字的显示和排序顺序

+
+

条件:form属性设置为"long"

+

顺序:1. 姓 2. 名

+

示例:张三 或者 Zhang San

+
+

条件:form属性设置为"short"

+

顺序:1. 姓

+

示例:张 或者 Zhang

+
+

3.8.5.3 名字格式化

+

cs:name元素可能会携带一个或者两个cs:name-part子元素来对名字的小部分进行特定的格式化。cs:name-part必须携带name属性,设置为"given"或者"family"

+

如果设置为"given"cs:name-part元素的格式化文字大小写属性会影响"given""dropping-particle"部分。词缀出现在"given"左右,将该部分扩起来。

+

如果设置为"family"cs:name-part元素的格式化文字大小写属性会影响"given""non-dropping-particle"部分。词缀出现在"family"左右,将该部分扩起来。

+

"suffix"部分不受 name-part 部分格式限制。cs:name-part元素不影响 name-part 渲染的顺序。下面的代码,将产生类似 Jane DOE 的效果:

+
<names variable="author">
+  <name>
+    <name-part name="family" text-case="uppercase"/>
+  </name>
+</names>
+

3.8.5.4 Et-al

+

Et-al 缩写通过et-al-...属性来控制(见Name),同时也可以使用可选的cs:et-al元素设置,cs:et-al元素必须放在cs:name元素后。term属性可以被设置为"et-al"(默认)或者"and others"格式化属性可以用来设置 et-al 的格式,下面是 "et-al"术语的一个例子:

+
<names variable="author">
+  <et-al term="and others" font-style="italic"/>
+</names>
+

3.8.5.5 Substitute

+

可选的cs:substitute元素,是cs:names的子元素,且必须是最后一个子元素,在父元素cs:names中指定的名称变量为空时添加替换。替换必须放在cs:substitute元素中,并且必须包含一个或者多个渲染元素(除cs:layout)。cs:names的简洁版本没有子元素,继承了cs:names元素中在cs:namecs:et-al子元素的属性值。如果cs:substitute元素包含了多个子元素,第一个非空的元素用于替换。替换变量在输出的其余部分被抑制,以防止重复。下面的例子中:"author"名称变量为空时,就被"editor"名称变量替换,在没有 editor 时,则使用"title"宏替换。

+
<macro name="author">
+  <names variable="author">
+    <substitute>
+      <names variable="editor"/>
+      <text macro="title"/>
+    </substitute>
+  </names>
+</macro>
+

3.8.5.6 Label in cs:names

+

cs:label元素是可选的(见Label),而且必须位于cs:namecs:et-al元素后,在cs:substitute元素前。当cs:label作为cs:names元素的子元素时,cs:label不能携带variable属性,而是使用父元素cs:names中的变量。第二个区别是:form属性可以设置为"verb"或者"verb-short",其所有允许的值为:

+
    +
  • “long” - (默认), 例如, “editor”术语渲染为”editor” 和 “editors”
  • +
  • “short” - 例如,“editor”术语渲染为”ed.” 和 “eds”
  • +
  • “verb” - 例如,“editor”术语渲染为”edited by”
  • +
  • “verb-short” - 例如,“editor”术语渲染为”ed.”
  • +
  • “symbol” - 例如,“section”术语渲染为 “§” 和 “§§”
  • +
+

3.8.6 Label

+

cs:label渲染元素输出与所选变量匹配的术语,该属性必须设置为”locator”、“page”或数字变量之一。只有当选择的变量是非空的时候,术语才会渲染。例如:

+
<group delimiter=" ">
+  <label variable="page"/>
+  <text variable="page"/>
+</group>
+

可以生成"page 3"或者"pages 5-7"cs:label可能会携带下面的属性:

+

form

+

​ 选择术语的形式,可以设置为下面的值:

+
    +
  • “long” - (默认), 例如: “page” 术语渲染为”page”/“pages”
  • +
  • “short” - 例如: “page” 术语渲染为”p.”/“pp.”
  • +
  • “symbol” - 例如: “section” 术语渲染为 “§”/“§§”
  • +
+

plural

+

​ 设置术语的复数形式,可以使用下面的值:

+
    +
  • “contextual” - (默认),复数形式的渲染和具体的内容相匹配。当内容中包含多个数字时,使用复数形式。如下面的渲染结果:“page 1”,“pages 1-3”,“volume 2”,“volumes 2 & 4”。或者在使用number-of-pagesnumber-of-volumes时,数字大于1,例如: (“1 volume” 和 “3 volumes”。
  • +
  • “always” - 总是使用复数形式,不管具体的内容如何。例如:“pages 1” 和 “pages 1-3”
  • +
  • “never” - 禁止使用复数形式,不管具体内容: “page 1”和”page 1-3”
  • +
+

cs:label也可能会携带affixes, formatting, text-casestrip-periods 属性。

+

3.8.7 Group

+

cs:group元素必须包含一个或者多个渲染元素(除了 cs:layout)。cs:group可以携带delimiter属性来分隔子元素以及affixesdisplayformatting属性。cs:group隐含的条件,当以下情况出现时,cs:group和它的子元素将会被抑制:a)在cs:group中至少一个渲染元素调用了变量(直接地或者通过宏调用),b)所有被调用得变量都为空。

+
<layout>
+  <group delimiter=" ">
+    <text term="retrieved"/>
+    <text term="from"/>
+    <text variable="URL"/>
+  </group>
+</layout>
+

上述代码可以生成"retrieved from http://dx.doi.org/10.1128/AEM.02591-07"类似得结果,但是当URL为空的时候,不生成结果。

+

3.8.8 Choose

+

cs:choose元素允许有条件的渲染元素。下面的例子的意思为:在"issud"日期变量存在的情况下,就实施渲染,如果不存在,就给出"no date"术语:

+
<choose>
+  <if variable="issued">
+    <date variable="issued" form="numeric"/>
+  </if>
+  <else>
+    <text term="no date"/>
+  </else>
+</choose>
+

cs:choose元素中必须还有cs:if子元素,后面还可以有一个或者多个cs:else-if子元素以及一个可选的用来结尾的cs:else元素。cs:ifcs:else-if元素可能回包含任意个除cs:layout的渲染元素。由于空的cs:else元素是多余的,所以cs:else元素必须至少包含一个渲染元素。cs:ifcs:else-if元素必须含有一个或多个判断条件,这些条件可以使用下买的属性设置:

+

disambiguate

+

​ 当改属性设置为"true"(唯一允许的值)的时候,在元素内容消除了两个相同的引用时渲染。当所有其他消除歧义的方法都不能识别唯一的目标时,才进行消除歧义的尝试。

+

is-numeric

+

​ 测试给定的变量(附录IV 变量)是不是包含数字部分。如果内容仅由数字构成,则识别为数字。数字可以带有前缀、后缀(“D2”,“2b”,“L2d”)、并且可能被逗号,连字符或&分隔(“2, 3”,“2-4”,“2 & 4”)。 例如, “2nd”被识别为 “true” ,但 “second”和”2nd edition”被识别为”false”.

+

is-uncertain-date

+

​ 判断给定的日期变量是不是包含近似日期

+

locator

+

​ 判断位置是不是和给定的位置符合。这里的位置主要是在一个文档中的位置,比如,题目,第几段。使用 “sub-verbo”判断是不是”sub-verbo”类型

+

position

+

​ 判断引用的位置湿否和给定的位置匹配。当在cs:bibliography中调用时,position的结果为”false”。位置可以使用下面的选项测试:

+
    +
  • “first”: 第一个引用项的位置

  • +
  • “ibid”/“ibid-with-locator”/“subsequent”: 引用先前引用的项目的引用,Such cites may also have the “ibid” or “ibid-with-locator” position when:

    +
      +
    1. the current cite immediately follows on another cite, within the same citation, that references the same item
    2. +
    +

    or

    +
      +
    1. the current cite is the first cite in the citation, and the previous citation consists of a single cite referencing the same item
    2. +
    +

    If either requirement is met, the presence of locators determines which position is assigned:

    +
      +
    • Preceding cite does not have a locator: if the current cite has a locator, the position of the current cite is “ibid-with-locator”. Otherwise the position is “ibid”.
    • +
    • Preceding cite does have a locator: if the current cite has the same locator, the position of the current cite is “ibid”. If the locator differs the position is “ibid-with-locator”. If the current cite lacks a locator its only position is “subsequent”.
    • +
  • +
  • “near-note”: position of a cite following another cite referencing the same item. Both cites have to be located in foot or endnotes, and the distance between both cites may not exceed the maximum distance (measured in number of foot or endnotes) set with the near-note-distance option (see Note Distance).

  • +
+

Whenever position=“ibid-with-locator” tests true, position=“ibid” also tests true. And whenever position=“ibid” or position=“near-note” test true, position=“subsequent” also tests true.

+

type

+

​ 测试项目是不是和给定的类型匹配(附录 III 类型)。这里的类型指条目的类型,例如,书,期刊文献,学位论文。

+

variable

+

​ 测试给定变量(附录IV 变量)的默认的形式(long)是不是为空。

+
+

除了disambiguate外,所有的条件都允许有多个测试值,多个测试值使用空格分隔(“book thesis”)。

+

cs:if元素和cs:else-if元素可能会携带match属性用来控制判断的逻辑,match可设置的值为:

+
    +
  • “all” - 默认,仅当所有给定测试值都为 true 的时候结果才为 true
  • +
  • “any” - 当任意一个值为 true 的时候,结果就为 true
  • +
  • “none” - 当没有值测试为 true 的时候,结果为 true
  • +
+ + + + + +
+
+
+ CC BY-NC-SA 4.0 + Mao Zhou +
+
+
+ + \ No newline at end of file diff --git "a/\347\220\206\350\247\243-csl-\346\240\274\345\274\217.html" "b/\347\220\206\350\247\243-csl-\346\240\274\345\274\217.html" new file mode 100644 index 0000000..ffeb024 --- /dev/null +++ "b/\347\220\206\350\247\243-csl-\346\240\274\345\274\217.html" @@ -0,0 +1,387 @@ + + + + + + + 理解 CSL 格式 - CSL_Chinese + + + + + + + + + + + + + + +
+ + +
+

1.5 理解 CSL 格式

+

到现在为止,我们已经知道什么是 CSL 、怎么使用它、以及它怎么运作的。接下来我们将深入到 CSL 文件内部,分析它的 XML 代码。XML基础.md 文件中简单介绍了 XML ,看完后可以读懂并编辑简单的 XML 文件。如果想更多的了解 XML ,可以在网上查找 XML 教程。

+

1.5.1 从属格式解析

+

下面是一个 CSL 从属格式文件:

+
<?xml version="1.0" encoding="utf-8"?>
+<style xmlns="http://purl.org/net/xbiblio/csl" version="1.0" default-locale="en-US">
+  <!-- Generated with https://github.com/citation-style-language/utilities/tree/master/generate_dependent_styles/data/asm -->
+  <info>
+    <title>Applied and Environmental Microbiology</title>
+    <id>http://www.zotero.org/styles/applied-and-environmental-microbiology</id>
+    <link href="http://www.zotero.org/styles/applied-and-environmental-microbiology" rel="self"/>
+    <link href="http://www.zotero.org/styles/american-society-for-microbiology" rel="independent-parent"/>
+    <link href="http://aem.asm.org/" rel="documentation"/>
+    <category citation-format="numeric"/>
+    <category field="biology"/>
+    <issn>0099-2240</issn>
+    <eissn>1098-5336</eissn>
+    <updated>2014-04-30T03:45:36+00:00</updated>
+    <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
+  </info>
+</style>
+

XML基础.md文件中的描述:一行给出了 XML 的声明。根元素为style,其中包含了一个子元素infoinfo元素中又包含了很多元素,其中很多元素都有内容和属性。xmlns、versiondefaults-locale都是元素style的属性,分别指定了??、版本和使用的语言,这里为美国英语。

+

大多数从属格式都是电子表格自动生成的,下面的注释也给出了指向电子表格的联接。

+
 <!-- Generated with https://github.com/citation-style-language/utilities/tree/master/generate_dependent_styles/data/asm -->
+

元素info里包含了大多数style的元数据,比如:

+

style的题目(也是期刊的题目):

+
<title>Applied and Environmental Microbiology</title>
+

样式的ID,是文献管理软件用来区分不同style的标志:

+
<id>http://www.zotero.org/styles/applied-and-environmental-microbiology</id>
+

style自己的链接。该链接指向了网上的副本。

+
<link href="http://www.zotero.org/styles/applied-and-environmental-microbiology" rel="self"/>
+

从属格式需要指定它的父格式,父格式为独立格式。这里的父格式为 American Society for Microbiology

+
<link href="http://www.zotero.org/styles/american-society-for-microbiology" rel="independent-parent"/>
+

为了更好的维护格式,因此需要指定格式的文档链接。这里文档的链接转到了期刊的主页。

+
<link href="http://aem.asm.org/" rel="documentation"/>
+

为了便于分类,还可以在category元素中设置它的属性。这里分别设置了引用格式为numeric,领域为biology

+
<category citation-format="numeric"/>
+<category field="biology"/>
+

当期刊创建格式的时候,可以在issn元素和eissn元素中保存其打印标准国际连续出版物号(ISSN)和其电子版本(ESSIN)

+
<issn>0099-2240</issn>
+<eissn>1098-5336</eissn>
+

updated元素保存了最后一次更新的时间戳:

+
<updated>2014-04-30T03:45:36+00:00</updated>
+

rights元素中保存了该CSL格式的证书:

+
<rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
+

1.5.2 独立格式解析

+

下面是一个独立格式的实例,实例中定义了引用格式,所以要比从属格式要大一些。这里的示例只是一个简化的例子,实际的格式比这个还要大很多。但这个简化的例子仍然是完整有效的。

+
<?xml version="1.0" encoding="utf-8"?>
+<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0">
+  <info>
+    <title>Example Style</title>
+    <id>http://www.zotero.org/styles/example</id>
+    <link href="http://www.zotero.org/styles/example" rel="self"/>
+    <link href="http://www.zotero.org/styles/apa" rel="template"/>
+    <link href="http://www.example.com/style-guide/" rel="documentation"/>
+    <author>
+      <name>John Doe</name>
+      <email>JohnDoe@example.com</email>
+    </author>
+    <contributor>
+      <name>Jane Doe</name>
+    </contributor>
+    <contributor>
+      <name>Bill Johnson</name>
+    </contributor>
+    <category citation-format="author-date"/>
+    <category field="science">
+    <updated>2014-10-15T18:17:09+00:00</updated>
+    <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
+  </info>
+  <locale xml:lang="en">
+    <terms>
+      <term name="no date">without date</term>
+    </terms>
+  </locale>
+  <macro name="author">
+    <names variable="author">
+      <name initialize-with="."/>
+    </names>
+  </macro>
+  <macro name="issued-year">
+    <choose>
+      <if variable="issued">
+        <date variable="issued">
+          <date-part name="year"/>
+        </date>
+      </if>
+      <else>
+        <text term="no date"/>
+      </else>
+    </choose>
+  </macro>
+  <citation et-al-min="3" et-al-use-first="1">
+    <sort>
+      <key macro="author"/>
+      <key macro="issued-year"/>
+    </sort>
+    <layout prefix="(" suffix=")" delimiter="; ">
+      <group delimiter=", ">
+        <text macro="author"/>
+        <text macro="issued-year"/>
+      </group>
+    </layout>
+  </citation>
+  <bibliography>
+    <sort>
+      <key macro="author"/>
+      <key macro="issued-year"/>
+      <key variable="title"/>
+    </sort>
+    <layout suffix="." delimiter=", ">
+      <group delimiter=". ">
+        <text macro="author"/>
+        <text macro="issued-year"/>
+        <text variable="title"/>
+        <text variable="container-title"/>
+      </group>
+      <group>
+        <text variable="volume"/>
+        <text variable="issue" prefix="(" suffix=")"/>
+      </group>
+      <text variable="page"/>
+    </layout>
+  </bibliography>
+</style>
+

1.5.2.1 结构

+

首先看一下根元素style的子元素。

+
<?xml version="1.0" encoding="utf-8"?>
+<style>
+  <info/>
+  <locale/>
+  <macro/>
+  <macro/>
+  <citation/>
+  <bibliography/>
+</style>
+

相比于从属格式只有info一个子元素,独立格式的根元素有除了info·以外,还有locale 、 macro 、citation、bibliography四个子元素。

+

这些子元素的作用分别是:

+
    +
  • info 该元素在独立格式中的作用和从属格式中相同,都是用来保存基本的格式元数据。

  • +
  • locale 该元素可以用来从locale file中重写 locale data

  • +
  • macro 用来存储 CSL 代码,这些代码可能应用在 citation 、bibliography或者其他的 macro 元素中。

  • +
  • citation 定义文中引用的格式。

  • +
  • bibliography 定义参考文献目录的格式。

  • +
+

以下从style根元素开始分析。

+

1.5.2.2 根元素/style元素

+
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0">
+  ...
+</style>
+

在从属格式中我们已经了解了xmlnsversion属性,class是新的属性,用来告诉CSL processor(CSL处理器)使用的引用格式是什么。

+

1.5.2.3 info元素

+

独立格式的元数据通常比从属格式的元数据更加全面:

+
<info>
+  <title>Example Style</title>
+  <id>http://www.zotero.org/styles/example</id>
+  <link href="http://www.zotero.org/styles/example" rel="self"/>
+  <link href="http://www.zotero.org/styles/apa" rel="template"/>
+  <link href="http://www.example.com/style-guide/" rel="documentation"/>
+  <author>
+    <name>John Doe</name>
+    <email>JohnDoe@example.com</email>
+  </author>
+  <contributor>
+    <name>Jane Doe</name>
+  </contributor>
+  <contributor>
+    <name>Bill Johnson</name>
+  </contributor>
+  <category citation-format="author-date"/>
+  <category field="science">
+  <updated>2014-10-15T18:17:09+00:00</updated>
+  <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
+</info>
+

title、style ID、"self" link、categories、time stamp、license和从属格式作用都是相同的,但有些许差别。首先,独立格式不依赖父格式,通常是提供一个template(模板)链接,表明当前的独立格式是以模板格式链接创建的(这样写的原因是,通常情况下,凭空写一个 CSL 比较困难,但是借助一个模板改写则容易的多)。这里的模板是APA style。此外,info还倾向于给定一个或者多个document链接,用来指向引文格式的在线描述。

+

为了致谢 CSL 格式的创建者,他们的名字和联系方式也可以添加到格式文件中。在当前的例子中,有一个作者和两个贡献者。作者通常完成了创建格式的大部分工作,贡献者一般只提供了一些小的改进。

+

1.5.2.4 citation元素和macro元素

+

接下来分析macroscitation元素。citation元素用来描述引用的格式。

+
<macro name="author">
+  <names variable="author">
+    <name initialize-with="."/>
+  </names>
+</macro>
+<macro name="issued-year">
+  <choose>
+    <if variable="issued">
+      <date variable="issued">
+        <date-part name="year"/>
+      </date>
+    </if>
+    <else>
+      <text term="no date"/>
+    </else>
+  </choose>
+</macro>
+<citation et-al-min="3" et-al-use-first="1">
+  <sort>
+    <key macro="author"/>
+    <key macro="issued-year"/>
+  </sort>
+  <layout prefix="(" suffix=")" delimiter="; ">
+    <group delimiter=", ">
+      <text macro="author"/>
+      <text macro="issued-year"/>
+    </group>
+  </layout>
+</citation>
+

上面的代码可以生成类似“(A.C. Smith et al., 2002; W. Wallace, J. Snow, 1999)”这样的格式。为了理解这种引用格式在 CSL 中式如何编码的,要先分析citation元素中的layout元素。layout元素中的prefixsuffixdelimiter属性分别定义了前缀(这里为(),后缀(这里为))以及条目分隔符(这里为;)。也就是说整个条目要放在圆括号中,条目之间以;分隔。每个条目的格式在layout元素的内容中定义。其内容中的group元素包括了authorissue-year macros,并且以,分隔。

+

macro元素是一种辅助元素,在其他元素或者其他macro元素中使用。通过其名字也可以看出,其与其他语言中的__宏__类似,这里暂不翻译。每个macro都含有name属性。

+

注:以下为了方便描述,将对应的macro元素直接以name指代,例:nameauthormacro元素直接称为author元素。

+

`author元素的name的属性指定了名称,variable属性保存了具体的作者值,initialize-with表明作者值为首字母缩写,每个首字母后面为.

+

issued-year元素以分支语句开始,分支语句以choose元素定义,其中包含ifelse元素。如果参考文献有日期,则保存在issued变量中,如果issued-year元素被引用,日期的年份将被印出,否则就印出no date

+

layout元素中的group元素的author 用来印出在author元素中存储的值,issued-year则用来印出issued-year元素储存的值。

+

为什么不直接把macro中的内容放在citation元素中呢?使用macro有什么好处呢?在上面的例子中,macro的使用简化了citation元素的结构。此外,上述的两个macro总共被调用了4次(两次在 citation元素中,两次在bibliography元素中),如果不使用macro,必须多次重复这些代码。因此macro的使用提供了更紧凑的样式。

+

再看citation元素,其中含有两个属性et-al-minet-al-use-first。这里的值分别为3、1,表示作者大于等于3个的时候,使用印出第一个作者,后面跟et al术语。

+

citation元素中还包括了sort元素,其中包括了两个key元素,用来表明引用的排列顺序。第一个key元素中引用了author宏,第二个宏引用了issued-year宏,表明,先按作者作者字母排序,然后按文献发表年份排序。

+

1.5.2.5 bibliography元素

+

citation元素定义了引用的格式,bibliography定义了参考文献条目的格式。

+
<macro name="author">
+  <names variable="author">
+    <name initialize-with="."/>
+  </names>
+</macro>
+<macro name="issued-year">
+  <choose>
+    <if variable="issued">
+      <date variable="issued">
+        <date-part name="year"/>
+      </date>
+    </if>
+    <else>
+      <text term="no date"/>
+    </else>
+  </choose>
+</macro>
+...
+<bibliography>
+  <sort>
+    <key macro="author"/>
+    <key macro="issued-year"/>
+    <key variable="title"/>
+  </sort>
+  <layout suffix="." delimiter=", ">
+    <group delimiter=". ">
+      <text macro="author"/>
+      <text macro="issued-year"/>
+      <text variable="title"/>
+      <text variable="container-title"/>
+    </group>
+    <group>
+      <text variable="volume"/>
+      <text variable="issue" prefix="(" suffix=")"/>
+    </group>
+    <text variable="page"/>
+  </layout>
+</bibliography>
+

上述的例子中的bibliography实际上只适用于一种类型:期刊文章。它生成的条目的格式是:

+
+

A.C. Smith, D. Williams, T. Johnson. 2002. Story of my life. Journal of Biographies, 12(2), 24—27. W. Wallace, J. Snow. 1999. Winter is coming. Journal of Climate Dynamics, 6(9), 97—102.

+
+

我们怎么定义这种格式呢?首先,bibliography元素的结构和citation元素很相似,不同的是,这里的layout元素用来定义参考文献条目的格式。除了给出authorissued-year,参考文献条目还需要给出每个条目的titlecontainer-title(对期刊文章来说,就是期刊的名称)、volumeissuepage。这里layout元素使用属性suffixdelimiter分别指定了group的后缀为.,以及group之间的分隔符为,

+

citation元素相同,bibliography也包括了一个sort元素,用来对参考文献条目进行排序。这里的三个key分别为authorissued-yeartitle

+

1.5.2.6 locale 元素

+

最后介绍的是loacle元素。正如上面写道的,CSL locale file允许 CSL 样式快速转换为不同的语言。但是,有时需要覆盖默认翻译。

+
<locale xml:lang="en">
+  <terms>
+    <term name="no date">without date</term>
+  </terms>
+</locale>
+

对 US English 来说,"no date"项的内容就是"no date"。但是在我们的例子中,我们想使用"without date"去替换它。为了重写默认的翻译,我们可以使用类似上面的locale元素。对一个没有日期的条目来说,这种重写会导致引用变为像(D. Williams, without date)这样的格式。

+

localexml:lang属性被设置为en,这告诉CSL 样式当样式被用于英语写作的时候,重写"no date"。如果我们在德语写作的时候使用该 CSL ,该样式将会依据German locale file印出德语的翻译(ohne Datum)

+ + +
+ +
+ + +
+
+
+ CC BY-NC-SA 4.0 + Mao Zhou +
+
+
+ + \ No newline at end of file diff --git "a/\347\277\273\350\257\221\344\271\240\346\203\257.html" "b/\347\277\273\350\257\221\344\271\240\346\203\257.html" new file mode 100644 index 0000000..9d83053 --- /dev/null +++ "b/\347\277\273\350\257\221\344\271\240\346\203\257.html" @@ -0,0 +1,122 @@ + + + + + + + 翻译习惯 - CSL_Chinese + + + + + + + + + + + + + + +
+ + +
+

3.3 翻译习惯

+

这里将列出一些常用的术语的翻译,但只是本人自己的理解,并不能保证翻译的准确性。后文的描述中可能会使用英文或者中文翻译。

+

locale files/locale 本地化文件

+

styles 样式/格式

+

citation 引文

+

macro 宏

+ + +
+ +
+ + +
+
+
+ CC BY-NC-SA 4.0 + Mao Zhou +
+
+
+ + \ No newline at end of file diff --git "a/\350\275\254\346\215\242-locale-files.html" "b/\350\275\254\346\215\242-locale-files.html" new file mode 100644 index 0000000..bb41dca --- /dev/null +++ "b/\350\275\254\346\215\242-locale-files.html" @@ -0,0 +1,117 @@ + + + + + + + 转换 Locale Files - CSL_Chinese + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git "a/\351\231\204\345\275\225i-\345\255\246\347\247\221\345\210\206\347\261\273.html" "b/\351\231\204\345\275\225i-\345\255\246\347\247\221\345\210\206\347\261\273.html" new file mode 100644 index 0000000..c1879be --- /dev/null +++ "b/\351\231\204\345\275\225i-\345\255\246\347\247\221\345\210\206\347\261\273.html" @@ -0,0 +1,145 @@ + + + + + + + 附录I 学科分类 - CSL_Chinese + + + + + + + + + + + + + + +
+ + +
+

3.10 附录I 学科分类

+
    +
  • anthropology 人类学
  • +
  • astronomy 天文学
  • +
  • biology 生物学
  • +
  • botany 植物学
  • +
  • chemistry 化学
  • +
  • communications 通讯
  • +
  • engineering 工程学
  • +
  • generic-base - used for generic styles like Harvard and APA 通用基础-用于通用样式,像哈弗和APA
  • +
  • geography 地理学
  • +
  • geology 地质学
  • +
  • history 历史
  • +
  • humanities 人文学科
  • +
  • law 法学
  • +
  • linguistics 语言学
  • +
  • literature 文学
  • +
  • math 数学
  • +
  • medicine 药物学
  • +
  • philosophy 哲学
  • +
  • physics 物理学
  • +
  • political_science 政治科学
  • +
  • psychology 心理学
  • +
  • science 科学
  • +
  • social_science 社会科学
  • +
  • sociology 社会学
  • +
  • theology 神学
  • +
  • zoology 动物学
  • +
+ + +
+ +
+ + +
+
+
+ CC BY-NC-SA 4.0 + Mao Zhou +
+
+
+ + \ No newline at end of file diff --git "a/\351\231\204\345\275\225ii-\346\234\257\350\257\255.html" "b/\351\231\204\345\275\225ii-\346\234\257\350\257\255.html" new file mode 100644 index 0000000..c1105ca --- /dev/null +++ "b/\351\231\204\345\275\225ii-\346\234\257\350\257\255.html" @@ -0,0 +1,230 @@ + + + + + + + 附录II 术语 - CSL_Chinese + + + + + + + + + + + + + + +
+ + +
+

3.11 附录II 术语

+

术语在本地化文件中使用

+

3.11.1 Locators/用来定位的术语

+
    +
  • book 书
  • +
  • chapter 章
  • +
  • column
    +
  • +
  • figure 图
  • +
  • folio 作品集
  • +
  • issue 议题/问题
  • +
  • line 行
  • +
  • note 笔记/注记
  • +
  • opus 作品(音乐作品)
  • +
  • page 页
  • +
  • paragraph 段
  • +
  • part 部分
  • +
  • section 节
  • +
  • sub verbo 词条
  • +
  • verse 诗
  • +
  • volume 卷
  • +
+

3.11.2 Months/月

+
    +
  • month-01
  • +
  • month-02
  • +
  • month-03
  • +
  • month-04
  • +
  • month-05
  • +
  • month-06
  • +
  • month-07
  • +
  • month-08
  • +
  • month-09
  • +
  • month-10
  • +
  • month-11
  • +
  • month-12
  • +
+

3.11.3 Ordinals/序数

+
    +
  • ordinal
  • +
  • ordinal-00 through ordinal-99
  • +
  • long-ordinal-01
  • +
  • long-ordinal-02
  • +
  • long-ordinal-03
  • +
  • long-ordinal-04
  • +
  • long-ordinal-05
  • +
  • long-ordinal-06
  • +
  • long-ordinal-07
  • +
  • long-ordinal-08
  • +
  • long-ordinal-09
  • +
  • long-ordinal-10
  • +
+

3.11.4 Quotation marks/引号

+
    +
  • open-quote
  • +
  • close-quote
  • +
  • open-inner-quote
  • +
  • close-inner-quote
  • +
+

3.11.5 Roles/角色

+
    +
  • author 作者
  • +
  • collection-editor 文集编辑
  • +
  • composer 作曲者
  • +
  • container-author 文章作者
  • +
  • director 主任/导演
  • +
  • editor 编辑
  • +
  • editorial-director 编辑部主任
  • +
  • editortranslator
  • +
  • illustrator 插画者
  • +
  • interviewer 采访者
  • +
  • original-author 原作者
  • +
  • recipient 收件人
  • +
  • reviewed-author 复查作者
  • +
  • translator 译者
  • +
+

3.11.6 Seasons/季节

+
    +
  • season-01
  • +
  • season-02
  • +
  • season-03
  • +
  • season-04
  • +
+

3.11.7 Miscellaneous/其他

+
    +
  • accessed
  • +
  • ad
  • +
  • and
  • +
  • and others
  • +
  • anonymous
  • +
  • at
  • +
  • available at
  • +
  • bc
  • +
  • by
  • +
  • circa
  • +
  • cited
  • +
  • edition
  • +
  • et-al
  • +
  • forthcoming
  • +
  • from
  • +
  • ibid
  • +
  • in
  • +
  • in press
  • +
  • internet
  • +
  • interview
  • +
  • letter
  • +
  • no date
  • +
  • online
  • +
  • presented at
  • +
  • reference
  • +
  • retrieved
  • +
  • scale
  • +
  • version
  • +
+ + + + + +
+
+
+ CC BY-NC-SA 4.0 + Mao Zhou +
+
+
+ + \ No newline at end of file diff --git "a/\351\231\204\345\275\225iii-\346\226\207\347\214\256\347\261\273\345\236\213.html" "b/\351\231\204\345\275\225iii-\346\226\207\347\214\256\347\261\273\345\236\213.html" new file mode 100644 index 0000000..8d7fa5c --- /dev/null +++ "b/\351\231\204\345\275\225iii-\346\226\207\347\214\256\347\261\273\345\236\213.html" @@ -0,0 +1,155 @@ + + + + + + + 附录III 文献类型 - CSL_Chinese + + + + + + + + + + + + + + +
+ + +
+

3.12 附录III 文献类型

+
    +
  • article 文章
  • +
  • article-magazine 杂志文章
  • +
  • article-newspaper 新闻文章
  • +
  • article-journal 期刊文章
  • +
  • bill
  • +
  • book 书
  • +
  • broadcast
  • +
  • chapter 章节
  • +
  • dataset 数据集
  • +
  • entry
  • +
  • entry-dictionary
  • +
  • entry-encyclopedia
  • +
  • figure 图
  • +
  • graphic
  • +
  • interview 采访
  • +
  • legislation
  • +
  • legal_case
  • +
  • manuscript
  • +
  • map 地图
  • +
  • motion_picture
  • +
  • musical_score
  • +
  • pamphlet
  • +
  • paper-conference
  • +
  • patent
  • +
  • post 海报
  • +
  • post-weblog
    +
  • +
  • personal_communication 私人交流
  • +
  • report 报告
  • +
  • review
  • +
  • review-book
  • +
  • song 歌曲
  • +
  • speech 演讲
  • +
  • thesis 学位论文
  • +
  • treaty
  • +
  • webpage 网页
  • +
+ + + + + +
+
+
+ CC BY-NC-SA 4.0 + Mao Zhou +
+
+
+ + \ No newline at end of file diff --git "a/\351\231\204\345\275\225iv-\345\217\230\351\207\217.html" "b/\351\231\204\345\275\225iv-\345\217\230\351\207\217.html" new file mode 100644 index 0000000..fb30d69 --- /dev/null +++ "b/\351\231\204\345\275\225iv-\345\217\230\351\207\217.html" @@ -0,0 +1,256 @@ + + + + + + + 附录IV 变量 - CSL_Chinese + + + + + + + + + + + + + + +
+ + +
+

3.13 附录IV 变量

+

3.13.1 标准变量

+
    +
  • abstract 项目的摘要(例:期刊文章的摘要)

  • +
  • annote 读者关于项目内容的笔记

  • +
  • archive 保存项目的存档

  • +
  • archive_location 存档的位置

  • +
  • archive-place 存档的地理位置

  • +
  • authority

  • +
  • call-number

    +

    call number (to locate the item in a library)

  • +
  • citation-label

    +

    label identifying the item in in-text citations of label styles (e.g. “Ferr78”). May be assigned by the CSL processor based on item metadata.

  • +
  • citation-number

    +

    index (starting at 1) of the cited reference in the bibliography (generated by the CSL processor)

  • +
  • collection-title

    +

    title of the collection holding the item (e.g. the series title for a book)

  • +
  • container-title

    +

    title of the container holding the item (e.g. the book title for a book chapter, the journal title for a journal article)

  • +
  • container-title-short

    +

    short/abbreviated form of “container-title” (also accessible through the “short” form of the “container-title” variable)

  • +
  • dimensions

    +

    physical (e.g. size) or temporal (e.g. running time) dimensions of the item

  • +
  • DOI

    +

    Digital Object Identifier (e.g. “10.1128/AEM.02591-07”)

  • +
  • event

    +

    name of the related event (e.g. the conference name when citing a conference paper)

  • +
  • event-place

    +

    geographic location of the related event (e.g. “Amsterdam, the Netherlands”)

  • +
  • first-reference-note-number

    +

    number of a preceding note containing the first reference to the item. Assigned by the CSL processor. The variable holds no value for non-note-based styles, or when the item hasn’t been cited in any preceding notes.

  • +
  • genre

    +

    class, type or genre of the item (e.g. “adventure” for an adventure movie, “PhD dissertation” for a PhD thesis)

  • +
  • ISBN

    +

    International Standard Book Number

  • +
  • ISSN

    +

    International Standard Serial Number

  • +
  • jurisdiction

    +

    geographic scope of relevance (e.g. “US” for a US patent)

  • +
  • keyword 关键字

  • +
  • locator

    +

    a cite-specific pinpointer within the item (e.g. a page number within a book, or a volume in a multi-volume work). Must be accompanied in the input data by a label indicating the locator type (see the Locators term list), which determines which term is rendered by cs:label when the “locator” variable is selected.

  • +
  • medium

    +

    medium description (e.g. “CD”, “DVD”, etc.)

  • +
  • note

    +

    (short) inline note giving additional item details (e.g. a concise summary or commentary)

  • +
  • original-publisher

    +

    original publisher, for items that have been republished by a different publisher

  • +
  • original-publisher-place

    +

    geographic location of the original publisher (e.g. “London, UK”)

  • +
  • original-title 最初版本的题目

  • +
  • page 项目的页码范围

  • +
  • page-first 页码范围的第一个页码

  • +
  • PMCID

    +

    PubMed Central reference number

  • +
  • PMID

    +

    PubMed reference number

  • +
  • publisher 出版商/出版社

  • +
  • publisher-place 出版社的地理位置

  • +
  • references

    +

    resources related to the procedural history of a legal case

  • +
  • reviewed-title

    +

    title of the item reviewed by the current item

  • +
  • scale

    +

    scale of e.g. a map

  • +
  • section

    +

    container section holding the item (e.g. “politics” for a newspaper article)

  • +
  • source

    +

    from whence the item originates (e.g. a library catalog or database)

  • +
  • status

    +

    (publication) status of the item (e.g. “forthcoming”)

  • +
  • title

    +

    primary title of the item

  • +
  • title-short

    +

    short/abbreviated form of “title” (also accessible through the “short” form of the “title” variable)

  • +
  • URL 链接

  • +
  • version 版本

  • +
  • year-suffix

    +

    disambiguating year suffix in author-date styles (e.g. “a” in “Doe, 1999a”)

  • +
+

3.13.2 数据变量

+

Number variables are a subset of the Standard Variables.

+
    +
  • chapter-number

    +

    章序号

  • +
  • collection-number

    +

    number identifying the collection holding the item (e.g. the series number for a book)

  • +
  • edition

    +

    版本序号(注意和version的区别)

  • +
  • issue

    +

    (container) issue holding the item (e.g. “5” when citing a journal article from journal volume 2, issue 5)

  • +
  • number

    +

    number identifying the item (e.g. a report number)

  • +
  • number-of-pages

    +

    引用项目的总的页数

  • +
  • number-of-volumes

    +

    total number of volumes, usable for citing multi-volume books and such

  • +
  • volume

    +

    (container) volume holding the item (e.g. “2” when citing a chapter from book volume 2)

  • +
+

3.13.3 日期变量

+
    +
  • accessed

    +

    date the item has been accessed

  • +
  • container

    +

    ?

  • +
  • event-date

    +

    date the related event took place

  • +
  • issued

    +

    date the item was issued/published

  • +
  • original-date

    +

    (issue) date of the original version

  • +
  • submitted

    +

    date the item (e.g. a manuscript) has been submitted for publication

  • +
+

3.13.4 名字变量

+
    +
  • author

  • +
  • collection-editor

    +

    editor of the collection holding the item (e.g. the series editor for a book)

  • +
  • composer

    +

    composer (e.g. of a musical score)

  • +
  • container-author

    +

    author of the container holding the item (e.g. the book author for a book chapter)

  • +
  • director

    +

    director (e.g. of a film)

  • +
  • editor

  • +
  • editorial-director

    +

    managing editor (“Directeur de la Publication” in French)

  • +
  • illustrator

    +

    illustrator (e.g. of a children’s book)

  • +
  • interviewer

    +

    interviewer (e.g. of an interview)

  • +
  • original-author

  • +
  • recipient

    +

    recipient (e.g. of a letter)

  • +
  • reviewed-author

    +

    author of the item reviewed by the current item

  • +
  • translator

  • +
+ + + + + +
+
+
+ CC BY-NC-SA 4.0 + Mao Zhou +
+
+
+ + \ No newline at end of file diff --git "a/\351\231\204\345\275\225v-\351\241\265\347\240\201\350\214\203\345\233\264\346\240\274\345\274\217.html" "b/\351\231\204\345\275\225v-\351\241\265\347\240\201\350\214\203\345\233\264\346\240\274\345\274\217.html" new file mode 100644 index 0000000..cc12a37 --- /dev/null +++ "b/\351\231\204\345\275\225v-\351\241\265\347\240\201\350\214\203\345\233\264\346\240\274\345\274\217.html" @@ -0,0 +1,166 @@ + + + + + + + 附录V 页码范围格式 - CSL_Chinese + + + + + + + + + + + + + + +
+ + +
+

3.14 附录V 页码范围格式

+

cs:style元素中的page-range-format表示了页码的缩写规则,其取值可能是:

+

"chicago"

+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
第一个数字第二个数字
小于100使用所有的位数3–10; 71–72
100或者100的整数使用所有的位数100–104; 600–613; 1100–1123
100到109 (包括对应100的倍数的范围)仅使用有变化的部分,忽略不需要的0107–8; 505–17; 1002–6
110到199 (包括对应100的倍数的范围)根据需要使用两位数或者更多321–25; 415–532; 11564–68; 13792–803
4位数如果数字是4位并且其中有3位不同,使用所有的位数1496–1504; 2787–2816
+

"expanded"

+

​ 扩展模式,不适用缩写。eg. 42–45、321–328、2787–2816

+

"minimal"

+

​ 第二个数字中重复的所有数字都被省略:42–5,321–8,2787–816

+

"minimal-two"

+

​ 和"minimal"类似,但当第二个数字有两个或者两个以上的数字时,第二个数字至少保留两位。

+ + +
+ +
+ + +
+
+
+ CC BY-NC-SA 4.0 + Mao Zhou +
+
+
+ + \ No newline at end of file diff --git "a/\351\242\204\345\256\232\344\271\211\345\256\236\344\275\223\350\241\250.html" "b/\351\242\204\345\256\232\344\271\211\345\256\236\344\275\223\350\241\250.html" new file mode 100644 index 0000000..690e07b --- /dev/null +++ "b/\351\242\204\345\256\232\344\271\211\345\256\236\344\275\223\350\241\250.html" @@ -0,0 +1,144 @@ + + + + + + + 预定义实体表 - CSL_Chinese + + + + + + + + + + + + + + +
+ + +
+

2.3 预定义实体表

+

XML 文件中某些符号无法正常表达,比如< 或者>,不处理的话会导致混乱。

+ ++++ + + + + + + + + + + + + + + + + +
所定义的实体所代表的字符
&lt;<
&gt;>`| |"| " | |'| ' | |&`
+
<Para1>John asked &quot;What&apos;s your name?&quot;</Para1>
+
+中间的结果:
+John asked "What's your name? "
+ + +
+ +
+ + +
+
+
+ CC BY-NC-SA 4.0 + Mao Zhou +
+
+
+ + \ No newline at end of file