docs/.vitepress/configs/markdown/index.ts
437 lines · 16982 bytes
1import MdMTables from 'markdown-it-multimd-table'
2// @ts-expect-error
3import MdReg from 'markdown-it-regexp'
4import type { MarkdownRenderer } from 'vitepress'
5import { headersPlugin } from '../markdown/headers'
6import { figure } from '@mdit/plugin-figure'
7import { imgLazyload } from '@mdit/plugin-img-lazyload'
8import { align } from '@mdit/plugin-align'
9import { imgSize } from '@mdit/plugin-img-size'
10import { tabsMarkdownPlugin } from 'vitepress-plugin-tabs'
11import { emojiRender } from './emoji'
12
13const tooltips: {
14 [key: string]: {
15 title?: string
16 icon?: string
17 content: string
18 }
19} = {
20 miruro: {
21 content: `
22 - Nice and minimal UI.
23 - Scrapes HiAnime (Zoro & Bun), AnimeKai (Arc & Gut) Animepahe (Kiwi), Gogo (Gogo & Vid), AnimeZ (Jet).
24 - Has built-in AniList support.`
25 },
26 AnimeStream: {
27 content: `
28 - Scrapes from Crunchyroll.
29 - UI is really basic.
30 - Browser has to support DRM.`
31 },
32 AnimeNexus: {
33 content: `
34 - Generally good video quality.
35 - Has multi-language softsub.
36 - Library size isn't that big. Good for recent airing shows.
37 - ⚠️ Has optimization issues on lower-end phones, may work better on different browsers. Doesn't support Safari / WebKit.`
38 },
39 KAA: {
40 content: `
41 - KAA encodes are on Videstreaming and Catstream. Birdstream scrapes Bilibili.
42 - Good for airing anime.
43 - Has good amount of missing old titles, but you can request them in their support server.`
44 },
45 AnimeKai: {
46 content: `
47 - Huge library.
48 - Re-encodes shows for smaller size.
49 - Mix of Web and Blu-ray releases.
50 - Anilist scraper is buggy. Adds PV, Specials & Extra entries even though it doesn't have the uploads.`
51 },
52 Zoro: {
53 content: `
54 - Huge library.
55 - Has multi-language softsub.
56 - Re-encodes shows for smaller size.`
57 },
58 Hikari: {
59 content: `
60 - Good for new airing.
61 - Uploads from good sources but re-encoded smaller file size.
62 - Large library size.`
63 },
64 Sudatchi: {
65 content: `
66 - Smaller library size. Good for new airing.
67 - Re-encoded to smaller filesize.
68 - Uses IPFS
69 - Only 1080p atm for most.`
70 },
71 AniZone: {
72 content: `
73 - Re-encoded to smaller file size.
74 - Very small library size.
75 - Good for airing shows.`
76 },
77 Animepahe: {
78 content: `
79 - Uploads mini encoded files, best if you want smaller files or have low bandwidth.
80 - Has a good amount of missing titles.
81 - Some titles don't get regular update.`
82 },
83 AllManga: {
84 content: `
85 - UI is really cluttered.
86 - Video quality fluctuates quite a bit.
87 - Players are a mix of self-hosted and scrapers.
88 - Luf-mp4 and Vid-mp4 are gogo scrapers.
89 - OK and AK have multiple resolutions.
90 - SW player is 720p only.`
91 },
92 Animotvslash: {
93 content: `
94 - Small library size.`
95 },
96 WCO: {
97 content: `
98 - Has both anime and cartoons.
99 - Library size is pretty good including old stuff.
100 - Uploads are compressed to mini-encode and low res.
101 - Movie uploads are paywalled. You can bypass some using wco.tv.`
102 },
103 AnimeZ: {
104 content: `
105 Good library size, most are scraped from Aniwave.`
106 },
107 OtakuStreamers: {
108 content: `
109 Although new releases are in 1080p, older releases are a mixed bag, ranging from 480p to 720p.`
110 },
111 AnimeRealms: {
112 content: `
113 Scrapes HiAnime (Soft), AnimePahe (Pahe), AnimeHeaven (Heaven - 720p).`
114 },
115 AniPlay: {
116 content: `
117 Scrapes HiAnime (Yuki), AnimePahe (Pahe).`
118 },
119 Enimoe: {
120 content: `
121 Scrapes HiAnime (Kaido), AnimeKai (Rose), AniZone (Zone), Anify (Violet), AnimeNoSub (Stack), FireAnime (Fire), Hikari (Cope), AnimeFox (Fox).`
122 },
123 Gojo: {
124 content: `
125 Scrapes AnimeOwl (Strix), AnimePahe (Pahe), AnimeZ (Zaza).`
126 },
127 ComicK: {
128 content: `
129 - Minimal compression
130 - Aggregates from various scanlation groups
131 - There's a 2/3 hour upload delay for most chapters sourced from scanlators' sites
132 - Has official translations
133 - Reader isn't as good as mangadex.`
134 },
135 MangaDex: {
136 content: `
137 - Uploads without compression
138 - Best reader UI (for a web reader)
139 - Uploads from various scanlation groups
140 - No official translations, barring some exceptions.
141 - May remove content if there is a DMCA request by the publisher or doesn't allow upload at all (e.g. One Punch-Man).`
142 },
143 WeebCentral: {
144 content: `
145 - Has official translations
146 - Compresses chapter images
147 - Chapter updates are relatively slow
148 - You can use AL sync with atsu.`
149 },
150 Batoto: {
151 content: `
152 - Has both scanlated and official releases
153 - Has some exclusive uploads
154 - Decent filtering options with site theme options
155 - Indexing is poor.`
156 },
157 MangaFire: {
158 content: `
159 - The UI is very clean with notification system
160 - Uploads both chapter (multi-lang) & volume releases
161 - Basic reader UI
162 - Watermark on almost every manga chapters
163 - Manga uploads are up to x1600.`
164 },
165 tron: {
166 content:
167 '[Comikey](https://comikey.com/), [J-Novel Club](https://j-novel.club/), [K Manga](https://kmanga.kodansha.com/), [Kodansha](https://kodansha.us/), [Manga UP!](https://global.manga-up.com/), [Seven Seas](https://sevenseasentertainment.com/), [SQUARE ENIX](https://squareenixmangaandbooks.square-enix-games.com/en-us), [VIZ](https://www.viz.com/), [Yen Press](https://yenpress.com/)'
168 },
169 anadius: { content: '[VIZ](https://www.viz.com/)' },
170 Danke: {
171 content:
172 '[Kodansha](https://kodansha.us/), [Seven Seas](https://sevenseasentertainment.com/), [VIZ](https://www.viz.com/), [Yen Press](https://yenpress.com/)'
173 },
174 DMF: {
175 content:
176 '[J-Novel Club](https://j-novel.club/), [Kodansha](https://kodansha.us/), [ONE PEACE BOOKS](https://www.onepeacebooks.com/), [Seven Seas](https://sevenseasentertainment.com/), [VIZ](https://www.viz.com/), [Yen Press](https://yenpress.com/)'
177 },
178 Empy: {
179 content:
180 '[Glacier Bay Books](https://glacierbaybooks.com/), [MANGA Plus](https://mangaplus.shueisha.co.jp/)'
181 },
182 Lord_ne: {
183 content:
184 '[Crunchyroll](https://store.crunchyroll.com/collections/manga/), [Lezhin Comics](https://www.lezhinus.com/en), [Yen Press](https://yenpress.com/)'
185 },
186 LuCaZ: {
187 content:
188 '[Kodansha](https://kodansha.us/), [Seven Seas](https://sevenseasentertainment.com/), [Yen Press](https://yenpress.com/)'
189 },
190 Oakminati: {
191 content:
192 '[MANGA Plus](https://mangaplus.shueisha.co.jp/), [Manga UP!](https://global.manga-up.com/) (Main), [SQUARE ENIX](https://squareenixmangaandbooks.square-enix-games.com/en-us)'
193 },
194 Rillant: {
195 content:
196 '[K Manga](https://kmanga.kodansha.com/), [Kodansha](https://kodansha.us/), [MANGA Plus](https://mangaplus.shueisha.co.jp/), [VIZ](https://www.viz.com/)'
197 },
198 Shellshock: {
199 content:
200 '[Kodansha](https://kodansha.us/), [VIZ](https://www.viz.com/), [Yen Press](https://yenpress.com/)'
201 },
202 Shizu: {
203 content:
204 '[Kodansha](https://kodansha.us/), [SuBLime](https://www.sublimemanga.com/), [VIZ](https://www.viz.com/), [Yen Press](https://yenpress.com/)'
205 },
206 Stick: {
207 content:
208 '[Cross Infinite World](https://www.crossinfworld.com/), [VIZ](https://www.viz.com/), [Yen Press](https://yenpress.com/)'
209 },
210 SWId: {
211 content:
212 '[Kodansha](https://kodansha.us/), [Seven Seas](https://sevenseasentertainment.com/), [Yen Press](https://yenpress.com/)'
213 },
214 TooManyIsekai: {
215 content:
216 '[J-Novel Club](https://j-novel.club/), [K Manga](https://kmanga.kodansha.com/), [Kodansha](https://kodansha.us/), [Manga UP!](https://global.manga-up.com/), [ONE PEACE BOOKS](https://www.onepeacebooks.com/), [Seven Seas](https://sevenseasentertainment.com/)'
217 },
218 Trite: {
219 content:
220 'Cover-to-cover (c2c) scans of physical-only books by various publishers.'
221 },
222 Ushi: {
223 content:
224 '[Seven Seas](https://sevenseasentertainment.com/), [Yen Press](https://yenpress.com/)'
225 },
226 AGR: {
227 content: 'Formerly Animated Glitched Scans and Animated Glitched Comics'
228 },
229 Scylla: { content: 'Formerly Scylla Scans' },
230 Flame: { content: 'Formerly Flame Scans' },
231 hive: { content: 'Formerly Infernal Void Scans and Void Scans' },
232 realm: { content: 'Formerly Realm Scans, Rizz Comics and Rizz Fables' },
233 utoon: { content: 'Formerly Manhwa Freak, freak scans, freak comics' },
234 Shiru: { content: 'Hard fork of Miru' },
235 Hakuneko: { content: 'For Linux, you have to use old one atm.' },
236 HDoujin: { content: 'Has a limit of 25 chapters per day.' },
237 CbxConverter: {
238 content:
239 'The version of Magick inside is really outdated. If you use it, download ImageMagick-[Latest_Version]-portable-Q8-x64.zip from the Imagemagick site, take the magick.exe from there and replace it in CbxConverter folder.'
240 },
241 BangumiList: {
242 content: 'Maintained by chinese devs, but lists JP schedule too.'
243 },
244 ComicRanking500: {
245 content:
246 "The rankings here are based on POS (point-of-sale) data from various bookstore chains in Japan's offline market. Books that primarily sell online or are heavily focused on online stores may rank lower on this list."
247 },
248 JosuKe: {
249 content:
250 "The site doesn't get updated often, visit their twitter for more recent graphs."
251 },
252 vtstats: {
253 content: "Doesn't get frequent updates, so there can be missing streamers."
254 },
255 Flud: { content: 'Has a VPN-only option.' },
256 imgdanke: {
257 content: "Optional for GUI, but doesn't support Pingo v1+ at the moment."
258 },
259 Misskey: { content: 'Registrations are currently limited to Japan only.' },
260 Boorusphere: {
261 content: 'Repo is archived, but still works as of October 25, 2024.'
262 },
263 VocaloidRadio: {
264 content: 'Stream URL (192kbps): https://vocaloid.radioca.st/stream'
265 },
266 xManager: {
267 content:
268 "Due to Spotify changes, it doesn't work well in a lot of regions. Switch to echo."
269 },
270 Nicotine: {
271 content: 'Direct peer-to-peer sharing network, primarily used for music.'
272 },
273 Koisuru: {
274 content:
275 'Subtitle files only, you need to get the episodes from another source.'
276 },
277 Spoilerplus: {
278 content:
279 "Image host is geo-restricted, so won't load pages in every region. Tested for the US."
280 },
281 Oppai: {
282 content: 'Late releases, but less compressed than other aggregators.'
283 },
284 nHentai: { content: 'Most popular. Decent UI but compresses images.' },
285 Akuma: { content: 'E-Hentai clone.' },
286 IMHentai: { content: 'Big library and great search filters.' },
287 Hitomi: { content: 'Big library, but difficult to navigate.' },
288 PandaBackup: {
289 content:
290 'Archive of stuff removed from E-Hentai due to DMCA complaints. Has some obscure stuff deleted on most sites.'
291 },
292 SchaleNetwork: {
293 content: 'Formerly Koharu, has Fakku/Irodori rips (official TLs).'
294 },
295 Yabai: { content: 'E-Hentai clone.' },
296 HentaiNexus: { content: 'Fakku/Irodori rips (official TLs).' },
297 EHentai: {
298 content:
299 "The Mangadex of doujins, almost every doujin is first uploaded here before being scraped by other sites. The online viewer compresses the images, but has the option to download in original quality. [ExHentai](https://exhentai.org/) is its sister site, which also hosts the more extreme and questionable content. You'll need an account on E-Hentai to gain access."
300 },
301 Rule34xxx: {
302 content: `
303 - Boasts a larger content library compared to Paheal.
304 - Features an extensive tagging system, allowing searches based on descriptions or depicted acts.
305 - Allows larger file uploads, up to 100MB.
306 - Searching is more user-friendly compared to Paheal.`
307 },
308 Rule34Paheal: {
309 content:
310 'Categorizes content by characters, franchises, events (such as holidays), animations, and sound, but limits uploads to 10MB.'
311 },
312 YACReader: {
313 content: `
314 - Has all the standard features, keeps last read history.
315 - Doesn't have built-in library like MComix, only the history.
316 - The bundled YACLibrary is excellent.
317 - Has lots of customization.
318 - Can act as a local manga server, like Calibre.
319 - But the server client for [Android](https://play.google.com/store/apps/details?id=com.yacreader.yacreader&hl=en&gl=US) and [iOS](https://apps.apple.com/ca/app/yacreader-comic-reader/id635717885) is paid.`
320 },
321 CDisplayEx: {
322 content: `
323 - Has a minimalist UI.
324 - Fast and simple reader with good amount of configuration.
325 - Has Nearest, Draft, linear and Lanczos (with various level) as scaling options.
326 - Not FOSS and not maintained since the development team has marked it as complete.
327 - No library view, only recent reads.`
328 },
329 OpenComic: {
330 content: `
331 - Nice clean UI, has dark mode.
332 - Has all the standard functions, including recent history.
333 - Has long strip mode which is pretty smooth.
334 - Has AniList tracking and controller support.
335 - Supports Lanczos and other scaling methods.`
336 },
337 MComix: {
338 content: `
339 - Minimal & responsive UI with good amount of customization.
340 - Has a nice library option and remembers last reading options.
341 - Has 3 scaling options: Normal, Bilinear (default) and Hyperbolic.`
342 },
343 SumatraPDF: {
344 content: `
345 - Very simple program with all the standard features.
346 - Doesn't have a library, but keeps track of recently opened files.
347 - Includes vertical mode.
348 - Can open a variety of ebook formats (PDF, epub, mobi, cbz/cbr, DjVu, XPS, CHM).`
349 },
350 Yomikiru: {
351 content:
352 'Simple UI with all the basic settings. Has longstrip mode and AniList tracking.'
353 },
354 kohi: { content: 'Sorta maintains all the official extensions by Aniyomi' },
355 ni3x: { content: 'Focuses on Torrents and Ero anime' },
356 secozzi: { content: 'For Jellyfin and Stremio' },
357 kei: { content: 'Maintained by former Tachiyomi contributors' },
358 yuzono: { content: 'By Komikku dev. Mirrors Keiyoushi repo with a few extra extensions' },
359 yuani: { content: 'By Komikku dev. Mirrors Kohi-den repo with a few extra extensions' },
360 demo: { content: 'Demo tooltips for start page' },
361 mirai: { content: 'Syncs the Mangayomi repository and includes their own plugins' },
362 megarepo: { content: 'Adds all the repo present in /recloudstream/cs-repos' },
363 dab: { content: 'Downloads from the Qobuz streaming platform, which only supports FLAC, not the other formats mentioned in the About page.' },
364 echo: { content: 'Use "extension" as code to load all the extensions.' },
365 cubari: { content: 'Scrapes MangaDex, WeebCentral, MangaKatana & scanlators.' },
366 mguru: { content: 'Another instance of Cubari maintained by different people. Not much maintained. Scrapes MangaDex and Manga Katana' },
367 akari: { content: 'Scrapes MangaKakalot.' },
368 mhaven: { content: 'Scrapes MangaFire.' },
369 komik: {content: 'Mostly up to the artist. Some of them are R2L too.'},
370 atosho: {content: 'Offers both DDL hosts and Usenet as download options, but only keeps uploads up to 16GB. DDL files might be auto-deleted by the hosts due to inactivity, unlike Usenet files. You can try [magicNZB](https://magicnzb.com/) for free Usenet downloads, as it allows temp-mails and does not require a CC.'},
371 linew: {content: 'In 2019, they rebranded LINE WEBTOON as WEBTOON. In some regions, it is still branded as LINE WEBTOON.'},
372 toomics: {content: 'Uploads pornhwa published in Toomics.com'},
373 daycomics: {content: 'Uploads pornhwa published in Daycomics.com'},
374}
375
376export function configureMarkdown(md: MarkdownRenderer) {
377 md.use(emojiRender)
378 md.use(imgLazyload)
379 md.use(align)
380 md.use(figure)
381 md.use(tabsMarkdownPlugin)
382 md.use(imgSize)
383 md.use(headersPlugin)
384 md.use(MdMTables, {
385 multiline: true,
386 rowspan: true,
387 headerless: true,
388 multibody: true,
389 aotolabel: true
390 })
391 renderTooltip(md)
392 renderInlineTooltip(md)
393}
394
395function renderInlineTooltip(md: MarkdownRenderer) {
396 md.use(
397 MdReg(
398 /\^\[(.*?)\]\((.+?)\)/,
399 ([, cont, hint]) =>
400 '<VTooltip theme="hint">' +
401 span(md.renderInline(cont)) +
402 '<template v-slot:popper>' +
403 md.renderInline(hint) +
404 '</template></VTooltip>'
405 )
406 )
407}
408
409function renderTooltip(md: MarkdownRenderer) {
410 md.use(
411 MdReg(/==(.+?)==/, ([, cont]) => {
412 const keys = Object.keys(tooltips)
413 if (!keys.includes(cont)) return 'No tooltip found for ' + cont
414 const item = tooltips[cont]
415
416 const icon = item.icon ? `icon="${item.icon}"` : ''
417 const title = item.title ? `title="${item.title}"` : ''
418 const props = icon + title
419 const renderedContent = md.render(item.content)
420
421 return `<Tooltip ${props}>` + renderedContent + '</Tooltip>'
422 })
423 )
424}
425
426function span(
427 content: string,
428 attrs: Record<string, any> | undefined = undefined
429) {
430 let html = '<span'
431 if (attrs)
432 for (const [key, value] of Object.entries(attrs)) {
433 html += ` ${key}="${value}"`
434 }
435 html += `>${content}</span>`
436 return html
437}