0.31.9 • Published 1 year ago

sthl v0.31.9

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

STHL

import {Highlighter,css,extractLangInfoArrayFromVSCEURLs,extractThemeFromVSCTURLs} from 'sthl'
const style=document.createElement('style')
style.textContent=css
document.body.append(style)
const example=`# Test
\`\`\`ts
class Text{
    constructor(array?:string[]){
        for(const item of array??[]){
            console.log(item)
        }
    }
}
\`\`\``
;(async()=>{
    const langInfoArray=await extractLangInfoArrayFromVSCEURLs([
        'markdown-basics/package.json',
    ],'https://cdn.jsdelivr.net/gh/microsoft/vscode/extensions/')
    langInfoArray.push(...await extractLangInfoArrayFromVSCEURLs([
        'microsoft/vscode-typescript-next/package.json',
    ],'https://cdn.jsdelivr.net/gh/'))
    langInfoArray.push({
        name:'markdown',
        alias:['md']
    },{
        name:'typescript',
        alias:['ts']
    })
    const theme=await extractThemeFromVSCTURLs([
        'dark_plus.json'
    ],'https://cdn.jsdelivr.net/gh/microsoft/vscode/extensions/theme-defaults/themes/')
    document.body.style.background='#1E1E1E'
    document.body.style.color='#D4D4D4'
    const highlighter=new Highlighter(langInfoArray,theme)
    document.body.append(await highlighter.highlightToElement(example,'md'))
})()
0.31.9

1 year ago

0.31.8

1 year ago

0.9.3

2 years ago

0.11.0

2 years ago

0.10.1

2 years ago

0.12.0

2 years ago

0.13.0

2 years ago

0.12.1

2 years ago

0.13.1

2 years ago

0.12.2

2 years ago

0.13.2

2 years ago

0.13.3

2 years ago

0.10.0

2 years ago

0.3.0

2 years ago

0.9.0

2 years ago

0.8.0

2 years ago

0.2.6

2 years ago

0.9.2

2 years ago

0.9.1

2 years ago

0.5.0

2 years ago

0.4.0

2 years ago

0.3.1

2 years ago

0.7.0

2 years ago

0.2.5

2 years ago

0.6.0

2 years ago

0.2.4

2 years ago

0.2.3

2 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.2.2

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.0

3 years ago

0.1.1

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.1

3 years ago