docs/.vitepress/configs/markdown/index.ts

a122853b6661902be1a69a57e4761ce2196a7738
wotaku/docs/.vitepress/configs/markdown/index.ts history · blame · raw

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