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