Guest User

Untitled

a guest
Dec 27th, 2020
270
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {{#*inline "test"}}
  2. {{~#scope~}}
  3. {{~#set "first-dictionary" null}}{{/set~}}
  4. {{~#if modeKanji~}}
  5. ...
  6. {{~else if (op "||" group merge)~}}
  7. {{~#each definition.definitions~}}
  8. {{~#if (op "===" null (get "first-dictionary"))~}}
  9. {{~#set "first-dictionary" dictionary~}}{{~/set~}}
  10. {{~/if~}}
  11. {{~#if (op "===" dictionary (get "first-dictionary"))~}}
  12. {{> glossary-single brief=../brief compactGlossaries=../compactGlossaries data=../.}}
  13. {{~/if~}}
  14. {{~/each~}}
  15. {{~else~}}
  16. {{~> glossary-single definition brief=brief compactGlossaries=compactGlossaries data=.~}}
  17. {{~/if~}}
  18. {{~/scope~}}
  19. {{/inline}}
  20.  
  21. {{#*inline "glossary-single"}}
  22. {{~#unless brief~}}
  23. {{~#if definitionTags~}}{{#each definitionTags}}{{#unless @last}}{{/unless}}{{/each}} {{/if~}}
  24. {{~#if only~}}({{#each only}}{{{.}}}{{#unless @last}}, {{/unless}}{{/each}} only) {{/if~}}
  25. {{~/unless~}}
  26. {{~#if glossary.[1]~}}
  27. {{~#if compactGlossaries~}}
  28. {{#each glossary}}{{#multiLine}}{{#regexReplace "^[^\n]*\n" ""}}{{.}}{{/regexReplace}}{{/multiLine}}{{#unless @last}} | {{/unless}}{{/each}}
  29. {{~else~}}
  30. <ul>{{#each glossary}}<li>{{#multiLine}}{{.}}{{/multiLine}}</li>{{/each}}</ul>
  31. {{~/if~}}
  32. {{~else~}}
  33. {{~#multiLine}}{{#regexReplace "^[^\n]*\n" ""}}{{glossary.[0]}}{{/regexReplace}}{{/multiLine~}}
  34. {{~/if~}}
  35. {{/inline}}
  36.  
  37. {{#*inline "audio"}}
  38. {{~#if definition.audioFileName~}}
  39. [sound:{{definition.audioFileName}}]
  40. {{~/if~}}
  41. {{/inline}}
  42.  
  43. {{#*inline "character"}}
  44. {{~definition.character~}}
  45. {{/inline}}
  46.  
  47. {{#*inline "dictionary"}}
  48. {{~definition.dictionary~}}
  49. {{/inline}}
  50.  
  51. {{#*inline "expression"}}
  52. {{~#if merge~}}
  53. {{~#if modeTermKana~}}
  54. {{~#each definition.reading~}}
  55. {{{.}}}
  56. {{~#unless @last}}、{{/unless~}}
  57. {{~else~}}
  58. {{~#each definition.expression~}}
  59. {{{.}}}
  60. {{~#unless @last}}、{{/unless~}}
  61. {{~/each~}}
  62. {{~/each~}}
  63. {{~else~}}
  64. {{~#each definition.expression~}}
  65. {{{.}}}
  66. {{~#unless @last}}、{{/unless~}}
  67. {{~/each~}}
  68. {{~/if~}}
  69. {{~else~}}
  70. {{~#if modeTermKana~}}
  71. {{~#if definition.reading~}}
  72. {{definition.reading}}
  73. {{~else~}}
  74. {{definition.expression}}
  75. {{~/if~}}
  76. {{~else~}}
  77. {{definition.expression}}
  78. {{~/if~}}
  79. {{~/if~}}
  80. {{/inline}}
  81.  
  82. {{#*inline "furigana"}}
  83. {{~#if merge~}}
  84. {{~#each definition.expressions~}}
  85. <span class="expression-{{termFrequency}}">{{~#furigana}}{{{.}}}{{/furigana~}}</span>
  86. {{~#unless @last}}、{{/unless~}}
  87. {{~/each~}}
  88. {{~else~}}
  89. {{#furigana}}{{{definition}}}{{/furigana}}
  90. {{~/if~}}
  91. {{/inline}}
  92.  
  93. {{#*inline "furigana-plain"}}
  94. {{~#if merge~}}
  95. {{~#each definition.expressions~}}
  96. <span class="expression-{{termFrequency}}">{{~#furiganaPlain}}{{{.}}}{{/furiganaPlain~}}</span>
  97. {{~#unless @last}}、{{/unless~}}
  98. {{~/each~}}
  99. {{~else~}}
  100. {{#furiganaPlain}}{{{definition}}}{{/furiganaPlain}}
  101. {{~/if~}}
  102. {{/inline}}
  103.  
  104. {{#*inline "glossary"}}
  105. <div style="text-align: left;">
  106. {{~#if modeKanji~}}
  107. {{~#if definition.glossary.[1]~}}
  108. <ol>{{#each definition.glossary}}<li>{{.}}</li>{{/each}}</ol>
  109. {{~else~}}
  110. {{definition.glossary.[0]}}
  111. {{~/if~}}
  112. {{~else~}}
  113. {{~#if group~}}
  114. {{~#if definition.definitions.[1]~}}
  115. <ol>{{#each definition.definitions}}<li>{{> glossary-single brief=../brief compactGlossaries=../compactGlossaries data=../.}}</li>{{/each}}</ol>
  116. {{~else~}}
  117. {{~> glossary-single definition.definitions.[0] brief=brief compactGlossaries=compactGlossaries data=.~}}
  118. {{~/if~}}
  119. {{~else if merge~}}
  120. {{~#if definition.definitions.[1]~}}
  121. <ol>{{#each definition.definitions}}<li>{{> glossary-single brief=../brief compactGlossaries=../compactGlossaries data=../.}}</li>{{/each}}</ol>
  122. {{~else~}}
  123. {{~> glossary-single definition.definitions.[0] brief=brief compactGlossaries=compactGlossaries data=.~}}
  124. {{~/if~}}
  125. {{~else~}}
  126. {{~> glossary-single definition brief=brief compactGlossaries=compactGlossaries data=.~}}
  127. {{~/if~}}
  128. {{~/if~}}
  129. </div>
  130. {{/inline}}
  131.  
  132. {{#*inline "glossary-brief"}}
  133. {{~> glossary brief=true ~}}
  134. {{/inline}}
  135.  
  136. {{#*inline "kunyomi"}}
  137. {{~#each definition.kunyomi}}{{.}}{{#unless @last}}, {{/unless}}{{/each~}}
  138. {{/inline}}
  139.  
  140. {{#*inline "onyomi"}}
  141. {{~#each definition.onyomi}}{{.}}{{#unless @last}}, {{/unless}}{{/each~}}
  142. {{/inline}}
  143.  
  144. {{#*inline "reading"}}
  145. {{~#unless modeTermKana~}}
  146. {{~#if merge~}}
  147. {{~#each definition.reading~}}
  148. {{{.}}}
  149. {{~#unless @last}}、{{/unless~}}
  150. {{~/each~}}
  151. {{~else~}}
  152. {{~definition.reading~}}
  153. {{~/if~}}
  154. {{~/unless~}}
  155. {{/inline}}
  156.  
  157. {{#*inline "sentence"}}
  158. {{~#if definition.cloze}}{{definition.cloze.sentence}}{{/if~}}
  159. {{/inline}}
  160.  
  161. {{#*inline "cloze-prefix"}}
  162. {{~#if definition.cloze}}{{definition.cloze.prefix}}{{/if~}}
  163. {{/inline}}
  164.  
  165. {{#*inline "cloze-body"}}
  166. {{~#if definition.cloze}}{{definition.cloze.body}}{{/if~}}
  167. {{/inline}}
  168.  
  169. {{#*inline "cloze-suffix"}}
  170. {{~#if definition.cloze}}{{definition.cloze.suffix}}{{/if~}}
  171. {{/inline}}
  172.  
  173. {{#*inline "tags"}}
  174. {{~#mergeTags definition group merge}}{{this}}{{/mergeTags~}}
  175. {{/inline}}
  176.  
  177. {{#*inline "url"}}
  178. <a href="{{definition.url}}">{{definition.url}}</a>
  179. {{/inline}}
  180.  
  181. {{#*inline "screenshot"}}
  182. <img src="{{definition.screenshotFileName}}" />
  183. {{/inline}}
  184.  
  185. {{#*inline "document-title"}}
  186. {{~context.document.title~}}
  187. {{/inline}}
  188.  
  189. {{! Pitch Accents }}
  190. {{#*inline "pitch-accent-item-downstep-notation"}}
  191. {{~#scope~}}
  192. <span>
  193. {{~#set "style1a"~}}display:inline-block;position:relative;{{~/set~}}
  194. {{~#set "style1b"~}}padding-right:0.1em;margin-right:0.1em;{{~/set~}}
  195. {{~#set "style2a"~}}display:block;user-select:none;pointer-events:none;position:absolute;top:0.1em;left:0;right:0;height:0;border-top:0.1em solid;{{~/set~}}
  196. {{~#set "style2b"~}}right:-0.1em;height:0.4em;border-right:0.1em solid;{{~/set~}}
  197. {{~#each (getKanaMorae reading)~}}
  198. {{~#set "style1"}}{{#get "style1a"}}{{/get}}{{/set~}}
  199. {{~#set "style2"}}{{/set~}}
  200. {{~#if (isMoraPitchHigh @index ../position)}}
  201. {{~#set "style2"}}{{#get "style2a"}}{{/get}}{{/set~}}
  202. {{~#if (op "!" (isMoraPitchHigh (op "+" @index 1) ../position))~}}
  203. {{~#set "style1" (op "+" (get "style1") (get "style1b"))}}{{/set~}}
  204. {{~#set "style2" (op "+" (get "style2") (get "style2b"))}}{{/set~}}
  205. {{~/if~}}
  206. {{~/if~}}
  207. <span style="{{#get "style1"}}{{/get}}">{{{.}}}<span style="{{#get "style2"}}{{/get}}"></span></span>
  208. {{~/each~}}
  209. </span>
  210. {{~/scope~}}
  211. {{/inline}}
  212.  
  213. {{#*inline "pitch-accent-item-graph-position-x"}}{{#op "+" 25 (op "*" index 50)}}{{/op}}{{/inline}}
  214. {{#*inline "pitch-accent-item-graph-position-y"}}{{#op "+" 25 (op "?:" (isMoraPitchHigh index position) 0 50)}}{{/op}}{{/inline}}
  215. {{#*inline "pitch-accent-item-graph-position"}}{{> pitch-accent-item-graph-position-x index=index position=position}} {{> pitch-accent-item-graph-position-y index=index position=position}}{{/inline}}
  216. {{#*inline "pitch-accent-item-graph"}}
  217. {{~#scope~}}
  218. {{~#set "morae" (getKanaMorae reading)}}{{/set~}}
  219. {{~#set "morae-count" (property (get "morae") "length")}}{{/set~}}
  220. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 {{#op "+" 50 (op "*" 50 (get "morae-count"))}}{{/op}} 100" style="display:inline-block;height:2em;">
  221. <defs>
  222. <g id="term-pitch-accent-graph-dot"><circle cx="0" cy="0" r="15" style="fill:#ffffff;stroke:#ffffff;stroke-width:5;" /></g>
  223. <g id="term-pitch-accent-graph-dot-downstep"><circle cx="0" cy="0" r="15" style="fill:none;stroke:#ffffff;stroke-width:5;" /><circle cx="0" cy="0" r="5" style="fill:none;stroke:#ffffff;stroke-width:5;" /></g>
  224. <g id="term-pitch-accent-graph-triangle"><path d="M0 13 L15 -13 L-15 -13 Z" style="fill:none;stroke:#ffffff;stroke-width:5;" /></g>
  225. </defs>
  226. <path style="fill:none;stroke:#ffffff;stroke-width:5;" d="
  227. {{~#set "cmd" "M"}}{{/set~}}
  228. {{~#each (get "morae")~}}
  229. {{~#get "cmd"}}{{/get~}}
  230. {{~> pitch-accent-item-graph-position index=@index position=../position~}}
  231. {{~#set "cmd" "L"}}{{/set~}}
  232. {{~/each~}}
  233. "></path>
  234. <path style="fill:none;stroke:#ffffff;stroke-width:5;stroke-dasharray:5 5;" d="M{{> pitch-accent-item-graph-position index=(op "-" (get "morae-count") 1) position=position}} L{{> pitch-accent-item-graph-position index=(get "morae-count") position=position}}"></path>
  235. {{#each (get "morae")}}
  236. <use href="{{#if (op "&&" (isMoraPitchHigh @index ../position) (op "!" (isMoraPitchHigh (op "+" @index 1) ../position)))}}#term-pitch-accent-graph-dot-downstep{{else}}#term-pitch-accent-graph-dot{{/if}}" x="{{> pitch-accent-item-graph-position-x index=@index position=../position}}" y="{{> pitch-accent-item-graph-position-y index=@index position=../position}}"></use>
  237. {{/each}}
  238. <use href="#term-pitch-accent-graph-triangle" x="{{> pitch-accent-item-graph-position-x index=(get "morae-count") position=position}}" y="{{> pitch-accent-item-graph-position-y index=(get "morae-count") position=position}}"></use>
  239. </svg>
  240. {{~/scope~}}
  241. {{/inline}}
  242.  
  243. {{#*inline "pitch-accent-item-position"~}}
  244. <span>[{{position}}]</span>
  245. {{~/inline}}
  246.  
  247. {{#*inline "pitch-accent-item"}}
  248. {{~#if (op "==" format "downstep-notation")~}}
  249. {{~> pitch-accent-item-downstep-notation~}}
  250. {{~else if (op "==" format "graph")~}}
  251. {{~> pitch-accent-item-graph~}}
  252. {{~else if (op "==" format "position")~}}
  253. {{~> pitch-accent-item-position~}}
  254. {{~/if~}}
  255. {{/inline}}
  256.  
  257. {{#*inline "pitch-accent-item-disambiguation"}}
  258. {{~#scope~}}
  259. {{~#set "exclusive" (spread exclusiveExpressions exclusiveReadings)}}{{/set~}}
  260. {{~#if (op ">" (property (get "exclusive") "length") 0)~}}
  261. {{~#set "separator" ""~}}{{/set~}}
  262. <em>({{#each (get "exclusive")~}}
  263. {{~#get "separator"}}{{/get~}}{{{.}}}
  264. {{~/each}} only) </em>
  265. {{~/if~}}
  266. {{~/scope~}}
  267. {{/inline}}
  268.  
  269. {{#*inline "pitch-accent-list"}}
  270. {{~#if (op ">" pitchCount 0)~}}
  271. {{~#if (op ">" pitchCount 1)~}}{{~/if~}}
  272. {{~#each pitches~}}
  273. {{~#each pitches~}}
  274. {{~#if (op ">" ../../pitchCount 1)~}}{{~/if~}}
  275. {{~> pitch-accent-item-disambiguation~}}
  276. {{~> pitch-accent-item format=../../format~}}
  277. {{~#if (op ">" ../../pitchCount 1)~}}{{~/if~}}
  278. {{~/each~}}
  279. {{~/each~}}
  280. {{~#if (op ">" pitchCount 1)~}}{{~/if~}}
  281. {{~else~}}
  282. {{~/if~}}
  283. {{/inline}}
  284.  
  285. {{#*inline "pitch-accents"}}
  286. {{~> pitch-accent-list format='downstep-notation'~}}
  287. {{/inline}}
  288.  
  289. {{#*inline "pitch-accent-graphs"}}
  290. {{~> pitch-accent-list format='graph'~}}
  291. {{/inline}}
  292.  
  293. {{#*inline "pitch-accent-positions"}}
  294. {{~> pitch-accent-list format='position'~}}
  295. {{/inline}}
  296. {{! End Pitch Accents }}
  297.  
  298. {{#*inline "clipboard-image"}}
  299. {{~#if definition.clipboardImageFileName~}}
  300. <img src="{{definition.clipboardImageFileName}}" />
  301. {{~/if~}}
  302. {{/inline}}
  303.  
  304. {{#*inline "clipboard-text"}}
  305. {{~#if definition.clipboardText~}}{{definition.clipboardText}}{{~/if~}}
  306. {{/inline}}
  307.  
  308. {{#*inline "conjugation"}}
  309. {{~#if definition.reasons~}}
  310. {{~#each definition.reasons~}}
  311. {{~#if (op ">" @index 0)}} « {{/if~}}
  312. {{.}}
  313. {{~/each~}}
  314. {{~/if~}}
  315. {{/inline}}
  316.  
  317. {{#*inline "frequencies"}}
  318. {{~#if (op ">" definition.frequencies.length 0)~}}
  319. <ul style="text-align: left;">
  320. {{~#each definition.frequencies~}}
  321. <li>
  322. {{~#if (op "!==" ../definition.type "kanji")~}}
  323. {{~#if (op "||" (op ">" ../uniqueExpressions.length 1) (op ">" ../uniqueReadings.length 1))~}}(
  324. {{~#furigana expression reading~}}{{~/furigana~}}
  325. ) {{/if~}}
  326. {{~/if~}}
  327. {{~dictionary}}: {{frequency~}}
  328. </li>
  329. {{~/each~}}
  330. </ul>
  331. {{~/if~}}
  332. {{/inline}}
  333.  
  334. {{~> (lookup . "marker") ~}}
RAW Paste Data