Commit 1d8c6a8006
Unsigned
Layout: unified · split
docs/.vitepress/configs/markdown/extRepoPlugin.ts +9 −6
| @@ -16,6 +16,7 @@ interface ParsedRepoRow { | ||
| 16 | 16 | repoName?: string |
| 17 | 17 | repoUrl?: string |
| 18 | 18 | variants?: ParsedRepoVariant[] |
| 19 | data?: string | |
| 19 | 20 | } |
| 20 | 21 | |
| 21 | 22 | interface ParsedRepoBuild { |
| @@ -32,6 +33,7 @@ interface ParsedRepoEntry { | ||
| 32 | 33 | manga?: string |
| 33 | 34 | anime?: string |
| 34 | 35 | novel?: string |
| 36 | data?: string | |
| 35 | 37 | // Arbitrary named sub-entries under a `-- Label` line (e.g. several unrelated forks |
| 36 | 38 | // grouped under one row), as opposed to `manga`/`anime`/`novel` which are fixed content- |
| 37 | 39 | // type variants of a single project (see buildVariants below). |
| @@ -51,7 +53,7 @@ function parseAttrs(info: string): Record<string, string> { | ||
| 51 | 53 | return attrs |
| 52 | 54 | } |
| 53 | 55 | |
| 54 | const FIELD_KEYS = new Set(['url', 'src', 'raw', 'note', 'manga', 'anime', 'novel']) | |
| 56 | const FIELD_KEYS = new Set(['url', 'src', 'raw', 'note', 'manga', 'anime', 'novel', 'data']) | |
| 55 | 57 | |
| 56 | 58 | function parseEntries(bodyLines: string[]): ParsedRepoEntry[] { |
| 57 | 59 | const entries: ParsedRepoEntry[] = [] |
| @@ -86,7 +88,7 @@ function parseEntries(bodyLines: string[]): ParsedRepoEntry[] { | ||
| 86 | 88 | if (key === 'raw') currentBuild.raw = value |
| 87 | 89 | continue |
| 88 | 90 | } |
| 89 | if (FIELD_KEYS.has(key)) current[key as 'url' | 'src' | 'raw' | 'note' | 'manga' | 'anime' | 'novel'] = value | |
| 91 | if (FIELD_KEYS.has(key)) current[key as 'url' | 'src' | 'raw' | 'note' | 'manga' | 'anime' | 'novel' | 'data'] = value | |
| 90 | 92 | } |
| 91 | 93 | } |
| 92 | 94 | if (current) entries.push(current) |
| @@ -161,7 +163,7 @@ export function extRepoPlugin(md: MarkdownIt): void { | ||
| 161 | 163 | } |
| 162 | 164 | |
| 163 | 165 | const attrs = parseAttrs(params) |
| 164 | const scheme = attrs.scheme || 'tachiyomi' | |
| 166 | const scheme = attrs.scheme || 'mihon' | |
| 165 | 167 | |
| 166 | 168 | const rows: ParsedRepoRow[] = [] |
| 167 | 169 | for (const entry of parseEntries(bodyLines)) { |
| @@ -177,7 +179,7 @@ export function extRepoPlugin(md: MarkdownIt): void { | ||
| 177 | 179 | .filter((b): b is Required<ParsedRepoBuild> => Boolean(b.raw)) |
| 178 | 180 | .map(b => ({ label: b.label, mangaUrl: b.raw })) |
| 179 | 181 | if (groupVariants.length) { |
| 180 | rows.push({ name, indexUrl: groupVariants[0].mangaUrl!, note, variants: groupVariants }) | |
| 182 | rows.push({ name, indexUrl: groupVariants[0].mangaUrl!, note, data: entry.data, variants: groupVariants }) | |
| 181 | 183 | } |
| 182 | 184 | continue |
| 183 | 185 | } |
| @@ -192,13 +194,14 @@ export function extRepoPlugin(md: MarkdownIt): void { | ||
| 192 | 194 | note, |
| 193 | 195 | repoName: entry.name, |
| 194 | 196 | repoUrl: entry.url, |
| 195 | variants | |
| 197 | variants, | |
| 198 | data: entry.data | |
| 196 | 199 | }) |
| 197 | 200 | continue |
| 198 | 201 | } |
| 199 | 202 | |
| 200 | 203 | if (!entry.raw) continue |
| 201 | rows.push({ name, indexUrl: entry.raw, note }) | |
| 204 | rows.push({ name, indexUrl: entry.raw, note, data: entry.data }) | |
| 202 | 205 | } |
| 203 | 206 | |
| 204 | 207 | const reposJson = JSON.stringify(rows).replace(/'/g, ''') |
docs/.vitepress/theme/components/extrepo/ExtensionRepos.vue +2 −1
| @@ -63,7 +63,8 @@ const allSites = computed<MatchedSite[]>(() => { | ||
| 63 | 63 | continue |
| 64 | 64 | } |
| 65 | 65 | const repoName = stripHtml(repo.name) |
| 66 | for (const site of repoData[repo.indexUrl]?.sites ?? []) { | |
| 66 | const dataUrl = repo.data ?? repo.indexUrl | |
| 67 | for (const site of repoData[dataUrl]?.sites ?? []) { | |
| 67 | 68 | sites.push({ ...site, repoName }) |
| 68 | 69 | } |
| 69 | 70 | } |
docs/.vitepress/theme/components/extrepo/RepoRow.vue +2 −1
| @@ -25,7 +25,8 @@ const copiedLabel = ref<string | null>(null) | ||
| 25 | 25 | const openVariants = ref<Set<string>>(new Set()) |
| 26 | 26 | |
| 27 | 27 | const sites = computed(() => { |
| 28 | const all = repoData[props.repo.indexUrl]?.sites ?? [] | |
| 28 | const dataUrl = props.repo.data ?? props.repo.indexUrl | |
| 29 | const all = repoData[dataUrl]?.sites ?? [] | |
| 29 | 30 | return props.showBroken ? all : all.filter(site => !site.isBroken) |
| 30 | 31 | }) |
| 31 | 32 | const isExpandable = computed(() => !NOT_EXPANDABLE.has(stripHtml(props.repo.name))) |
docs/.vitepress/theme/components/extrepo/install.ts +1
| @@ -16,6 +16,7 @@ interface InstallOpts { | ||
| 16 | 16 | |
| 17 | 17 | const INSTALL_URL_BUILDERS: Record<string, (repo: Repo, opts?: InstallOpts) => string> = { |
| 18 | 18 | aidoku: repo => `aidoku://addSourceList?url=${repo.indexUrl}`, |
| 19 | mihon: repo => `mihon://extension-store?url=${repo.indexUrl}`, | |
| 19 | 20 | paperback: repo => `paperback://addRepo?displayName=${encodeURIComponent(stripHtml(repo.name))}&url=${paperbackBase(repo.indexUrl)}`, |
| 20 | 21 | suwatte: (repo, opts) => { |
| 21 | 22 | const listUrl = opts?.suwatteListUrl ?? suwatteBase(repo.indexUrl) |
docs/.vitepress/theme/components/extrepo/types.ts +1
| @@ -15,6 +15,7 @@ export interface Repo { | ||
| 15 | 15 | repoName?: string |
| 16 | 16 | repoUrl?: string |
| 17 | 17 | variants?: RepoVariant[] |
| 18 | data?: string | |
| 18 | 19 | } |
| 19 | 20 | |
| 20 | 21 | export interface RepoSite { |
docs/ext/extensionRepos.data.ts +72 −1
| @@ -19,6 +19,42 @@ export interface RepoSite { | ||
| 19 | 19 | installUrl?: string |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | interface MihonIndexSource { | |
| 23 | id: string | |
| 24 | name: string | |
| 25 | language: string | |
| 26 | homeUrl: string | |
| 27 | mirrorUrls?: string[] | |
| 28 | } | |
| 29 | ||
| 30 | interface MihonIndexExtension { | |
| 31 | name: string | |
| 32 | packageName: string | |
| 33 | resources: { | |
| 34 | apkUrl: string | |
| 35 | iconUrl: string | |
| 36 | jarUrl: string | |
| 37 | } | |
| 38 | extensionLib: string | |
| 39 | versionCode: string | |
| 40 | versionName: string | |
| 41 | contentWarning: string | |
| 42 | sources: MihonIndexSource[] | |
| 43 | } | |
| 44 | ||
| 45 | interface MihonIndex { | |
| 46 | name: string | |
| 47 | badgeLabel: string | |
| 48 | signingKey: string | |
| 49 | contact?: { | |
| 50 | website?: string | |
| 51 | discord?: string | |
| 52 | } | |
| 53 | extensionList: { | |
| 54 | extensions: MihonIndexExtension[] | |
| 55 | } | |
| 56 | } | |
| 57 | ||
| 22 | 58 | export interface RepoData { |
| 23 | 59 | sites: RepoSite[] |
| 24 | 60 | suwatteV6?: boolean |
| @@ -213,7 +249,7 @@ function findMarkdownFiles(dir: string): string[] { | ||
| 213 | 249 | function collectIndexUrls(): string[] { |
| 214 | 250 | const urls = new Set<string>() |
| 215 | 251 | const blockRe = /:::\s*extrepo[^\n]*\n([\s\S]*?)\n\s*:::/g |
| 216 | const rowRe = /^\s*-\s*(?:raw|manga|anime|novel)\s*:\s*(https?:\/\/\S+)\s*$/gim | |
| 252 | const rowRe = /^\s*-\s*(?:raw|manga|anime|novel|data)\s*:\s*(https?:\/\/\S+)\s*$/gim | |
| 217 | 253 | |
| 218 | 254 | for (const file of findMarkdownFiles(DOCS_DIR)) { |
| 219 | 255 | const src = readFileSync(file, 'utf-8') |
| @@ -677,11 +713,46 @@ function toRepoDataLNReader(plugins: LNReaderPlugin[]): RepoSite[] { | ||
| 677 | 713 | return sites |
| 678 | 714 | } |
| 679 | 715 | |
| 716 | const CONTENT_WARNING_RATING: Record<string, Rating> = { | |
| 717 | CONTENT_WARNING_NSFW: 'nsfw', | |
| 718 | CONTENT_WARNING_MIXED: 'suggestive', | |
| 719 | CONTENT_WARNING_SAFE: 'safe' | |
| 720 | } | |
| 721 | ||
| 722 | function toRepoDataMihonNew(index: MihonIndex): RepoSite[] { | |
| 723 | const seen = new Set<string>() | |
| 724 | const sites: RepoSite[] = [] | |
| 725 | ||
| 726 | for (const ext of index.extensionList.extensions) { | |
| 727 | const icon = ext.resources.iconUrl | |
| 728 | const rating = CONTENT_WARNING_RATING[ext.contentWarning] ?? 'safe' | |
| 729 | ||
| 730 | for (const source of ext.sources) { | |
| 731 | const key = `${source.name}::${source.language}::${source.homeUrl}` | |
| 732 | if (seen.has(key)) continue | |
| 733 | seen.add(key) | |
| 734 | sites.push({ name: source.name, lang: source.language, icon, url: source.homeUrl, rating }) | |
| 735 | } | |
| 736 | } | |
| 737 | ||
| 738 | sites.sort((a, b) => a.name.localeCompare(b.name)) | |
| 739 | return sites | |
| 740 | } | |
| 741 | ||
| 680 | 742 | async function toRepoData(indexUrl: string, json: unknown): Promise<RepoData> { |
| 681 | 743 | const iconBase = indexUrl.slice(0, indexUrl.lastIndexOf('/')) |
| 682 | 744 | let sites: RepoSite[] |
| 683 | 745 | let suwatteV6: boolean | undefined |
| 684 | 746 | let suwatteListUrl: string | undefined |
| 747 | ||
| 748 | if ( | |
| 749 | json && typeof json === 'object' && !Array.isArray(json) | |
| 750 | && 'extensionList' in (json as Record<string, unknown>) | |
| 751 | ) { | |
| 752 | sites = toRepoDataMihonNew(json as MihonIndex) | |
| 753 | return { sites } | |
| 754 | } | |
| 755 | ||
| 685 | 756 | if (Array.isArray(json)) { |
| 686 | 757 | const first = json[0] as Record<string, unknown> | undefined |
| 687 | 758 | if (first && 'bookSourceUrl' in first) { |
docs/ext/mihon.md +7 −4
| @@ -35,24 +35,27 @@ Due to DMCA takedown notices, [Tachiyomi](https://github.com/tachiyomiorg) (now | ||
| 35 | 35 | |
| 36 | 36 | ## Manga |
| 37 | 37 | |
| 38 | ::: extrepo {scheme=tachiyomi} | |
| 38 | ::: extrepo {scheme=mihon} | |
| 39 | 39 | |
| 40 | 40 | == Keiyoushi |
| 41 | 41 | - url: https://keiyoushi.github.io/ |
| 42 | 42 | - src: https://github.com/keiyoushi/extensions-source |
| 43 | 43 | - note: Maintained by former Tachiyomi contributors |
| 44 | - raw: https://raw.githubusercontent.com/keiyoushi/extensions/repo/index.min.json | |
| 44 | - raw: https://raw.githubusercontent.com/keiyoushi/extensions/repo/index.pb | |
| 45 | - data: https://raw.githubusercontent.com/keiyoushi/extensions/repo/index.json | |
| 45 | 46 | |
| 46 | 47 | == Yūzōnō |
| 47 | 48 | - url: https://yuzono.github.io |
| 48 | 49 | - src: https://github.com/yuzono/tachiyomi-extensions |
| 49 | 50 | - note: By Komikku dev. Mirrors Keiyoushi repo with a few extra extensions |
| 50 | - raw: https://raw.githubusercontent.com/yuzono/manga-repo/repo/index.min.json | |
| 51 | - raw: https://raw.githubusercontent.com/yuzono/manga-repo/repo/index.pb | |
| 52 | - data: https://raw.githubusercontent.com/yuzono/manga-repo/repo/index.json | |
| 51 | 53 | |
| 52 | 54 | == Fucked by FAKKU |
| 53 | 55 | - url: https://github.com/mojuru/cursed-manga-repo |
| 54 | 56 | - note: Removed extensions from Keiyoushi due to DMCA by FAKKU. Maintained by Kommikku dev. |
| 55 | - raw: https://raw.githubusercontent.com/mojuru/cursed-manga-repo/repo/index.min.json | |
| 57 | - raw: https://raw.githubusercontent.com/mojuru/cursed-manga-repo/repo/index.pb | |
| 58 | - data: https://raw.githubusercontent.com/mojuru/cursed-manga-repo/repo/index.json | |
| 56 | 59 | |
| 57 | 60 | == Kavita |
| 58 | 61 | - url: https://github.com/Kareadita/tach-extension/ |
docs/ext/misc.md +1 −1
| @@ -221,7 +221,7 @@ i am so tired of this shit lol. every fork works differently. just use mihon or | ||
| 221 | 221 | |
| 222 | 222 | ## Tsundoku |
| 223 | 223 | |
| 224 | ::: extrepo {scheme=tachiyomi} | |
| 224 | ::: extrepo {scheme=mihon} | |
| 225 | 225 | |
| 226 | 226 | == Novel Sourcery |
| 227 | 227 | - url: https://novelsourcery.github.io/ |