-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
19 additions
and
14 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,14 @@ | ||
import ky from 'https://unpkg.com/ky' | ||
import Alpine from 'https://esm.sh/[email protected]' | ||
import 'https://unpkg.com/@highlightjs/[email protected]/highlight.min.js' | ||
import 'https://cdn.jsdelivr.net/gh/highlightjs/[email protected]/build/languages/shell.min.js' | ||
import { getHighlighter } from 'https://esm.sh/shiki' | ||
|
||
|
||
const highlighter = await getHighlighter({ | ||
themes: ['andromeeda'], | ||
langs: ['shellsession', 'shell'], | ||
}) | ||
|
||
console.log('highlighter', highlighter) | ||
|
||
|
||
document.addEventListener('alpine:init', () => { | ||
|
@@ -15,7 +22,8 @@ document.addEventListener('alpine:init', () => { | |
this.errors = errors | ||
}, | ||
colorizeHttpie() { | ||
return hljs.highlight(this.httpie, { language: 'shell' }).value | ||
if (!this.httpie) return '' | ||
return highlighter.codeToHtml(this.httpie, { lang: 'shellsession', theme: 'andromeeda' }) | ||
} | ||
})) | ||
}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,9 +9,8 @@ | |
<meta property='og:title' content='Online tool to convert cURL command to HTTPie'> | ||
<meta property='og:image' content='https://www.nicepng.com/png/full/6-60631_pie-png.png'> | ||
<link rel='icon' href="{{ url_for('static', path='favicon.png') }}"> | ||
<link rel='stylesheet' href='https://matcha.mizu.sh/matcha.css'> | ||
<link rel='stylesheet' href='https://matcha.mizu.sh/matcha.lite.css'> | ||
<link rel='stylesheet' href="{{ url_for('static', path='uno.css?v=1') }}"> | ||
<link rel='stylesheet' href='https://unpkg.com/@highlightjs/[email protected]/styles/a11y-dark.min.css'> | ||
<title>CurliPie</title> | ||
</head> | ||
<body> | ||
|
@@ -25,11 +24,11 @@ | |
</div> | ||
</header> | ||
<main x-data='app'> | ||
<form method='POST' x-on:submit.prevent='onSubmit' class='flex flex-col md:flex-row items-center space-y-4 sm:space-y-0 sm:space-x-4'> | ||
<form method='POST' x-on:submit.prevent='onSubmit' class='flex flex-col sm:flex-row sm:items-center space-y-4 sm:space-y-0 sm:space-x-4'> | ||
<div class='grow'> | ||
<textarea name='curl' class='font-mono' x-model='curl'></textarea> | ||
<textarea name='curl' class='font-mono resize-y sm:resize-none' x-model='curl'></textarea> | ||
</div> | ||
<div class='min-w-20'> | ||
<div class='min-w-20 text-center'> | ||
<button>Convert</button> | ||
</div> | ||
</form> | ||
|