Skip to content
This repository has been archived by the owner on Oct 21, 2023. It is now read-only.

Commit

Permalink
another lint
Browse files Browse the repository at this point in the history
  • Loading branch information
12944qwerty committed Aug 2, 2023
1 parent 3739b87 commit 854a5ee
Show file tree
Hide file tree
Showing 43 changed files with 291 additions and 289 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,5 @@ dist
.tern-port

/bundle

.DS_STORE
23 changes: 11 additions & 12 deletions src/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,27 @@ btn.addEventListener('click', () => {
count += 1
render()
}
})`
})`;

export function Settings(): React.ReactElement {
return (
<>
<Codeblock
lang="js"
code={previewData}
></Codeblock>
<br/>
<Codeblock lang="js" code={previewData}></Codeblock>
<br />
<SelectItem
options={themes.map(theme => {
return { label: theme, value: theme }
options={themes.map((theme) => {
return { label: theme, value: theme };
})}
onChange={theme => {
onChange={(theme) => {
cfg.set("theme", theme);

const themeStylesheet = document.getElementById("hljs-theme") as HTMLLinkElement;
if (themeStylesheet) themeStylesheet.href = `replugged://plugin/dev.kingfish.BetterCodeblocks/themes/${theme}.css`;
if (themeStylesheet)
themeStylesheet.href = `replugged://plugin/dev.kingfish.BetterCodeblocks/themes/${theme}.css`;
}}
isSelected={theme => cfg.get("theme") === theme}
>Preferred Theme</SelectItem>
isSelected={(theme) => cfg.get("theme") === theme}>
Preferred Theme
</SelectItem>
</>
);
}
10 changes: 7 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,17 @@ const injector = new Injector();
export interface SettingsType {
theme: string;
}
export const cfg = await settings.init<SettingsType>("dev.kingfish.BetterCodeblocks", { theme: "vs2015" });
export const cfg = await settings.init<SettingsType>("dev.kingfish.BetterCodeblocks", {
theme: "vs2015",
});

export function start(): void {
const themeStylesheet = document.createElement("link");
themeStylesheet.rel = "stylesheet";
themeStylesheet.id = "hljs-theme";
themeStylesheet.href = `replugged://plugin/dev.kingfish.BetterCodeblocks/themes/${cfg.get("theme")}.css`;
themeStylesheet.href = `replugged://plugin/dev.kingfish.BetterCodeblocks/themes/${cfg.get(
"theme",
)}.css`;
document.head.appendChild(themeStylesheet);

injector.after(parser.defaultRules.codeBlock, "react", (args, _) => {
Expand All @@ -38,6 +42,6 @@ export function start(): void {

export function stop(): void {
document.getElementById("hljs-theme")?.remove();

injector.uninjectAll();
}
12 changes: 6 additions & 6 deletions src/themes/a11y-dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@
.better-codeblocks .hljs-symbol,
.better-codeblocks .hljs-type,
.better-codeblocks .hljs-quote {
color: highlight;
}
color: highlight;
}

.better-codeblocks .hljs-keyword,
.better-codeblocks .hljs-selector-tag {
font-weight: bold;
}
.better-codeblocks .hljs-keyword,
.better-codeblocks .hljs-selector-tag {
font-weight: bold;
}
}
12 changes: 6 additions & 6 deletions src/themes/a11y-light.css
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@
.better-codeblocks .hljs-symbol,
.better-codeblocks .hljs-type,
.better-codeblocks .hljs-quote {
color: highlight;
}
color: highlight;
}

.better-codeblocks .hljs-keyword,
.better-codeblocks .hljs-selector-tag {
font-weight: bold;
}
.better-codeblocks .hljs-keyword,
.better-codeblocks .hljs-selector-tag {
font-weight: bold;
}
}
46 changes: 18 additions & 28 deletions src/themes/an-old-hope.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ Based on Jesse Leite's Atom syntax theme 'An Old Hope' – https://github.com/Je

/* Death Star Comment */
.better-codeblocks .hljs-comment,
.better-codeblocks .hljs-quote
{
color: #B6B18B;
.better-codeblocks .hljs-quote {
color: #b6b18b;
}

/* Darth Vader */
Expand All @@ -21,9 +20,8 @@ Based on Jesse Leite's Atom syntax theme 'An Old Hope' – https://github.com/Je
.better-codeblocks .hljs-selector-id,
.better-codeblocks .hljs-selector-class,
.better-codeblocks .hljs-regexp,
.better-codeblocks .hljs-deletion
{
color: #EB3C54;
.better-codeblocks .hljs-deletion {
color: #eb3c54;
}

/* Threepio */
Expand All @@ -34,56 +32,48 @@ Based on Jesse Leite's Atom syntax theme 'An Old Hope' – https://github.com/Je
.better-codeblocks .hljs-type,
.better-codeblocks .hljs-params,
.better-codeblocks .hljs-meta,
.better-codeblocks .hljs-link
{
color: #E7CE56;
.better-codeblocks .hljs-link {
color: #e7ce56;
}

/* Luke Skywalker */
.better-codeblocks .hljs-attribute
{
color: #EE7C2B;
.better-codeblocks .hljs-attribute {
color: #ee7c2b;
}

/* Obi Wan Kenobi */
.better-codeblocks .hljs-string,
.better-codeblocks .hljs-symbol,
.better-codeblocks .hljs-bullet,
.better-codeblocks .hljs-addition
{
color: #4FB4D7;
.better-codeblocks .hljs-addition {
color: #4fb4d7;
}

/* Yoda */
.better-codeblocks .hljs-title,
.better-codeblocks .hljs-section
{
color: #78BB65;
.better-codeblocks .hljs-section {
color: #78bb65;
}

/* Mace Windu */
.better-codeblocks .hljs-keyword,
.better-codeblocks .hljs-selector-tag
{
color: #B45EA4;
.better-codeblocks .hljs-selector-tag {
color: #b45ea4;
}

/* Millenium Falcon */
.better-codeblocks
{
.better-codeblocks {
display: block;
overflow-x: auto;
background: #1C1D21;
background: #1c1d21;
color: #c0c5ce;
padding: 0.5em;
}

.better-codeblocks .hljs-emphasis
{
.better-codeblocks .hljs-emphasis {
font-style: italic;
}

.better-codeblocks .hljs-strong
{
.better-codeblocks .hljs-strong {
font-weight: bold;
}
4 changes: 2 additions & 2 deletions src/themes/androidstudio.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Author: Pedro Oliveira <kanytu@gmail . com>
.better-codeblocks .hljs-literal,
.better-codeblocks .hljs-symbol,
.better-codeblocks .hljs-bullet {
color: #6897BB;
color: #6897bb;
}

.better-codeblocks .hljs-keyword,
Expand All @@ -42,7 +42,7 @@ Author: Pedro Oliveira <kanytu@gmail . com>
.better-codeblocks .hljs-string,
.better-codeblocks .hljs-attribute,
.better-codeblocks .hljs-addition {
color: #6A8759;
color: #6a8759;
}

.better-codeblocks .hljs-section,
Expand Down
18 changes: 9 additions & 9 deletions src/themes/arduino-light.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Arduino® Light Theme - Stefania Mellai <[email protected]>
display: block;
overflow-x: auto;
padding: 0.5em;
background: #FFFFFF;
background: #ffffff;
}

.better-codeblocks .hljs,
Expand All @@ -21,15 +21,15 @@ Arduino® Light Theme - Stefania Mellai <[email protected]>
.better-codeblocks .hljs-selector-tag,
.better-codeblocks .hljs-doctag,
.better-codeblocks .hljs-name {
color: #00979D;
color: #00979d;
}

.better-codeblocks .hljs-built_in,
.better-codeblocks .hljs-literal,
.better-codeblocks .hljs-bullet,
.better-codeblocks .hljs-code,
.better-codeblocks .hljs-addition {
color: #D35400;
color: #d35400;
}

.better-codeblocks .hljs-regexp,
Expand All @@ -39,7 +39,7 @@ Arduino® Light Theme - Stefania Mellai <[email protected]>
.better-codeblocks .hljs-link,
.better-codeblocks .hljs-selector-attr,
.better-codeblocks .hljs-selector-pseudo {
color: #00979D;
color: #00979d;
}

.better-codeblocks .hljs-type,
Expand All @@ -49,7 +49,7 @@ Arduino® Light Theme - Stefania Mellai <[email protected]>
.better-codeblocks .hljs-quote,
.better-codeblocks .hljs-template-tag,
.better-codeblocks .hljs-deletion {
color: #005C5F;
color: #005c5f;
}

.better-codeblocks .hljs-title,
Expand All @@ -59,11 +59,11 @@ Arduino® Light Theme - Stefania Mellai <[email protected]>
}

.better-codeblocks .hljs-comment {
color: rgba(149,165,166,.8);
color: rgba(149, 165, 166, 0.8);
}

.better-codeblocks .hljs-meta-keyword {
color: #728E00;
color: #728e00;
}

.better-codeblocks .hljs-meta {
Expand All @@ -79,9 +79,9 @@ Arduino® Light Theme - Stefania Mellai <[email protected]>
}

.better-codeblocks .hljs-function {
color: #728E00;
color: #728e00;
}

.better-codeblocks .hljs-number {
color: #8A7B52;
color: #8a7b52;
}
50 changes: 37 additions & 13 deletions src/themes/atom-one-dark-reasonable.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ Original One Dark Syntax theme from https://github.com/atom/one-dark-syntax
background: #282c34;
border-radius: 5px;
}
.better-codeblocks .hljs-keyword, .better-codeblocks .hljs-operator {
color: #F92672;
.better-codeblocks .hljs-keyword,
.better-codeblocks .hljs-operator {
color: #f92672;
}
.better-codeblocks .hljs-pattern-match {
color: #F92672;
color: #f92672;
}
.better-codeblocks .hljs-pattern-match .better-codeblocks .hljs-constructor {
color: #61aeee;
Expand All @@ -27,10 +28,10 @@ Original One Dark Syntax theme from https://github.com/atom/one-dark-syntax
color: #61aeee;
}
.better-codeblocks .hljs-function .better-codeblocks .hljs-params {
color: #A6E22E;
color: #a6e22e;
}
.better-codeblocks .hljs-function .better-codeblocks .hljs-params .better-codeblocks .hljs-typing {
color: #FD971F;
color: #fd971f;
}
.better-codeblocks .hljs-module-access .better-codeblocks .hljs-module {
color: #7e57c2;
Expand All @@ -39,31 +40,54 @@ Original One Dark Syntax theme from https://github.com/atom/one-dark-syntax
color: #e2b93d;
}
.better-codeblocks .hljs-constructor .better-codeblocks .hljs-string {
color: #9CCC65;
color: #9ccc65;
}
.better-codeblocks .hljs-comment, .better-codeblocks .hljs-quote {
.better-codeblocks .hljs-comment,
.better-codeblocks .hljs-quote {
color: #b18eb1;
font-style: italic;
}
.better-codeblocks .hljs-doctag, .better-codeblocks .hljs-formula {
.better-codeblocks .hljs-doctag,
.better-codeblocks .hljs-formula {
color: #c678dd;
}
.better-codeblocks .hljs-section, .better-codeblocks .hljs-name, .better-codeblocks .hljs-selector-tag, .better-codeblocks .hljs-deletion, .better-codeblocks .hljs-subst {
.better-codeblocks .hljs-section,
.better-codeblocks .hljs-name,
.better-codeblocks .hljs-selector-tag,
.better-codeblocks .hljs-deletion,
.better-codeblocks .hljs-subst {
color: #e06c75;
}
.better-codeblocks .hljs-literal {
color: #56b6c2;
}
.better-codeblocks .hljs-string, .better-codeblocks .hljs-regexp, .better-codeblocks .hljs-addition, .better-codeblocks .hljs-attribute, .better-codeblocks .hljs-meta-string {
.better-codeblocks .hljs-string,
.better-codeblocks .hljs-regexp,
.better-codeblocks .hljs-addition,
.better-codeblocks .hljs-attribute,
.better-codeblocks .hljs-meta-string {
color: #98c379;
}
.better-codeblocks .hljs-built_in, .better-codeblocks .hljs-class .better-codeblocks .hljs-title {
.better-codeblocks .hljs-built_in,
.better-codeblocks .hljs-class .better-codeblocks .hljs-title {
color: #e6c07b;
}
.better-codeblocks .hljs-attr, .better-codeblocks .hljs-variable, .better-codeblocks .hljs-template-variable, .better-codeblocks .hljs-type, .better-codeblocks .hljs-selector-class, .better-codeblocks .hljs-selector-attr, .better-codeblocks .hljs-selector-pseudo, .better-codeblocks .hljs-number {
.better-codeblocks .hljs-attr,
.better-codeblocks .hljs-variable,
.better-codeblocks .hljs-template-variable,
.better-codeblocks .hljs-type,
.better-codeblocks .hljs-selector-class,
.better-codeblocks .hljs-selector-attr,
.better-codeblocks .hljs-selector-pseudo,
.better-codeblocks .hljs-number {
color: #d19a66;
}
.better-codeblocks .hljs-symbol, .better-codeblocks .hljs-bullet, .better-codeblocks .hljs-link, .better-codeblocks .hljs-meta, .better-codeblocks .hljs-selector-id, .better-codeblocks .hljs-title {
.better-codeblocks .hljs-symbol,
.better-codeblocks .hljs-bullet,
.better-codeblocks .hljs-link,
.better-codeblocks .hljs-meta,
.better-codeblocks .hljs-selector-id,
.better-codeblocks .hljs-title {
color: #61aeee;
}
.better-codeblocks .hljs-emphasis {
Expand Down
Loading

0 comments on commit 854a5ee

Please sign in to comment.