ninja33 / anki-templates Goto Github PK
View Code? Open in Web Editor NEWAnki Note Template
Anki Note Template
显示Invalid HTML on card: SyntaxError: Unexpected token }
老黄你好,
我在用您制作的COCA apkg学习单词,里面的发音是从网络上提取的,我想换成利用AwesomeTTS提取的本地的朗文6的发音,该怎么修改呢? PC端修改后,手机端也是朗文6的发音吗? 多谢。
How can I choose a different API for the audio? The audio sounds weird to me, is there any way to choose another one?
老黄您好。我之前一直在用你的全家桶来背单词和标记新词,受益良多,非常感谢!
最近 iOS 13 出来了,支持 dark 模式,我是 dark 模式爱好者,而 dark 模式下,现在的英语模板显得有点太耀眼了,所以我修改了下样式文件,做了一套 dark 模式的模板。现在我把它放在下面,有需要的话可以参考一下。
因为我自己不打算再用回 light 模式模板没有考虑双模式支持,不好意思。模板也根据我自己的需求进行了一些微小的调整
card1:
<!-- config & version section-->
<div class="section">
<div class="bar config">Config
<input type="checkbox" id="audio" onchange="saveConfig(this,'audio')">AutoPlay
<input type="checkbox" id="fold" onchange="saveConfig(this,'fold')">HideHint
<input type="checkbox" id="example" onchange="saveConfig(this,'example')">Example
</div>
<!-- versioncsection -->
<div id='version' class='item'></div>
</div>
<!-- front section -->
<div class="section">
<div id="front" class="items">
<span>{{expression}}</span>
</div>
<hr>
<div id="phonetic" class="items">
<span>{{reading}}</span>
<audio id="player" src="">{{audio}}</audio>
</div>
</div>
<script type="text/javascript">
loadConfig();
</script>
card2:
{{FrontSide}}
<!-- back section -->
{{#glossary}}
<div class="section">
<div id="back" class="items">{{glossary}}</div>
</div>
{{/glossary}}
{{#notes}}
<div class="section">
<div class="bar note" onclick="toggle('note')">Notes</div>
<div id="note" class="items">{{notes}}</div>
</div>
{{/notes}}
{{#sentence}}
<div class="section">
<div class="bar sentence" onclick="toggle('sentence')">Sentence</div>
<div id="sentence" class="backlist items">{{sentence}}</div>
</div>
{{/sentence}}
<!-- foot section -->
<div class="bar foot">
<div id="url"><a href={{text:url}}>URL</a></div>
</div>
{{audio}}
<script type="text/javascript">
//customzied format function
clearFormat();
//hide hint based on config
if (config.fold) {
toggle('note');
toggle('sentence');
}
//sample function
highlightTag()
//sample function
//makeCloze()
</script>
style
</style>
<!--
author:ninja33 https://github.com/ninja33/anki-templates
inspired by: https://github.com/ecator/
-->
<script type="text/javascript">
//declare global var config
if (typeof (config) == "undefined") {
var config = {};
//audio autoplay
config.audio = true;
//hide or display hint section
config.fold = true;
//other config might be added
config.example = true;
config.version = '1.0';
window.name = JSON.stringify(config);
}
</script>
<style>
/*global card style*/
.card {
font-family: helvetica, arial, sans-serif;
font-size: 16px;
text-align: left;
color: #d9d9d9;
background-color: #1e1e1e;
}
/*head & foot global style */
.bar {
border-bottom: 1px solid #455069;
color: #ddd;
padding: 5px;
padding-left: 35px;
text-decoration: none;
font-size: 12px;
font-weight: bold;
background: #455069;
background-repeat: no-repeat;
background-position: 5px center;
}
.bar #url a {
text-decoration: none;
font-size: 12px;
color: #d9d9d9;
font-weight: bold;
}
/*head style*/
.config {
background-image: url(_toggles.png);
}
.head {
background-image: url(_search.png)
}
.back {
background-image: url(_bulb.png)
}
.note {
background-image: url(_pencil.png)
}
.sentence {
background-image: url(_clipboard.png)
}
/*foot style*/
.foot {
background-image: url(_cloud.png)
}
/* section global style */
.section {
border-color: #303030;
background-color: #303030;
position: relative;
margin: 5px 0;
}
/* item global style */
.items {
margin: 0 12px;
padding: 8px 0;
}
hr {
border: 0;
margin: 3px 13px;
border-top: 1px solid #666;
}
/* front & back global style */
#front,
#back {
line-height: 1.5em;
}
/* front field style */
#front {
font-size: 36px;
color: #ddd;
text-align: left;
}
#front span {
display: inline-block;
vertical-align: middle;
}
#front img {
width: 36px;
height: 36px;
top: 6px;
position: relative;
margin-left: 10px;
}
/* back field style */
#back {
font-size: 16px;
color: #ddd;
text-align: left;
}
/* Tag highlight style */
.highlight {
font-size: 12px;
border-radius: 4px;
color: #f2f2f2;
padding: 0 3px;
margin-right: 5px;
font-weight: bold;
}
/* phonetic style */
#phonetic {
font-size: 14px;
}
#sentence b {
font-weight: normal;
border-radius: 3px;
color: #d9d9d9;
background-color: #666;
padding: 0 3px;
}
#sentence hr {
border: 0;
margin: 8px 0px;
border-top: 1px solid #333;
}
/* version style */
#version {
text-align: center;
font-size: 12px;
}
</style>
<!--
JS helper functions
-->
<script>
//hide or display hint
function toggle(e) {
var box = document.getElementById(e);
if (box)
if (box.style.display == 'none') {
box.style.display = 'block';
}
else {
box.style.display = 'none';
}
}
//save config
function saveConfig(obj, item) {
config[item] = obj.checked;
window.name = JSON.stringify(config);
}
//load config
function loadConfig() {
document.getElementById("audio").checked = config.audio
document.getElementById("fold").checked = config.fold
document.getElementById("example").checked = config.example
}
//delete HTML element
function removeTag(tag) {
var items = document.querySelectorAll(tag);
for (var i = 0; i < items.length; i++) {
items[i].outerHTML = "";
}
}
//clear WordQuery output Format
function clearFormat() {
var ex = document.querySelectorAll(".explanation_box .text_blue");
for (var i = 0; i < ex.length; i++) {
ex[i].outerHTML = ex[i].outerHTML + "<br>";
}
var ex = document.querySelectorAll(".explanation_box .explanation_label");
for (var i = 0; i < ex.length; i++) {
ex[i].innerHTML = ex[i].innerHTML.replace(/.?\[(.+?)[\s|-].+/g, "$1").toLowerCase() + ".";
//alert(ex[i].innerHTML)
}
removeTag(".word_header");
removeTag(".item_number");
if (!config.example) {
removeTag(".explanation_item>ul");
}
}
//sample functions: make cloze
function makeCloze() {
var bb = document.querySelectorAll("#back b");
for (var i = 0; i < bb.length; i++) {
bb[i].innerHTML = "____";
}
}
//sample functions: highlight tag
function highlightTag() {
var colorMap = {
'n.': '#e3412f',
'a.': '#f8b002',
'adj.': '#f8b002',
'ad.': '#684b9d',
'adv.': '#684b9d',
'v.': '#539007',
'vi.': '#539007',
'vt.': '#539007',
'verb.': '#539007',
'phrase.': '#04B7C9',
'prep.': '#04B7C9',
'conj.': '#04B7C9',
'pron.': '#04B7C9',
'art.': '#04B7C9',
'num.': '#04B7C9',
'int.': '#04B7C9',
'interj.': '#04B7C9',
'modal.': '#04B7C9',
'aux.': '#04B7C9',
'pl.': '#D111D3',
'abbr.': '#D111D3',
};
[].forEach.call(document.querySelectorAll('#back'), function (div) {
div.innerHTML = div.innerHTML.replace(/\b[a-z]+\./g, function (symbol) {
if (colorMap[symbol]) {
return '<a class="highlight" style="color: #eee; background-color: ' + colorMap[symbol] + ';" >' + symbol + '</a>';
} else {
return symbol;
}
});
});
}
</script>
<style>
English Blue/RBG Template(英语蓝色/三色模板),在iOS版本上,点击那个按钮以展开例句没有反应哎,在android和pc上可以,不知道有没有解决办法?谢谢
查fold这个词。
把fearfare090807制作的词典LDOCE5V1.35用FastWordQuery添加时出现问题:
Autoplay没有打钩,翻开背面的时候会自动播放所有包括例句的语音。
但是例句前的小喇叭图标没了。
我把media在内的出现问题的词牌导出来了,能帮忙看看吗?
老黄大神已经告知在下用插件解决。
请问Notes Sentences Cloud这几个图标是怎么添进去的?
因为自己正在制作的卡片需要添加一些其它的项目,为了统一美观,想在其它项目上也添加图标。还望赐教!
老黄大神,请问怎么实现:正面的单词发音,由有道的在线发音,改成用fastwq查询的本地MDX词典的发音,比如LDOCE 6的美式发音。如果可以的话,可不可以把这行css代码公布出来给同样需求的人。
比如collins和vocabulary.com
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.