Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2023-05-09 09:49:17 +08:00
commit 96d891011c
15 changed files with 46 additions and 19 deletions

View file

@ -1,4 +1,7 @@
{
"flashcardNewCard": "New",
"flashcardReviewCard": "Review",
"flashcardCard": "Total",
"plugin": "Plugin",
"attrBookmarkTip": "Associate this block with a bookmark for subsequent viewing through the bookmark panel",
"attrNameTip": "Set a name for this block, mainly for reference and search, a block can only have one unique name",

View file

@ -1,4 +1,7 @@
{
"flashcardNewCard": "Nueva Tarjeta",
"flashcardReviewCard": "Revisar Tarjeta",
"flashcardCard": "Todos",
"plugin": "Complemento",
"attrBookmarkTip": "Asociar este bloque con un marcador para verlo posteriormente a través del panel de marcadores",
"attrNameTip": "Establezca un nombre para este bloque, principalmente para referencia y búsqueda, un bloque solo puede tener un nombre único",

View file

@ -1,4 +1,7 @@
{
"flashcardNewCard": "Nouvelle carte",
"flashcardReviewCard": "Revoir la carte",
"flashcardCard": "Tous",
"plugin": "Plugin",
"attrBookmarkTip": "Associez ce bloc à un signet pour un affichage ultérieur via le panneau des signets",
"attrNameTip": "Définissez un nom pour ce bloc, principalement pour la référence et la recherche, un bloc ne peut avoir qu'un seul nom unique",

View file

@ -1,4 +1,7 @@
{
"flashcardNewCard": "新卡",
"flashcardReviewCard": "複習卡",
"flashcardCard": "所有",
"plugin": "插件",
"attrBookmarkTip": "將該塊和一個書籤進行關聯,以便後續通過書籤面板查看",
"attrNameTip": "為該塊設置命名,主要用於引用和搜索,一個塊只能擁有一個唯一的命名",

View file

@ -1,4 +1,7 @@
{
"flashcardNewCard": "新卡",
"flashcardReviewCard": "复习卡",
"flashcardCard": "所有",
"plugin": "插件",
"attrBookmarkTip": "将该块和一个书签进行关联,以便后续通过书签面板查看",
"attrNameTip": "为该块设置命名,主要用于引用和搜索,一个块只能拥有一个唯一的命名",

View file

@ -85,6 +85,8 @@ Below are the detailed changelogs.
* [Improve hyperlink anchor text when exporting to Markdown](https://github.com/siyuan-note/siyuan/issues/8191)
* [Access to the OpenAI API is no longer supported on Huawei devices](https://github.com/siyuan-note/siyuan/issues/8192)
* [Check for duplicates in all windows when opening a tab](https://github.com/siyuan-note/siyuan/issues/8193)
* [Update feedback icon](https://github.com/siyuan-note/siyuan/issues/8201)
* [Show count in spaced repetition tree filter floating window](https://github.com/siyuan-note/siyuan/issues/8202)
### Bugfix

View file

@ -85,6 +85,8 @@
* [改进导出 Markdown 超链接锚文本](https://github.com/siyuan-note/siyuan/issues/8191)
* [在华为手机上不再支持配置 OpenAI](https://github.com/siyuan-note/siyuan/issues/8192)
* [打开页签时在所有窗口中检查是否重复打开](https://github.com/siyuan-note/siyuan/issues/8193)
* [更新反馈图标](https://github.com/siyuan-note/siyuan/issues/8201)
* [间隔重复文档树过滤浮窗中显示计数](https://github.com/siyuan-note/siyuan/issues/8202)
### 修复缺陷

View file

@ -397,7 +397,7 @@ export const bazaar = {
</div>`;
if (dataObj.downloaded) {
const mdElement = readmeElement.querySelector(".item__readme");
mdElement.innerHTML = data.readme;
mdElement.innerHTML = data.preferredReadme;
highlightRender(mdElement);
} else {
fetchPost("/api/bazaar/getBazaarPackageREAME", {

View file

@ -712,8 +712,8 @@ declare interface IBazaarItem {
enabled: boolean
preferredName: string
preferredDesc: string
preferredReadme: string
iconURL: string
readme: string
stars: string
author: string
updated: string

View file

@ -142,13 +142,14 @@ func InstalledIcons() (ret []*Icon) {
installSize, _ := util.SizeOfDirectory(installPath)
icon.InstallSize = installSize
icon.HInstallSize = humanize.Bytes(uint64(installSize))
readme, readErr := os.ReadFile(filepath.Join(installPath, "README.md"))
readmeFilename := getPreferredReadme(icon.Readme)
readme, readErr := os.ReadFile(filepath.Join(installPath, readmeFilename))
if nil != readErr {
logging.LogWarnf("read install icon README.md failed: %s", readErr)
logging.LogWarnf("read installed README.md failed: %s", readErr)
continue
}
icon.README, _ = renderREADME(icon.URL, readme)
icon.PreferredReadme, _ = renderREADME(icon.URL, readme)
icon.Outdated = isOutdatedIcon(icon, bazaarIcons)
ret = append(ret, icon)
}

View file

@ -76,6 +76,7 @@ type Package struct {
PreferredFunding string `json:"preferredFunding"`
PreferredName string `json:"preferredName"`
PreferredDesc string `json:"preferredDesc"`
PreferredReadme string `json:"preferredReadme"`
Name string `json:"name"`
RepoURL string `json:"repoURL"`
@ -84,8 +85,6 @@ type Package struct {
PreviewURLThumb string `json:"previewURLThumb"`
IconURL string `json:"iconURL"`
README string `json:"readme"`
Installed bool `json:"installed"`
Outdated bool `json:"outdated"`
Current bool `json:"current"`

View file

@ -148,12 +148,14 @@ func InstalledPlugins() (ret []*Plugin) {
installSize, _ := util.SizeOfDirectory(installPath)
plugin.InstallSize = installSize
plugin.HInstallSize = humanize.Bytes(uint64(installSize))
readme, readErr := os.ReadFile(filepath.Join(installPath, "README.md"))
readmeFilename := getPreferredReadme(plugin.Readme)
readme, readErr := os.ReadFile(filepath.Join(installPath, readmeFilename))
if nil != readErr {
logging.LogWarnf("read install plugin README.md failed: %s", readErr)
logging.LogWarnf("read installed README.md failed: %s", readErr)
continue
}
plugin.README, _ = renderREADME(plugin.URL, readme)
plugin.PreferredReadme, _ = renderREADME(plugin.URL, readme)
plugin.Outdated = isOutdatedPlugin(plugin, bazaarPlugins)
ret = append(ret, plugin)
}

View file

@ -149,12 +149,14 @@ func InstalledTemplates() (ret []*Template) {
installSize, _ := util.SizeOfDirectory(installPath)
template.InstallSize = installSize
template.HInstallSize = humanize.Bytes(uint64(installSize))
readme, readErr := os.ReadFile(filepath.Join(installPath, "README.md"))
readmeFilename := getPreferredReadme(template.Readme)
readme, readErr := os.ReadFile(filepath.Join(installPath, readmeFilename))
if nil != readErr {
logging.LogWarnf("read install template README.md failed: %s", readErr)
logging.LogWarnf("read installed README.md failed: %s", readErr)
continue
}
template.README, _ = renderREADME(template.URL, readme)
template.PreferredReadme, _ = renderREADME(template.URL, readme)
template.Outdated = isOutdatedTemplate(template, bazaarTemplates)
ret = append(ret, template)
}

View file

@ -150,12 +150,14 @@ func InstalledThemes() (ret []*Theme) {
installSize, _ := util.SizeOfDirectory(installPath)
theme.InstallSize = installSize
theme.HInstallSize = humanize.Bytes(uint64(installSize))
readme, readErr := os.ReadFile(filepath.Join(installPath, "README.md"))
readmeFilename := getPreferredReadme(theme.Readme)
readme, readErr := os.ReadFile(filepath.Join(installPath, readmeFilename))
if nil != readErr {
logging.LogWarnf("read install theme README.md failed: %s", readErr)
logging.LogWarnf("read installed README.md failed: %s", readErr)
continue
}
theme.README, _ = renderREADME(theme.URL, readme)
theme.PreferredReadme, _ = renderREADME(theme.URL, readme)
theme.Outdated = isOutdatedTheme(theme, bazaarThemes)
ret = append(ret, theme)
}

View file

@ -147,12 +147,14 @@ func InstalledWidgets() (ret []*Widget) {
installSize, _ := util.SizeOfDirectory(installPath)
widget.InstallSize = installSize
widget.HInstallSize = humanize.Bytes(uint64(installSize))
readme, readErr := os.ReadFile(filepath.Join(installPath, "README.md"))
readmeFilename := getPreferredReadme(widget.Readme)
readme, readErr := os.ReadFile(filepath.Join(installPath, readmeFilename))
if nil != readErr {
logging.LogWarnf("read install widget README.md failed: %s", readErr)
logging.LogWarnf("read installed README.md failed: %s", readErr)
continue
}
widget.README, _ = renderREADME(widget.URL, readme)
widget.PreferredReadme, _ = renderREADME(widget.URL, readme)
widget.Outdated = isOutdatedWidget(widget, bazaarWidgets)
ret = append(ret, widget)
}