Guest User

Untitled

a guest
Aug 31st, 2021
557
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 noDictionaryTag=true data=../.}}
  13. {{~/if~}}
  14. {{~/each~}}
  15. {{~else~}}
  16. {{~> glossary-single definition brief=brief compactGlossaries=compactGlossaries noDictionaryTag=true data=.~}}
  17. {{~/if~}}
  18. {{~/scope~}}
  19. {{/inline}}
  20.  
  21. {{#*inline "glossary-single"}}
  22. {{~#unless brief~}}
  23. {{~#scope~}}
  24. {{~#set "any" false}}{{/set~}}
  25. {{~#each definitionTags~}}
  26. {{~#if (op "||" (op "!" @root.compactTags) (op "!" redundant))~}}
  27. {{~#if (get "any")}}, {{else}}<i>({{/if~}}
  28. {{name}}
  29. {{~#set "any" true}}{{/set~}}
  30. {{~/if~}}
  31. {{~/each~}}
  32. {{~#unless noDictionaryTag~}}
  33. {{~#if (op "||" (op "!" @root.compactTags) (op "!==" dictionary (get "previousDictionary")))~}}
  34. {{~#if (get "any")}}, {{else}}<i>({{/if~}}
  35. {{dictionary}}
  36. {{~#set "any" true}}{{/set~}}
  37. {{~/if~}}
  38. {{~/unless~}}
  39. {{~#if (get "any")}})</i> {{/if~}}
  40. {{~/scope~}}
  41. {{~#if only~}}({{#each only}}{{.}}{{#unless @last}}, {{/unless}}{{/each}} only) {{/if~}}
  42. {{~/unless~}}
  43. {{~#if (op "<=" glossary.length 1)~}}
  44. {{#each glossary}}{{#formatGlossary ../dictionary}}{{#regexReplace "^[^\n]*\n" ""}}{{{.}}}{{/regexReplace}}{{/formatGlossary}}{{/each}}
  45. {{~else if @root.compactGlossaries~}}
  46. {{#each glossary}}{{#formatGlossary ../dictionary}}{{#regexReplace "^[^\n]*\n" ""}}{{{.}}}{{/regexReplace}}{{/formatGlossary}}{{#unless @last}} | {{/unless}}{{/each}}
  47. {{~else~}}
  48. <ul>{{#each glossary}}<li>{{#formatGlossary ../dictionary}}{{{.}}}{{/formatGlossary}}</li>{{/each}}</ul>
  49. {{~/if~}}
  50. {{~#set "previousDictionary" dictionary~}}{{~/set~}}
  51. {{/inline}}
  52.  
  53. {{#*inline "audio"}}
  54. {{~#if (hasMedia "audio")~}}
  55. [sound:{{#getMedia "audio"}}{{/getMedia}}]
  56. {{~/if~}}
  57. {{/inline}}
  58.  
  59. {{#*inline "character"}}
  60. {{~definition.character~}}
  61. {{/inline}}
  62.  
  63. {{#*inline "dictionary"}}
  64. {{~definition.dictionary~}}
  65. {{/inline}}
  66.  
  67. {{#*inline "expression"}}
  68. {{~#if merge~}}
  69. {{~#if modeTermKana~}}
  70. {{~#each definition.reading~}}
  71. {{{.}}}
  72. {{~#unless @last}}、{{/unless~}}
  73. {{~else~}}
  74. {{~#each definition.expression~}}
  75. {{{.}}}
  76. {{~#unless @last}}、{{/unless~}}
  77. {{~/each~}}
  78. {{~/each~}}
  79. {{~else~}}
  80. {{~#each definition.expression~}}
  81. {{{.}}}
  82. {{~#unless @last}}、{{/unless~}}
  83. {{~/each~}}
  84. {{~/if~}}
  85. {{~else~}}
  86. {{~#if modeTermKana~}}
  87. {{~#if definition.reading~}}
  88. {{definition.reading}}
  89. {{~else~}}
  90. {{definition.expression}}
  91. {{~/if~}}
  92. {{~else~}}
  93. {{definition.expression}}
  94. {{~/if~}}
  95. {{~/if~}}
  96. {{/inline}}
  97.  
  98. {{#*inline "furigana"}}
  99. {{~#if merge~}}
  100. {{~#each definition.expressions~}}
  101. <span class="expression-{{termFrequency}}">{{~#furigana}}{{{.}}}{{/furigana~}}</span>
  102. {{~#unless @last}}、{{/unless~}}
  103. {{~/each~}}
  104. {{~else~}}
  105. {{#furigana}}{{{definition}}}{{/furigana}}
  106. {{~/if~}}
  107. {{/inline}}
  108.  
  109. {{#*inline "furigana-plain"}}
  110. {{~#if merge~}}
  111. {{~#each definition.expressions~}}
  112. <span class="expression-{{termFrequency}}">{{~#furiganaPlain}}{{{.}}}{{/furiganaPlain~}}</span>
  113. {{~#unless @last}}、{{/unless~}}
  114. {{~/each~}}
  115. {{~else~}}
  116. {{#furiganaPlain}}{{{definition}}}{{/furiganaPlain}}
  117. {{~/if~}}
  118. {{/inline}}
  119.  
  120. {{~#*inline "glossary"~}}
  121. <div style="text-align: left;">
  122. {{~#scope~}}
  123. {{~#if (op "===" definition.type "term")~}}
  124. {{~> glossary-single definition brief=brief noDictionaryTag=noDictionaryTag ~}}
  125. {{~else if (op "||" (op "===" definition.type "termGrouped") (op "===" definition.type "termMerged"))~}}
  126. {{~#if (op ">" definition.definitions.length 1)~}}
  127. <ol>{{~#each definition.definitions~}}<li>{{~> glossary-single . brief=../brief noDictionaryTag=../noDictionaryTag ~}}</li>{{~/each~}}</ol>
  128. {{~else~}}
  129. {{~#each definition.definitions~}}{{~> glossary-single . brief=../brief noDictionaryTag=../noDictionaryTag ~}}{{~/each~}}
  130. {{~/if~}}
  131. {{~else if (op "===" definition.type "kanji")~}}
  132. {{~#if (op ">" definition.glossary.length 1)~}}
  133. <ol>{{#each definition.glossary}}<li>{{.}}</li>{{/each}}</ol>
  134. {{~else~}}
  135. {{~#each definition.glossary~}}{{.}}{{~/each~}}
  136. {{~/if~}}
  137. {{~/if~}}
  138. {{~/scope~}}
  139. </div>
  140. {{~/inline~}}
  141.  
  142. {{#*inline "glossary-no-dictionary"}}
  143. {{~> glossary noDictionaryTag=true ~}}
  144. {{/inline}}
  145.  
  146. {{#*inline "glossary-brief"}}
  147. {{~> glossary brief=true ~}}
  148. {{/inline}}
  149.  
  150. {{#*inline "kunyomi"}}
  151. {{~#each definition.kunyomi}}{{.}}{{#unless @last}}, {{/unless}}{{/each~}}
  152. {{/inline}}
  153.  
  154. {{#*inline "onyomi"}}
  155. {{~#each definition.onyomi}}{{.}}{{#unless @last}}, {{/unless}}{{/each~}}
  156. {{/inline}}
  157.  
  158. {{#*inline "reading"}}
  159. {{~#unless modeTermKana~}}
  160. {{~#if merge~}}
  161. {{~#each definition.reading~}}
  162. {{{.}}}
  163. {{~#unless @last}}、{{/unless~}}
  164. {{~/each~}}
  165. {{~else~}}
  166. {{~definition.reading~}}
  167. {{~/if~}}
  168. {{~/unless~}}
  169. {{/inline}}
  170.  
  171. {{#*inline "sentence"}}
  172. {{~#if definition.cloze}}{{definition.cloze.sentence}}{{/if~}}
  173. {{/inline}}
  174.  
  175. {{#*inline "cloze-prefix"}}
  176. {{~#if definition.cloze}}{{definition.cloze.prefix}}{{/if~}}
  177. {{/inline}}
  178.  
  179. {{#*inline "cloze-body"}}
  180. {{~#if definition.cloze}}{{definition.cloze.body}}{{/if~}}
  181. {{/inline}}
  182.  
  183. {{#*inline "cloze-suffix"}}
  184. {{~#if definition.cloze}}{{definition.cloze.suffix}}{{/if~}}
  185. {{/inline}}
  186.  
  187. {{#*inline "tags"}}
  188. {{~#mergeTags definition group merge}}{{this}}{{/mergeTags~}}
  189. {{/inline}}
  190.  
  191. {{#*inline "url"}}
  192. <a href="{{definition.url}}">{{definition.url}}</a>
  193. {{/inline}}
  194.  
  195. {{#*inline "screenshot"}}
  196. {{~#if (hasMedia "screenshot")~}}
  197. <img src="{{#getMedia "screenshot"}}{{/getMedia}}" />
  198. {{~/if~}}
  199. {{/inline}}
  200.  
  201. {{#*inline "document-title"}}
  202. {{~context.document.title~}}
  203. {{/inline}}
  204.  
  205. {{! Pitch Accents }}
  206. {{#*inline "pitch-accent-item"}}
  207. {{~#pronunciation format=format reading=reading downstepPosition=position nasalPositions=nasalPositions devoicePositions=devoicePositions~}}{{~/pronunciation~}}
  208. {{/inline}}
  209.  
  210. {{#*inline "pitch-accent-item-disambiguation"}}
  211. {{~#scope~}}
  212. {{~#set "exclusive" (spread exclusiveExpressions exclusiveReadings)}}{{/set~}}
  213. {{~#if (op ">" (property (get "exclusive") "length") 0)~}}
  214. {{~#set "separator" ""~}}{{/set~}}
  215. <em>({{#each (get "exclusive")~}}
  216. {{~#get "separator"}}{{/get~}}{{{.}}}
  217. {{~/each}} only) </em>
  218. {{~/if~}}
  219. {{~/scope~}}
  220. {{/inline}}
  221.  
  222. {{#*inline "pitch-accent-list"}}
  223. {{~#if (op ">" pitchCount 0)~}}
  224. {{~#if (op ">" pitchCount 1)~}}{{~/if~}}
  225. {{~#each pitches~}}
  226. {{~#each pitches~}}
  227. {{~#if (op ">" ../../pitchCount 1)~}}{{~/if~}}
  228. {{~> pitch-accent-item-disambiguation~}}
  229. {{~> pitch-accent-item format=../../format~}}
  230. {{~#if (op ">" ../../pitchCount 1)~}}{{~/if~}}
  231. {{~/each~}}
  232. {{~/each~}}
  233. {{~#if (op ">" pitchCount 1)~}}{{~/if~}}
  234. {{~else~}}
  235. {{~/if~}}
  236. {{/inline}}
  237.  
  238. {{#*inline "pitch-accents"}}
  239. {{~> pitch-accent-list format='text'~}}
  240. {{/inline}}
  241.  
  242. {{#*inline "pitch-accent-graphs"}}
  243. {{~> pitch-accent-list format='graph'~}}
  244. {{/inline}}
  245.  
  246. {{#*inline "pitch-accent-positions"}}
  247. {{#regexReplace "<(.|\n)*?>" ""}}{{~> pitch-accent-list format='position'~}}{{/regexReplace}}
  248. {{/inline}}
  249. {{! End Pitch Accents }}
  250.  
  251. {{#*inline "clipboard-image"}}
  252. {{~#if (hasMedia "clipboardImage")~}}
  253. <img src="{{#getMedia "clipboardImage"}}{{/getMedia}}" />
  254. {{~/if~}}
  255. {{/inline}}
  256.  
  257. {{#*inline "clipboard-text"}}
  258. {{~#if (hasMedia "clipboardText")}}{{#regexReplace "\n(?!$)" "<br>"}}{{#getMedia "clipboardText"}}{{/getMedia}}{{/regexReplace}}{{/if~}}
  259. {{/inline}}
  260.  
  261. {{#*inline "conjugation"}}
  262. {{~#if definition.reasons~}}
  263. {{~#each definition.reasons~}}
  264. {{~#if (op ">" @index 0)}} « {{/if~}}
  265. {{.}}
  266. {{~/each~}}
  267. {{~/if~}}
  268. {{/inline}}
  269.  
  270. {{#*inline "frequencies"}}
  271. {{~#if (op ">" definition.frequencies.length 0)~}}
  272. <ul style="text-align: left;">
  273. {{~#each definition.frequencies~}}
  274. <li>
  275. {{~#if (op "!==" ../definition.type "kanji")~}}
  276. {{~#if (op "||" (op ">" ../uniqueExpressions.length 1) (op ">" ../uniqueReadings.length 1))~}}(
  277. {{~#furigana expression reading~}}{{~/furigana~}}
  278. ) {{/if~}}
  279. {{~/if~}}
  280. {{~dictionary}}: {{frequency~}}
  281. </li>
  282. {{~/each~}}
  283. </ul>
  284. {{~/if~}}
  285. {{/inline}}
  286.  
  287. {{#*inline "stroke-count"}}
  288. {{~#scope~}}
  289. {{~#set "found" false}}{{/set~}}
  290. {{~#each definition.stats.misc~}}
  291. {{~#if (op "===" name "strokes")~}}
  292. {{~#set "found" true}}{{/set~}}
  293. Stroke count: {{value}}
  294. {{~/if~}}
  295. {{~/each~}}
  296. {{~#if (op "!" (get "found"))~}}
  297. Stroke count: Unknown
  298. {{~/if~}}
  299. {{~/scope~}}
  300. {{/inline}}
  301.  
  302. {{#*inline "part-of-speech-pretty"}}
  303. {{~#if (op "===" . "v1")~}}Ichidan verb
  304. {{~else if (op "===" . "v5")~}}Godan verb
  305. {{~else if (op "===" . "vk")~}}Kuru verb
  306. {{~else if (op "===" . "vs")~}}Suru verb
  307. {{~else if (op "===" . "vz")~}}Zuru verb
  308. {{~else if (op "===" . "adj-i")~}}I-adjective
  309. {{~else if (op "===" . "n")~}}Noun
  310. {{~else~}}{{.}}
  311. {{~/if~}}
  312. {{/inline}}
  313.  
  314. {{#*inline "part-of-speech"}}
  315. {{~#scope~}}
  316. {{~#if (op "!==" definition.type "kanji")~}}
  317. {{~#set "first" true}}{{/set~}}
  318. {{~#each definition.expressions~}}
  319. {{~#each wordClasses~}}
  320. {{~#unless (get (concat "used_" .))~}}
  321. {{~> part-of-speech-pretty . ~}}
  322. {{~#unless (get "first")}}, {{/unless~}}
  323. {{~#set (concat "used_" .) true~}}{{~/set~}}
  324. {{~#set "first" false~}}{{~/set~}}
  325. {{~/unless~}}
  326. {{~/each~}}
  327. {{~/each~}}
  328. {{~#if (get "first")~}}Unknown{{~/if~}}
  329. {{~/if~}}
  330. {{~/scope~}}
  331. {{/inline}}
  332.  
  333. {{#*inline "search-query"}}
  334. {{~#multiLine}}{{context.fullQuery}}{{/multiLine~}}
  335. {{/inline}}
  336.  
  337. {{#*inline "selection-text"}}
  338. {{~#if (hasMedia "selectionText")}}{{#getMedia "selectionText"}}{{/getMedia}}{{/if~}}
  339. {{/inline}}
  340.  
  341. {{#*inline "sentence-furigana"}}
  342. {{~#if definition.cloze~}}
  343. {{~#if (hasMedia "textFurigana" definition.cloze.sentence)~}}
  344. {{#getMedia "textFurigana" definition.cloze.sentence escape=false}}{{/getMedia}}
  345. {{~else~}}
  346. {{definition.cloze.sentence}}
  347. {{~/if~}}
  348. {{~/if~}}
  349. {{/inline}}
  350.  
  351. {{~> (lookup . "marker") ~}}
RAW Paste Data