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

3e0e093dbcc7a65861f7f47dcb3f7938f5430edf
wotaku/docs/.vitepress/configs/markdown/index.ts
Duck Extra notese2dfae1e5b 1 year ago

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

Global

⌘K
Command palette & jump
/
Focus search
?
Show this help
g d
Dashboard
g e
Explore repositories
g n
Notifications

Repository & editor

t
Find file in repository
y
Copy immutable SHA permalink
g c
Code tab
g i
Issues tab
g m
Merge requests tab
g b
Builds tab
⌘↵
Submit active form