-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
46 lines (36 loc) · 1.34 KB
/
Copy pathscript.js
File metadata and controls
46 lines (36 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// https://github.com/github/linguist/blob/master/vendor/README.md
const grammarIndexUrl = 'https://cdn.jsdelivr.net/gh/github/linguist/vendor/README.md'
const seperator = '```'
;(async () => {
const response = await fetch( grammarIndexUrl )
.catch( fetchError => console.error )
const markdownContent = await response.text()
const languageNames = markdownContent
.replaceAll('*', '')
.replaceAll('-', '')
.split(/\r?\n/)
.slice( 8, -1 )
.map( rawLine => {
const [ name ] = rawLine.trim().split(':')
return name.trim()
})
console.log( 'total languages', languageNames.length )
const languageExamples = languageNames.map( name => {
return `
### ${ name }
${ seperator }${ name }
https://vumbnail.com/W2EMHNhyEnQ.jpg
${ seperator }
${ seperator }${ name }
https://vumbnail.com/youtube/W2EMHNhyEnQ.jpg
${ seperator }
${ seperator }${ name }
https://vumbnail.com:3000/W2EMHNhyEnQ_word_with-dash.jpg?query=string&object[property]=value&object.property=value
${ seperator }
${ seperator }${ name }
https://canary.vumbnail.com:3000/W2EMHNhyEnQ_word_with-dash.jpg?query=string&object[property]=value&object.property=value
${ seperator }
`
}).join('<br><br><br>')
console.log( 'languageExamples', languageExamples )
})()