mirror of
https://github.com/Wanxp/obsidian-douban.git
synced 2026-04-06 18:18:45 +08:00
format code style
This commit is contained in:
parent
9278a334c1
commit
a10dfe32b7
42
README.md
42
README.md
@ -1,7 +1,26 @@
|
||||
# Obsidian Douban Plugin
|
||||
|
||||
[![Version][version-shield]][version-url][![Stargazers][stars-shield]][stars-url][![Issues][issues-shield]][issues-url][![Downloads][downloads-shield]][downloads-url][![Contributors][contributors-shield]][contributors-url]
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/Wanxp/obsidian-douban/releases/latest">
|
||||
<img src="https://img.shields.io/github/manifest-json/v/Wanxp/obsidian-douban?color=blue">
|
||||
</a>
|
||||
<img src="https://img.shields.io/github/release-date/Wanxp/obsidian-douban">
|
||||
<a href="https://github.com/Wanxp/obsidian-douban/blob/main/LICENSE">
|
||||
<img src="https://img.shields.io/github/license/Wanxp/obsidian-douban">
|
||||
</a>
|
||||
<img src="https://img.shields.io/github/downloads/Wanxp/obsidian-douban/total">
|
||||
<a href="https://github.com/Wanxp/obsidian-douban/issues">
|
||||
<img src="https://img.shields.io/github/issues/Wanxp/obsidian-douban">
|
||||
</a>
|
||||
<br>
|
||||
<img src="https://img.shields.io/tokei/lines/github/Wanxp/obsidian-douban">
|
||||
<a href="https://www.codefactor.io/repository/github/Wanxp/obsidian-douban/stats">
|
||||
<img src="https://img.shields.io/codefactor/grade/github/Wanxp/obsidian-douban">
|
||||
</a>
|
||||
<a href="https://mszturc.github.io/obsidian-advanced-slides/lcov-report/">
|
||||
<img src="https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/MSzturc/a2879612aa47b6364392d94cae882c50/raw/obsidian-advanced-slides_coverage.json">
|
||||
</a>
|
||||
</p>
|
||||
|
||||
Import Movies, Books, Music, Teleplay, Note, Game even Broadcast Data from Douban in [Obsidian](https://obsidian.md/)
|
||||
在[Obsidian](https://obsidian.md/)使用并导入豆瓣中的电影/书籍/音乐/电视剧/日记/游戏甚至是广播, 包含评分/发布日期/演员表等信息
|
||||
@ -66,22 +85,3 @@ If you want some features or have any questions about this plugin, create issues
|
||||
进入Obsidian插件中心重新加载当前插件
|
||||
7. Enjoy your develop
|
||||
享受开发吧
|
||||
|
||||
<!-- MARKDOWN LINKS & IMAGES -->
|
||||
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
|
||||
[contributors-shield]: https://img.shields.io/github/contributors/Wanxp/obsidian-douban
|
||||
[contributors-url]: https://github.com/Wanxp/obsidian-douban/graphs/contributors
|
||||
[forks-shield]: https://img.shields.io/github/forks/Wanxp/obsidian-douban
|
||||
[forks-url]: https://github.com/Wanxp/obsidian-douban/network/members
|
||||
[stars-shield]: https://img.shields.io/github/stars/Wanxp/obsidian-douban
|
||||
[stars-url]: https://github.com/Wanxp/obsidian-douban/stargazers
|
||||
[issues-shield]: https://img.shields.io/github/issues/Wanxp/obsidian-douban
|
||||
[issues-url]: https://github.com/Wanxp/obsidian-douban/issues
|
||||
[license-shield]: https://img.shields.io/github/license/Wanxp/obsidian-douban
|
||||
[license-url]: https://github.com/Wanxp/obsidian-douban/blob/master/LICENSE.txt
|
||||
[product-screenshot]: images/screenshot.png
|
||||
[version-shield]: https://img.shields.io/github/package-json/v/Wanxp/obsidian-douban
|
||||
[version-url]: https://github.com/Wanxp/obsidian-douban/releases/latest
|
||||
|
||||
[downloads-shield]: https://img.shields.io/github/downloads/Wanxp/obsidian-douban/total
|
||||
[downloads-url]: https://github.com/Wanxp/obsidian-douban
|
||||
|
||||
@ -15,8 +15,6 @@ export interface DoubanPluginSettings {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
export const doubanHeaders = {
|
||||
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
|
||||
"Accept-Language": "en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7",
|
||||
|
||||
@ -116,8 +116,6 @@ export class DoubanSettingTab extends PluginSettingTab {
|
||||
// }));
|
||||
|
||||
|
||||
|
||||
|
||||
new Setting(containerEl).setName(i18nHelper.getMessage('120201')).then((setting) => {
|
||||
setting.addTextArea((textarea) => {
|
||||
setting.descEl.appendChild(
|
||||
@ -263,8 +261,6 @@ export class DoubanSettingTab extends PluginSettingTab {
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
new Setting(containerEl).setName(i18nHelper.getMessage('120501')).then((setting) => {
|
||||
setting.addMomentFormat((mf) => {
|
||||
setting.descEl.appendChild(
|
||||
|
||||
@ -7,6 +7,7 @@ export class DoubanBroadcastMovieHandler extends DoubanBroadcastAbstractHandler<
|
||||
support(t: string): boolean {
|
||||
throw new Error("Method not implemented.");
|
||||
}
|
||||
|
||||
transform(data: Element, source: CheerioAPI): DoubanBroadcastMovieSubject {
|
||||
throw new Error("Method not implemented.");
|
||||
}
|
||||
|
||||
@ -9,6 +9,10 @@ import DoubanSubject from 'src/douban/data/model/DoubanSubject';
|
||||
//TODO will support in future version
|
||||
export default class DoubanPageBroadcatLoadHandler extends DoubanAbstractLoadHandler<DoubanPageBroadcastSubject> {
|
||||
|
||||
constructor(doubanPlugin: DoubanPlugin) {
|
||||
super(doubanPlugin);
|
||||
}
|
||||
|
||||
getTemplate(settings: DoubanPluginSettings): string {
|
||||
return settings.bookTemplate;
|
||||
}
|
||||
@ -28,18 +32,11 @@ export default class DoubanPageBroadcatLoadHandler extends DoubanAbstractLoadHan
|
||||
// .replaceAll("{{authorUrl}}", extract.authorUrl ? extract.authorUrl : "")
|
||||
// .replaceAll("{{author}}", extract.author ? extract.author : "")
|
||||
}
|
||||
|
||||
support(extract: DoubanSubject): boolean {
|
||||
return extract && extract.type && (extract.type.contains("广播") || extract.type.contains("Broadcast"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
constructor(doubanPlugin:DoubanPlugin) {
|
||||
super(doubanPlugin);
|
||||
}
|
||||
|
||||
parseSubjectFromHtml(html: CheerioAPI): DoubanPageBroadcastSubject {
|
||||
// return html('.new-status .status-wrapper')
|
||||
// .get()
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
import {AggregateRating, Person, WithContext} from 'schema-dts';
|
||||
|
||||
import DoubanSubject from 'src/douban/data/model/DoubanSubject';
|
||||
|
||||
export default class DoubanPageBroadcastSubject extends DoubanSubject {
|
||||
|
||||
@ -3,7 +3,7 @@ import {DoubanPluginSettings} from "src/douban/Douban";
|
||||
import DoubanPlugin from "main";
|
||||
import DoubanSubject, {DoubanParameter} from '../model/DoubanSubject';
|
||||
import DoubanSubjectLoadHandler from "./DoubanSubjectLoadHandler";
|
||||
import {Editor, moment, request, requestUrl, RequestUrlParam, sanitizeHTMLToDom} from "obsidian";
|
||||
import {Editor, moment, request, RequestUrlParam} from "obsidian";
|
||||
import {i18nHelper} from 'src/lang/helper';
|
||||
import {log} from "src/utils/Logutil";
|
||||
import {CheerioAPI, load} from "cheerio";
|
||||
@ -45,23 +45,6 @@ export default abstract class DoubanAbstractLoadHandler<T extends DoubanSubject>
|
||||
}
|
||||
}
|
||||
|
||||
private parsePartText(template: string, extract: T, settings: DoubanPluginSettings, textMode:TemplateTextMode = TemplateTextMode.NORMAL): string {
|
||||
let resultContent = template
|
||||
.replaceAll(DoubanParameter.ID, extract.id)
|
||||
.replaceAll(DoubanParameter.TITLE, this.handleSpecialContent(extract.title, textMode))
|
||||
.replaceAll(DoubanParameter.TYPE, extract.type)
|
||||
.replaceAll(DoubanParameter.SCORE, this.handleSpecialContent(extract.score))
|
||||
.replaceAll(DoubanParameter.IMAGE, extract.image)
|
||||
.replaceAll(DoubanParameter.URL, extract.url)
|
||||
.replaceAll(DoubanParameter.DESC, this.handleSpecialContent(extract.desc, textMode))
|
||||
.replaceAll(DoubanParameter.PUBLISHER, extract.publisher)
|
||||
.replaceAll(DoubanParameter.DATE_PUBLISHED, extract.datePublished ? moment(extract.datePublished).format(settings.dateFormat) : '')
|
||||
.replaceAll(DoubanParameter.TIME_PUBLISHED, extract.datePublished ? moment(extract.datePublished).format(settings.timeFormat) : '')
|
||||
.replaceAll(DoubanParameter.GENRE, this.handleSpecialContent(extract.genre, textMode, settings))
|
||||
;
|
||||
return this.parseText(resultContent, extract, settings, textMode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理特殊字符
|
||||
* @param text
|
||||
@ -164,8 +147,7 @@ export default abstract class DoubanAbstractLoadHandler<T extends DoubanSubject>
|
||||
return resultName;
|
||||
}
|
||||
|
||||
html_encode(str:string):string
|
||||
{
|
||||
html_encode(str: string): string {
|
||||
let s = "";
|
||||
if (str.length == 0) return "";
|
||||
s = str.replace(/&/g, "&");
|
||||
@ -178,8 +160,7 @@ export default abstract class DoubanAbstractLoadHandler<T extends DoubanSubject>
|
||||
return s;
|
||||
}
|
||||
|
||||
html_decode(str:string):string
|
||||
{
|
||||
html_decode(str: string): string {
|
||||
let s = "";
|
||||
if (str.length == 0) return "";
|
||||
s = str.replace(/&/g, "&");
|
||||
@ -192,4 +173,21 @@ export default abstract class DoubanAbstractLoadHandler<T extends DoubanSubject>
|
||||
return s;
|
||||
}
|
||||
|
||||
private parsePartText(template: string, extract: T, settings: DoubanPluginSettings, textMode: TemplateTextMode = TemplateTextMode.NORMAL): string {
|
||||
let resultContent = template
|
||||
.replaceAll(DoubanParameter.ID, extract.id)
|
||||
.replaceAll(DoubanParameter.TITLE, this.handleSpecialContent(extract.title, textMode))
|
||||
.replaceAll(DoubanParameter.TYPE, extract.type)
|
||||
.replaceAll(DoubanParameter.SCORE, this.handleSpecialContent(extract.score))
|
||||
.replaceAll(DoubanParameter.IMAGE, extract.image)
|
||||
.replaceAll(DoubanParameter.URL, extract.url)
|
||||
.replaceAll(DoubanParameter.DESC, this.handleSpecialContent(extract.desc, textMode))
|
||||
.replaceAll(DoubanParameter.PUBLISHER, extract.publisher)
|
||||
.replaceAll(DoubanParameter.DATE_PUBLISHED, extract.datePublished ? moment(extract.datePublished).format(settings.dateFormat) : '')
|
||||
.replaceAll(DoubanParameter.TIME_PUBLISHED, extract.datePublished ? moment(extract.datePublished).format(settings.timeFormat) : '')
|
||||
.replaceAll(DoubanParameter.GENRE, this.handleSpecialContent(extract.genre, textMode, settings))
|
||||
;
|
||||
return this.parseText(resultContent, extract, settings, textMode);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
import {Editor, htmlToMarkdown, moment, renderResults} from "obsidian";
|
||||
|
||||
import {CheerioAPI} from 'cheerio';
|
||||
import DoubanAbstractLoadHandler from "./DoubanAbstractLoadHandler";
|
||||
import DoubanBookSubject, {DoubanBookParameter} from "../model/DoubanBookSubject";
|
||||
@ -10,6 +8,10 @@ import {TemplateTextMode} from "../../../constant/Constsant";
|
||||
|
||||
export default class DoubanBookLoadHandler extends DoubanAbstractLoadHandler<DoubanBookSubject> {
|
||||
|
||||
constructor(doubanPlugin: DoubanPlugin) {
|
||||
super(doubanPlugin);
|
||||
}
|
||||
|
||||
getTemplate(settings: DoubanPluginSettings): string {
|
||||
return settings.bookTemplate;
|
||||
}
|
||||
@ -39,13 +41,6 @@ export default class DoubanBookLoadHandler extends DoubanAbstractLoadHandler<Dou
|
||||
.replace(']', '/');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
constructor(doubanPlugin:DoubanPlugin) {
|
||||
super(doubanPlugin);
|
||||
}
|
||||
|
||||
parseSubjectFromHtml(html: CheerioAPI): DoubanBookSubject {
|
||||
let desc = html(html("head > meta[property= 'og:description']").get(0)).attr("content");
|
||||
let image = html(html("head > meta[property= 'og:image']").get(0)).attr("content");
|
||||
|
||||
@ -7,8 +7,8 @@ import DoubanGameSubject from '../model/DoubanGameSubject';
|
||||
|
||||
export default class DoubanGameLoadHandler extends DoubanAbstractLoadHandler<DoubanGameSubject> {
|
||||
|
||||
getTemplate(settings: DoubanPluginSettings): string {
|
||||
return settings.gameTemplate;
|
||||
constructor(doubanPlugin: DoubanPlugin) {
|
||||
super(doubanPlugin);
|
||||
}
|
||||
|
||||
// parse(extract: DoubanGameSubject, settings: DoubanPluginSettings): string {
|
||||
@ -16,6 +16,10 @@ export default class DoubanGameLoadHandler extends DoubanAbstractLoadHandler<Dou
|
||||
// return super.parse(extract, settings);
|
||||
// }
|
||||
|
||||
getTemplate(settings: DoubanPluginSettings): string {
|
||||
return settings.gameTemplate;
|
||||
}
|
||||
|
||||
parseText(beforeContent: string, extract: DoubanGameSubject, settings: DoubanPluginSettings): string {
|
||||
return beforeContent
|
||||
.replaceAll("{{platform}}", extract.platform ? extract.platform.join(settings.arraySpilt) : "")
|
||||
@ -27,14 +31,6 @@ export default class DoubanGameLoadHandler extends DoubanAbstractLoadHandler<Dou
|
||||
return extract && extract.type && (extract.type.contains("游戏") || extract.type.contains("Game") || extract.type.contains("game"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
constructor(doubanPlugin:DoubanPlugin) {
|
||||
super(doubanPlugin);
|
||||
}
|
||||
|
||||
parseSubjectFromHtml(html: CheerioAPI): DoubanGameSubject {
|
||||
let title = html(html("#content > h1").get(0)).text();
|
||||
let idContent = html(html("head > meta[name= 'mobile-agent']").get(0)).attr("content");
|
||||
@ -83,6 +79,7 @@ export default class DoubanGameLoadHandler extends DoubanAbstractLoadHandler<Dou
|
||||
};
|
||||
return result
|
||||
}
|
||||
|
||||
//TODO support game's name i18n
|
||||
// handleI18nName(title: string, settings: DoubanPluginSettings):string {
|
||||
// if (!title) {
|
||||
|
||||
@ -8,6 +8,10 @@ import DoubanMovieSubject from '../model/DoubanMovieSubject';
|
||||
|
||||
export default class DoubanMovieLoadHandler extends DoubanAbstractLoadHandler<DoubanMovieSubject> {
|
||||
|
||||
constructor(doubanPlugin: DoubanPlugin) {
|
||||
super(doubanPlugin);
|
||||
}
|
||||
|
||||
getTemplate(settings: DoubanPluginSettings): string {
|
||||
return settings.movieTemplate;
|
||||
}
|
||||
@ -20,18 +24,11 @@ export default class DoubanMovieLoadHandler extends DoubanAbstractLoadHandler<Do
|
||||
.replaceAll("{{author}}", extract.author ? extract.author.map(SchemaOrg.getPersonName).map(name => super.getPersonName(name, settings)).filter(c => c).join(settings.arraySpilt) : "")
|
||||
;
|
||||
}
|
||||
|
||||
support(extract: DoubanSubject): boolean {
|
||||
return extract && extract.type && (extract.type.contains("电影") || extract.type.contains("Movie") || extract.type.contains("movie"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
constructor(doubanPlugin:DoubanPlugin) {
|
||||
super(doubanPlugin);
|
||||
}
|
||||
|
||||
parseSubjectFromHtml(data: CheerioAPI): DoubanMovieSubject {
|
||||
return data('script')
|
||||
.get()
|
||||
|
||||
@ -7,6 +7,10 @@ import DoubanSubject from '../model/DoubanSubject';
|
||||
|
||||
export default class DoubanMusicLoadHandler extends DoubanAbstractLoadHandler<DoubanMusicSubject> {
|
||||
|
||||
constructor(doubanPlugin: DoubanPlugin) {
|
||||
super(doubanPlugin);
|
||||
}
|
||||
|
||||
getTemplate(settings: DoubanPluginSettings): string {
|
||||
return settings.musicTemplate;
|
||||
}
|
||||
@ -20,18 +24,11 @@ export default class DoubanMusicLoadHandler extends DoubanAbstractLoadHandler<Do
|
||||
.replaceAll("{{numberOfRecords}}", extract.numberOfRecords ? extract.numberOfRecords + "" : "")
|
||||
;
|
||||
}
|
||||
|
||||
support(extract: DoubanSubject): boolean {
|
||||
return extract && extract.type && (extract.type.contains("音乐") || extract.type.contains("Music") || extract.type.contains("music"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
constructor(doubanPlugin:DoubanPlugin) {
|
||||
super(doubanPlugin);
|
||||
}
|
||||
|
||||
parseSubjectFromHtml(html: CheerioAPI): DoubanMusicSubject {
|
||||
let title = html(html("head > meta[property= 'og:title']").get(0)).attr("content");
|
||||
let desc = html(html("head > meta[property= 'og:description']").get(0)).attr("content");
|
||||
|
||||
@ -8,6 +8,10 @@ import html2markdown from '@notable/html2markdown';
|
||||
|
||||
export default class DoubanNoteLoadHandler extends DoubanAbstractLoadHandler<DoubanNoteSubject> {
|
||||
|
||||
constructor(doubanPlugin: DoubanPlugin) {
|
||||
super(doubanPlugin);
|
||||
}
|
||||
|
||||
getTemplate(settings: DoubanPluginSettings): string {
|
||||
return settings.noteTemplate;
|
||||
}
|
||||
@ -19,18 +23,11 @@ export default class DoubanNoteLoadHandler extends DoubanAbstractLoadHandler<Dou
|
||||
.replaceAll("{{author}}", extract.author ? extract.author : "")
|
||||
;
|
||||
}
|
||||
|
||||
support(extract: DoubanSubject): boolean {
|
||||
return extract && extract.type && (extract.type.contains("日记") || extract.type.contains("Note") || extract.type.contains("Article"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
constructor(doubanPlugin:DoubanPlugin) {
|
||||
super(doubanPlugin);
|
||||
}
|
||||
|
||||
parseSubjectFromHtml(html: CheerioAPI): DoubanNoteSubject {
|
||||
let title = html(html("head > meta[property= 'og:title']").get(0)).attr("content");
|
||||
let desc = html(html("head > meta[property= 'og:description']").get(0)).attr("content");
|
||||
|
||||
@ -12,19 +12,19 @@ export default class DoubanOtherLoadHandler extends DoubanAbstractLoadHandler<Do
|
||||
getTemplate(settings: DoubanPluginSettings): string {
|
||||
return "";
|
||||
}
|
||||
|
||||
parseText(beforeContent: string, extract: DoubanSubject, settings: DoubanPluginSettings): string {
|
||||
log.warn(i18nHelper.getMessage('140101'));
|
||||
return "";
|
||||
}
|
||||
|
||||
support(extract: DoubanSubject): boolean {
|
||||
return false;
|
||||
}
|
||||
|
||||
parseSubjectFromHtml(data: CheerioAPI): DoubanSubject {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -20,7 +20,6 @@ export class DoubanSearchChooseItemHandler {
|
||||
private _doubanSubjectHandlerDefault: DoubanSubjectLoadHandler<DoubanSubject>;
|
||||
|
||||
|
||||
|
||||
constructor(app: App, doubanPlugin: DoubanPlugin) {
|
||||
this._app = app;
|
||||
this._doubanPlugin = doubanPlugin;
|
||||
|
||||
@ -11,14 +11,13 @@ import SchemaOrg from "src/utils/SchemaOrg";
|
||||
*/
|
||||
export class DoubanTeleplayLoadHandler extends DoubanAbstractLoadHandler<DoubanTeleplaySubject> {
|
||||
|
||||
getTemplate(settings: DoubanPluginSettings): string {
|
||||
return settings.movieTemplate;
|
||||
}
|
||||
|
||||
constructor(doubanPlugin: DoubanPlugin) {
|
||||
super(doubanPlugin);
|
||||
}
|
||||
|
||||
getTemplate(settings: DoubanPluginSettings): string {
|
||||
return settings.movieTemplate;
|
||||
}
|
||||
|
||||
parseText(beforeContent: string, extract: DoubanTeleplaySubject, settings: DoubanPluginSettings): string {
|
||||
return beforeContent
|
||||
|
||||
@ -1,7 +1,4 @@
|
||||
import {AggregateRating, Person, WithContext} from 'schema-dts';
|
||||
|
||||
import DoubanSubject from "./DoubanSubject";
|
||||
import PropertyExplainSubject from "@App/data/model/PropertyExplainSubject";
|
||||
|
||||
export default class DoubanBookSubject extends DoubanSubject {
|
||||
author: string[];
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
import {AggregateRating, Person} from 'schema-dts';
|
||||
import DoubanSubject from './DoubanSubject';
|
||||
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import {AggregateRating, Person, WithContext} from 'schema-dts';
|
||||
import {AggregateRating, Person} from 'schema-dts';
|
||||
|
||||
import DoubanSubject from "./DoubanSubject";
|
||||
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
import {AggregateRating, Person, WithContext} from 'schema-dts';
|
||||
|
||||
import DoubanSubject from "./DoubanSubject";
|
||||
|
||||
export default class DoubanMusicSubject extends DoubanSubject {
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
import {AggregateRating, Person, WithContext} from 'schema-dts';
|
||||
|
||||
import DoubanSubject from "./DoubanSubject";
|
||||
|
||||
export default class DoubanNoteSubject extends DoubanSubject {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import {AggregateRating, Person, WithContext} from 'schema-dts';
|
||||
import {AggregateRating, Person} from 'schema-dts';
|
||||
|
||||
import DoubanSubject from "./DoubanSubject";
|
||||
|
||||
|
||||
@ -23,7 +23,6 @@ class DoubanFuzzySuggester extends FuzzySuggestModal<DoubanSearchResultSubject>
|
||||
}
|
||||
|
||||
|
||||
|
||||
getItems(): DoubanSearchResultSubject[] {
|
||||
return this.doubanSearchResultExtract;
|
||||
}
|
||||
|
||||
@ -33,7 +33,6 @@ export class DoubanSearchModal extends Modal {
|
||||
});
|
||||
|
||||
|
||||
|
||||
const controls = contentEl.createDiv("controls");
|
||||
const searchButton = controls.createEl("button", {
|
||||
text: i18nHelper.getMessage('110004'),
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { DoubanPluginSettings, doubanHeaders } from 'src/douban/Douban';
|
||||
import {DoubanPluginSettings} from 'src/douban/Douban';
|
||||
|
||||
import DoubanSearchResultSubject from '../model/DoubanSearchResultSubject';
|
||||
import SearchParserHandler from './SearchParser';
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
//简体中文
|
||||
import DoubanBookSubject from "@App/data/model/DoubanBookSubject";
|
||||
import {extract} from "jest-docblock";
|
||||
|
||||
export default {
|
||||
//main.ts
|
||||
@ -116,7 +114,10 @@ export default {
|
||||
score: {desc: `评分`, example: `9.4`},
|
||||
image: {desc: `图片URL`, example: `https://img1.doubanio.com/view/subject/l/public/s28261247.jpg`},
|
||||
url: {desc: `豆瓣URL`, example: `https://book.douban.com/subject/25982198/`},
|
||||
desc: {desc: `简述`, example: `戴维·迈尔斯的《社会心理学》是美国700 多所大专院校社会心理学教学所采用的教材,自出版以来深受广大师生和社会心理学爱好者的喜爱,并被翻译成多种语言,有着广泛的影响力。本书译自第11 版。全书共分四...`},
|
||||
desc: {
|
||||
desc: `简述`,
|
||||
example: `戴维·迈尔斯的《社会心理学》是美国700 多所大专院校社会心理学教学所采用的教材,自出版以来深受广大师生和社会心理学爱好者的喜爱,并被翻译成多种语言,有着广泛的影响力。本书译自第11 版。全书共分四...`
|
||||
},
|
||||
publisher: {desc: `出版社`, example: `人民邮电出版社`},
|
||||
datePublished: {desc: `出版时间`, example: `2014-10-1`},
|
||||
genre: {desc: `类型`, example: `社会科学`},
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
import {Notice} from "obsidian";
|
||||
import SchemaOrg from "./SchemaOrg";
|
||||
import {i18nHelper} from "src/lang/helper";
|
||||
|
||||
class Logger {
|
||||
|
||||
@ -1,9 +1,6 @@
|
||||
import {i18nHelper} from "../lang/helper";
|
||||
|
||||
export default class YamlUtil {
|
||||
|
||||
|
||||
|
||||
public static hasSpecialChar(str: string): boolean {
|
||||
return SPECIAL_CHAR_REG.test(str);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user