Commit 1d8c6a8006

1d8c6a8006f27466784199a2eafcebe767f372db

parent: 7971f16b21

Unsigned

Duck <57977673+woducku@users.noreply.github.com> · 2026-07-29 15:45 UTC

init

Layout: unified · split

docs/.vitepress/configs/markdown/extRepoPlugin.ts +9 −6
@@ -16,6 +16,7 @@ interface ParsedRepoRow {
1616 repoName?: string
1717 repoUrl?: string
1818 variants?: ParsedRepoVariant[]
19 data?: string
1920}
2021
2122interface ParsedRepoBuild {
@@ -32,6 +33,7 @@ interface ParsedRepoEntry {
3233 manga?: string
3334 anime?: string
3435 novel?: string
36 data?: string
3537 // Arbitrary named sub-entries under a `-- Label` line (e.g. several unrelated forks
3638 // grouped under one row), as opposed to `manga`/`anime`/`novel` which are fixed content-
3739 // type variants of a single project (see buildVariants below).
@@ -51,7 +53,7 @@ function parseAttrs(info: string): Record<string, string> {
5153 return attrs
5254}
5355
54const FIELD_KEYS = new Set(['url', 'src', 'raw', 'note', 'manga', 'anime', 'novel'])
56const FIELD_KEYS = new Set(['url', 'src', 'raw', 'note', 'manga', 'anime', 'novel', 'data'])
5557
5658function parseEntries(bodyLines: string[]): ParsedRepoEntry[] {
5759 const entries: ParsedRepoEntry[] = []
@@ -86,7 +88,7 @@ function parseEntries(bodyLines: string[]): ParsedRepoEntry[] {
8688 if (key === 'raw') currentBuild.raw = value
8789 continue
8890 }
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
9092 }
9193 }
9294 if (current) entries.push(current)
@@ -161,7 +163,7 @@ export function extRepoPlugin(md: MarkdownIt): void {
161163 }
162164
163165 const attrs = parseAttrs(params)
164 const scheme = attrs.scheme || 'tachiyomi'
166 const scheme = attrs.scheme || 'mihon'
165167
166168 const rows: ParsedRepoRow[] = []
167169 for (const entry of parseEntries(bodyLines)) {
@@ -177,7 +179,7 @@ export function extRepoPlugin(md: MarkdownIt): void {
177179 .filter((b): b is Required<ParsedRepoBuild> => Boolean(b.raw))
178180 .map(b => ({ label: b.label, mangaUrl: b.raw }))
179181 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 })
181183 }
182184 continue
183185 }
@@ -192,13 +194,14 @@ export function extRepoPlugin(md: MarkdownIt): void {
192194 note,
193195 repoName: entry.name,
194196 repoUrl: entry.url,
195 variants
197 variants,
198 data: entry.data
196199 })
197200 continue
198201 }
199202
200203 if (!entry.raw) continue
201 rows.push({ name, indexUrl: entry.raw, note })
204 rows.push({ name, indexUrl: entry.raw, note, data: entry.data })
202205 }
203206
204207 const reposJson = JSON.stringify(rows).replace(/'/g, '&#39;')
docs/.vitepress/theme/components/extrepo/ExtensionRepos.vue +2 −1
@@ -63,7 +63,8 @@ const allSites = computed<MatchedSite[]>(() => {
6363 continue
6464 }
6565 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 ?? []) {
6768 sites.push({ ...site, repoName })
6869 }
6970 }
docs/.vitepress/theme/components/extrepo/RepoRow.vue +2 −1
@@ -25,7 +25,8 @@ const copiedLabel = ref<string | null>(null)
2525const openVariants = ref<Set<string>>(new Set())
2626
2727const 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 ?? []
2930 return props.showBroken ? all : all.filter(site => !site.isBroken)
3031})
3132const isExpandable = computed(() => !NOT_EXPANDABLE.has(stripHtml(props.repo.name)))
docs/.vitepress/theme/components/extrepo/install.ts +1
@@ -16,6 +16,7 @@ interface InstallOpts {
1616
1717const INSTALL_URL_BUILDERS: Record<string, (repo: Repo, opts?: InstallOpts) => string> = {
1818 aidoku: repo => `aidoku://addSourceList?url=${repo.indexUrl}`,
19 mihon: repo => `mihon://extension-store?url=${repo.indexUrl}`,
1920 paperback: repo => `paperback://addRepo?displayName=${encodeURIComponent(stripHtml(repo.name))}&url=${paperbackBase(repo.indexUrl)}`,
2021 suwatte: (repo, opts) => {
2122 const listUrl = opts?.suwatteListUrl ?? suwatteBase(repo.indexUrl)
docs/.vitepress/theme/components/extrepo/types.ts +1
@@ -15,6 +15,7 @@ export interface Repo {
1515 repoName?: string
1616 repoUrl?: string
1717 variants?: RepoVariant[]
18 data?: string
1819}
1920
2021export interface RepoSite {
docs/ext/extensionRepos.data.ts +72 −1
@@ -19,6 +19,42 @@ export interface RepoSite {
1919 installUrl?: string
2020}
2121
22interface MihonIndexSource {
23 id: string
24 name: string
25 language: string
26 homeUrl: string
27 mirrorUrls?: string[]
28}
29
30interface 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
45interface 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
2258export interface RepoData {
2359 sites: RepoSite[]
2460 suwatteV6?: boolean
@@ -213,7 +249,7 @@ function findMarkdownFiles(dir: string): string[] {
213249function collectIndexUrls(): string[] {
214250 const urls = new Set<string>()
215251 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
217253
218254 for (const file of findMarkdownFiles(DOCS_DIR)) {
219255 const src = readFileSync(file, 'utf-8')
@@ -677,11 +713,46 @@ function toRepoDataLNReader(plugins: LNReaderPlugin[]): RepoSite[] {
677713 return sites
678714}
679715
716const CONTENT_WARNING_RATING: Record<string, Rating> = {
717 CONTENT_WARNING_NSFW: 'nsfw',
718 CONTENT_WARNING_MIXED: 'suggestive',
719 CONTENT_WARNING_SAFE: 'safe'
720}
721
722function 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
680742async function toRepoData(indexUrl: string, json: unknown): Promise<RepoData> {
681743 const iconBase = indexUrl.slice(0, indexUrl.lastIndexOf('/'))
682744 let sites: RepoSite[]
683745 let suwatteV6: boolean | undefined
684746 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
685756 if (Array.isArray(json)) {
686757 const first = json[0] as Record<string, unknown> | undefined
687758 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
3535
3636## Manga
3737
38::: extrepo {scheme=tachiyomi}
38::: extrepo {scheme=mihon}
3939
4040== Keiyoushi
4141- url: https://keiyoushi.github.io/
4242- src: https://github.com/keiyoushi/extensions-source
4343- 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
4546
4647== Yūzōnō
4748- url: https://yuzono.github.io
4849- src: https://github.com/yuzono/tachiyomi-extensions
4950- 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
5153
5254== Fucked by FAKKU
5355- url: https://github.com/mojuru/cursed-manga-repo
5456- 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
5659
5760== Kavita
5861- 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
221221
222222## Tsundoku
223223
224::: extrepo {scheme=tachiyomi}
224::: extrepo {scheme=mihon}
225225
226226== Novel Sourcery
227227- url: https://novelsourcery.github.io/