Compare commits

...

4 commits

Author SHA1 Message Date
766942cfe9 Merge branch 'main' into cherrypick/small-and-center
All checks were successful
Test (frontend) / vitest (22.x) (pull_request) Successful in 2m40s
Test (production install and build) / production (22.x) (pull_request) Successful in 4m19s
Lint / pnpm_install (pull_request) Successful in 24s
Lint / lint (backend) (pull_request) Successful in 54s
Lint / lint (frontend) (pull_request) Successful in 7m7s
Lint / lint (misskey-js) (pull_request) Successful in 30s
Lint / lint (sw) (pull_request) Successful in 27s
Lint / typecheck (backend) (pull_request) Successful in 1m18s
Lint / typecheck (misskey-js) (pull_request) Successful in 28s
2025-02-03 13:15:59 +00:00
513b8b2bba Merge pull request 'Line numbers on code blocks' (#46) from feature/line-numbers-on-code-blocks into main
All checks were successful
Lint / pnpm_install (push) Successful in 2m46s
Test (production install and build) / production (22.x) (push) Successful in 3m44s
Lint / lint (backend) (push) Successful in 2m33s
Lint / lint (frontend) (push) Successful in 9m19s
Lint / lint (misskey-js) (push) Successful in 1m54s
Lint / lint (sw) (push) Successful in 1m58s
Lint / typecheck (backend) (push) Successful in 2m40s
Lint / typecheck (misskey-js) (push) Successful in 1m53s
Reviewed-on: #46
2025-02-03 13:12:18 +00:00
7e21b10a4f Merge branch 'main' into feature/line-numbers-on-code-blocks
All checks were successful
Lint / pnpm_install (pull_request) Successful in 1m54s
Test (frontend) / vitest (22.x) (pull_request) Successful in 2m30s
Test (production install and build) / production (22.x) (pull_request) Successful in 2m42s
Lint / lint (backend) (pull_request) Successful in 1m55s
Lint / lint (misskey-js) (pull_request) Successful in 1m58s
Lint / lint (sw) (pull_request) Successful in 1m29s
Lint / typecheck (misskey-js) (pull_request) Successful in 1m29s
Lint / typecheck (backend) (pull_request) Successful in 2m43s
Lint / lint (frontend) (pull_request) Successful in 8m7s
2025-02-03 12:34:38 +00:00
9eded797d6 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
2025-01-19 17:34:43 +01:00
4 changed files with 27 additions and 3 deletions

2
locales/index.d.ts vendored
View file

@ -6843,7 +6843,7 @@ export interface Locale extends ILocale {
};
"_tutorialCompleted": {
/**
* Misskey初心者講座
* Forkey初心者講座
*/
"title": string;
/**

View file

@ -72,6 +72,25 @@ watch(() => props.lang, (to) => {
</script>
<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) {
padding: 1em;
margin: .5em 0;

View file

@ -206,7 +206,8 @@ watch(v, newValue => {
outline: 0;
min-width: calc(100% - 24px);
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;
font-size: 1em;
font-family: Consolas, Monaco, Andale Mono, Ubuntu Mono, monospace;

View file

@ -64,7 +64,11 @@ export async function parsePluginMeta(code: string): Promise<AiScriptPluginMeta>
try {
ast = parser.parse(code);
} catch (err) {
throw new Error('Aiscript syntax error');
if (err instanceof Error) {
throw new Error(`Aiscript syntax error\n${(err as Error).message}`);
} else {
throw new Error('Aiscript syntax error');
}
}
const meta = Interpreter.collectMetadata(ast);