add line numbers on code blocks
All checks were successful
Lint / pnpm_install (pull_request) Successful in 2m14s
Test (frontend) / vitest (22.x) (pull_request) Successful in 3m25s
Test (production install and build) / production (22.x) (pull_request) Successful in 2m48s
Lint / lint (backend) (pull_request) Successful in 4m12s
Lint / lint (frontend) (pull_request) Successful in 10m14s
Lint / lint (misskey-js) (pull_request) Successful in 2m31s
Lint / lint (sw) (pull_request) Successful in 2m34s
Lint / typecheck (backend) (pull_request) Successful in 3m34s
Lint / typecheck (misskey-js) (pull_request) Successful in 2m25s
All checks were successful
Lint / pnpm_install (pull_request) Successful in 2m14s
Test (frontend) / vitest (22.x) (pull_request) Successful in 3m25s
Test (production install and build) / production (22.x) (pull_request) Successful in 2m48s
Lint / lint (backend) (pull_request) Successful in 4m12s
Lint / lint (frontend) (pull_request) Successful in 10m14s
Lint / lint (misskey-js) (pull_request) Successful in 2m31s
Lint / lint (sw) (pull_request) Successful in 2m34s
Lint / typecheck (backend) (pull_request) Successful in 3m34s
Lint / typecheck (misskey-js) (pull_request) Successful in 2m25s
This commit is contained in:
parent
9dbb4124da
commit
9eded797d6
4 changed files with 27 additions and 3 deletions
2
locales/index.d.ts
vendored
2
locales/index.d.ts
vendored
|
@ -6843,7 +6843,7 @@ export interface Locale extends ILocale {
|
||||||
};
|
};
|
||||||
"_tutorialCompleted": {
|
"_tutorialCompleted": {
|
||||||
/**
|
/**
|
||||||
* Misskey初心者講座 修了証
|
* Forkey初心者講座 修了証
|
||||||
*/
|
*/
|
||||||
"title": string;
|
"title": string;
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -72,6 +72,25 @@ watch(() => props.lang, (to) => {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style module lang="scss">
|
<style module lang="scss">
|
||||||
|
.codeBlockRoot {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.codeBlockRoot :global(.shiki) > code {
|
||||||
|
counter-reset: step;
|
||||||
|
counter-increment: step 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.codeBlockRoot :global(.shiki) > code > span::before {
|
||||||
|
content: counter(step);
|
||||||
|
counter-increment: step;
|
||||||
|
width: 1rem;
|
||||||
|
margin-right: 1.5rem;
|
||||||
|
display: inline-block;
|
||||||
|
text-align: right;
|
||||||
|
color: rgba(115,138,148,.4)
|
||||||
|
}
|
||||||
|
|
||||||
.codeBlockRoot :global(.shiki) {
|
.codeBlockRoot :global(.shiki) {
|
||||||
padding: 1em;
|
padding: 1em;
|
||||||
margin: .5em 0;
|
margin: .5em 0;
|
||||||
|
|
|
@ -206,7 +206,8 @@ watch(v, newValue => {
|
||||||
outline: 0;
|
outline: 0;
|
||||||
min-width: calc(100% - 24px);
|
min-width: calc(100% - 24px);
|
||||||
height: 100%;
|
height: 100%;
|
||||||
padding: 12px;
|
// the +2.5 rem is because of the line numbers
|
||||||
|
padding: 12px 12px 12px calc(12px + 2.5rem);
|
||||||
line-height: 1.5em;
|
line-height: 1.5em;
|
||||||
font-size: 1em;
|
font-size: 1em;
|
||||||
font-family: Consolas, Monaco, Andale Mono, Ubuntu Mono, monospace;
|
font-family: Consolas, Monaco, Andale Mono, Ubuntu Mono, monospace;
|
||||||
|
|
|
@ -64,8 +64,12 @@ export async function parsePluginMeta(code: string): Promise<AiScriptPluginMeta>
|
||||||
try {
|
try {
|
||||||
ast = parser.parse(code);
|
ast = parser.parse(code);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
if (err instanceof Error) {
|
||||||
|
throw new Error(`Aiscript syntax error\n${(err as Error).message}`);
|
||||||
|
} else {
|
||||||
throw new Error('Aiscript syntax error');
|
throw new Error('Aiscript syntax error');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const meta = Interpreter.collectMetadata(ast);
|
const meta = Interpreter.collectMetadata(ast);
|
||||||
if (meta == null) {
|
if (meta == null) {
|
||||||
|
|
Loading…
Reference in a new issue