Skip to content

Commit

Permalink
feat: lots of updates for next release
Browse files Browse the repository at this point in the history
  • Loading branch information
Aloso committed Dec 23, 2024
1 parent c5b913b commit 97a0128
Show file tree
Hide file tree
Showing 30 changed files with 664 additions and 113 deletions.
2 changes: 1 addition & 1 deletion LICENSE-MIT
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 Ludwig Stecher
Copyright (c) 2022 the Pomsky developers

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
132 changes: 78 additions & 54 deletions assets/js/highlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,78 +26,82 @@ hljs.registerLanguage('pomsky', function (hljs) {
],
}

return {
name: 'pomsky',
aliases: ['pomsky'],
unicodeRegex: true,
const CODEPOINT = {
scope: 'codepoint',
className: 'literal',
begin: /\bU\s*\+\s*[\p{Alpha}\d_]+/,
returnBegin: true,
contains: [
{ begin: /\bU\s*\+\s*/ },
{
// 0-D7FF
begin:
/\b0*(0|[1-9a-cA-C][0-9a-fA-F]{0,3}|[dD](?:[0-7][0-9a-fA-F]{0,2}|[8-9a-fA-F][0-9a-fA-F]?)?|[e-fE-F][0-9a-fA-F]{0,2})\b/,
endsParent: true,
},
{
// E000-10FFFF
begin:
/\b0*(1(?:0[0-9a-fA-F]{3,4}|[1-9a-fA-F][0-9a-fA-F]{3})|[2-9a-dA-D][0-9a-fA-F]{4}|[e-fE-F][0-9a-fA-F]{3,4})\b/,
endsParent: true,
},
{
className: 'illegal',
begin: /\b[\p{Alpha}\d_]+\b/,
endsParent: true,
},
],
}

const TEST = {
scope: 'test',
begin: [/\btest/, /\s*/, /\{/],
beginScope: {
1: 'keyword',
3: 'punctuation',
},
end: /\}/,
endScope: 'punctuation',
contains: [
hljs.HASH_COMMENT_MODE,
STRING,
{
scope: 'codepoint',
className: 'literal',
begin: /\bU\s*\+\s*[\p{Alpha}\d_]+/,
returnBegin: true,
contains: [
{ begin: /\bU\s*\+\s*/ },
{
// 0-D7FF
begin:
/\b0*(0|[1-9a-cA-C][0-9a-fA-F]{0,3}|[dD](?:[0-7][0-9a-fA-F]{0,2}|[8-9a-fA-F][0-9a-fA-F]?)?|[e-fE-F][0-9a-fA-F]{0,2})\b/,
endsParent: true,
},
{
// E000-10FFFF
begin:
/\b0*(1(?:0[0-9a-fA-F]{3,4}|[1-9a-fA-F][0-9a-fA-F]{3})|[2-9a-dA-D][0-9a-fA-F]{4}|[e-fE-F][0-9a-fA-F]{3,4})\b/,
endsParent: true,
},
{
className: 'illegal',
begin: /\b[\p{Alpha}\d_]+\b/,
endsParent: true,
},
],
className: 'keyword',
begin: /\b(match|reject|as|in)\b/,
},
{
scope: 'test',
begin: [/\btest/, /\s*/, /\{/],
beginScope: {
1: 'keyword',
3: 'punctuation',
},
className: 'punctuation',
begin: /\{/,
end: /\}/,
endScope: 'punctuation',
contains: [
hljs.HASH_COMMENT_MODE,
STRING,
{
className: 'keyword',
begin: /\b(match|reject|as|in)\b/,
className: 'title',
begin: /\b[a-zA-Z]\w*\b/,
},
{
className: 'punctuation',
begin: /\{/,
end: /\}/,
contains: [
hljs.HASH_COMMENT_MODE,
STRING,
{
className: 'title',
begin: /\b[a-zA-Z]\w*\b/,
},
{
className: 'number',
begin: /\d+/,
},
],
className: 'number',
begin: /\d+/,
},
],
},
],
}

return {
name: 'pomsky',
aliases: ['pomsky'],
unicodeRegex: true,
contains: [
hljs.HASH_COMMENT_MODE,
STRING,
CODEPOINT,
TEST,
{
className: 'keyword',
beginKeywords:
'U let lazy greedy range base atomic enable disable if else recursion regex test',
'U let lazy greedy range base atomic enable disable if else recursion regex test call',
},
{
className: 'keyword',
Expand Down Expand Up @@ -136,7 +140,27 @@ hljs.registerLanguage('pomsky', function (hljs) {
},
{
className: 'punctuation',
begin: /[[\](),=;|]+/,
begin: /\[/,
contains: [
hljs.HASH_COMMENT_MODE,
STRING,
CODEPOINT,
{
begin: [/\b(\w+:)?/, /\w+\b|\./],
beginScope: {
2: 'title',
},
},
{
className: 'keyword',
begin: /[-!]/,
},
],
end: /\]/,
},
{
className: 'punctuation',
begin: /[\](),=;|]+/,
},
{
className: 'number',
Expand Down
1 change: 1 addition & 0 deletions assets/scss/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@
@import 'common/syntax';
@import 'common/examples';
@import 'common/advantages';
@import 'common/terminal';
8 changes: 8 additions & 0 deletions assets/scss/common/_custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -516,3 +516,11 @@ article [id].h4 {
}
}
}

.footnotes ol {
font-size: 90%;

p {
font-size: inherit;
}
}
60 changes: 60 additions & 0 deletions assets/scss/common/_terminal.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
.terminal {
padding: 1rem;
overflow: auto;
line-height: 120%;
background-color: #0003;

--red: #f22;
--bright-red: #f66;
--green: #2c2;
--bright-green: #5d5;
--yellow: #ff0;
--bright-yellow: #ff5;
--blue: #22f;
--bright-blue: #55f;
--cyan: #0dd;
--bright-cyan: #4ff;
--magenta: #f0f;
--bright-magenta: #f5f;

@media (max-width: 800px) {
font-size: 0.84rem;
}
@media (max-width: 560px) {
font-size: 0.8rem;
}

.shell {
color: #32d132;
user-select: none;
pointer-events: none;
}
.cmd {
color: #419df3;
}
.hl {
color: #00ffff;
font-weight: bold;
}
.arg {
color: white;
}
.str {
color: #ffba24;
}
.pipe,
.punct {
color: #a2be00;
}
.flag {
color: #ff7167;
}
.esc {
color: #d558f5;
font-weight: bold;
}
.caret {
background-color: white;
user-select: none;
}
}
2 changes: 1 addition & 1 deletion config/_default/params.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ fillImage = "1270x"
footer = 'Powered by <a class="text-muted" href="https://gohugo.io/">Hugo</a> and <a class="text-muted" href="https://getdoks.org/">Doks</a>'

# Feed
copyRight = "Copyright (c) 2022 Ludwig Stecher"
copyRight = "Copyright (c) 2022 the Pomsky developers"

# Alert
alert = false
Expand Down
Loading

0 comments on commit 97a0128

Please sign in to comment.