0

我正在做一个anki(它支持卡片模板的html和css)模板,我想整合从字典中解析的例句。问题在于,通常要显示的示例太多。

典型的“{{examples}}”字段的内容如下所示。

►…のほうに in the direction of…; toward(s)…; to 《the east》&lt;br>・左のほうに曲がる bend [turn] to the left (side)<br>・左のほうに富士山が見える. On the left (side) you can see Mt. Fuji.<br>・こちら[あちら]のほうに this [that] way<br>・君のほうに行く go your way; go toward you<br>・市役所より北のほうに 《located》 to the north of the city hall; 《go》 north from the city hall<br>・それはここから[駅の]東のほうにある. It's (to the) east ┏from here [of the station].<br>・あきる野市は東京都の西のほうに位置している. Akiruno City is situated in the western part of metropolitan Tokyo.<br>・彼は青山のほうに住んでいる. He lives somewhere Aoyama way.<br>

如您所见,每个例句都以“►”或“・”开头,并以“”结尾

是否有一种方法可以截断整个字段以仅显示前三个示例,并使用“显示更多”按钮来显示其余示例?

当前模板:

正面

<div class=category>{{category}}</div>
<div class=kenkyusha>{{kenkyusha}}</div>

<hr>

<div class=kojien>{{kojien}}</div>

CSS

.night_mode{
}

.replaybutton {display: none;}

ul {
    padding: 0;
}

.card {
  font-family: myfont;
  font-size:13pt;
  background-color: #1e1e1e;
}

.entry {
  font-size:200%;
  color:#5566ee;
  text-align: center;
}

.reading {
  text-align: center;
}

.category {
  text-align: center;
}

.kenkyusha {
  text-align: left;
  color:#4ecab0;
}

.kojien {
  text-align: left;
  color:#4ecab0;
}

.examples {
  text-align: left;
}

背部

<div class=entry>{{entry}}</div>
<div class=reading>{{reading}}</div>

<hr>

<div class=category>{{category}}</div>
<div class=kenkyusha>{{kenkyusha}}</div>
<div class=examples>{{examples}}</div>

<hr>

<div class=kojien>{{kojien}}</div>
4

0 回答 0