-
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support suger-high #46
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
examples/web/css/shaku.css
Outdated
@@ -4,12 +4,13 @@ pre.shaku { | |||
overflow-x: auto; | |||
} | |||
|
|||
pre.shaku .line { | |||
pre.shaku .line, | |||
pre.shaku .sh__line { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
separate these 2 sets of CSS
--sh-string: #00a99a; | ||
--sh-keyword: #f47067; | ||
--sh-comment: #a19595; | ||
--sh-jsxliterals: #6266d1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dark mode
@@ -48,7 +48,7 @@ function isShakuDirectiveHighlightInline(str: string): { | |||
shift: number; | |||
isHighlightInline: boolean; | |||
} { | |||
const significantLine = str.replace(/ /g, ""); | |||
const significantLine = str.replace(/\s/g, ""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- add tests
|
||
### Patch Changes | ||
|
||
- bump |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- remove this
@@ -0,0 +1,52 @@ | |||
# shaku-code-annotate-shiki |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- update this
@@ -0,0 +1,52 @@ | |||
# shaku-code-annotate-shiki | |||
|
|||
<ruby>釈<rp>(<rp><rt>Shaku</rt><rp>)<rp></ruby>- _elucidate, explain_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- also update shaku homepage
@@ -0,0 +1,34 @@ | |||
{ | |||
"name": "shaku-code-annotate-sugar-high", | |||
"version": "0.1.4", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 0.0.1?
* 4. the first meaningful token has the comment body | ||
* - find the first explanation that is not `punctuation.definition`. | ||
*/ | ||
function parseComment( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- update
@@ -0,0 +1,26 @@ | |||
export const defaultCode = ` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- test
|
||
return ( | ||
<button onClick={handleClick}> | ||
{/* ^ */} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- add
// xxx
in jsx
|
||
// @ts-ignore | ||
// this type is missing from sugar-high | ||
const TokenTypes = sh.SugarHigh.TokenTypes; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- create an issue on sugar-high
type RawToken = [number, string]; | ||
|
||
export function highlight(code: string) { | ||
const tokens = sh.tokenize(code); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- move the logic into codeToHTML?
); | ||
contents.push( | ||
// in sugar-high, we don't need md parsing | ||
nextLine.line.config.content |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- this needs to be escaped!
); | ||
j += 1; | ||
} | ||
html += renderComponent({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- separate renderComponent() into two, one supports HTML and sanitize. one does escape.
#43