
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
kolmo-syntax
Advanced tools
A syntax coloring lib for html texts divs, primarily for Kolmo Lang but extensible
An elegant syntax highlighter for the Kolmo language, using TypeScript.
<link rel="stylesheet" href="dist/kolmo.css">
<script src="dist/kolmo-syntax.js"></script>
kolmo-syntax
class to the element containing Kolmo code:<div class="kolmo-syntax">
// Your Kolmo code here
</div>
<script>
// Initialize with default theme (Frappé)
init();
// Or specifies a theme
init({ theme: 'one-dark' });
// You can also set it later
setTheme('frappe');
</script>
npm install
npm run build
- Compiles TypeScript and copies CSS filesnpm run watch
- Watches for changes in TypeScript filesnpm run clean
- Cleans the distribution foldersrc/
syntax.ts
- TypeScript source codekolmo.css
- Styles and color themedist/
- Compiled JavaScript and processed CSSindex.html
- Usage exampletsconfig.json
- TypeScript configurationThe project uses the Catppuccin Frappé theme, providing a pleasant and high-contrast visual experience. Colors are defined as CSS variables for easy customization.
You can configure the theme programmatically:
init
function with options:init({ theme: 'frappe' }); // or 'one-dark'
setTheme('one-dark'); // or 'frappe'
The theme selection is persisted in localStorage and will be restored on page reload.
You can customize fonts and other styles by creating your own configuration file. Include it after the base CSS and theme files:
<link rel="stylesheet" href="dist/kolmo.css">
<link rel="stylesheet" href="dist/themes/frappe.css"> <!-- or other theme -->
<link rel="stylesheet" href="path/to/your-config.css">
Available font variables:
:root {
--kolmo-font-family: 'Your Font', monospace;
--kolmo-font-size: 16px;
--kolmo-line-height: 1.6;
--kolmo-font-weight-normal: 400;
--kolmo-font-weight-bold: 600;
}
Optional styling variables:
:root {
--kolmo-block-padding: 1.5rem;
--kolmo-block-border-radius: 8px;
}
See themes/config.css
for a complete example of customization options.
The project uses the Catppuccin Frappé theme by default. You can create your own theme by overriding the CSS variables:
my-theme.css
):root {
--kolmo-comment: #666666; /* Comments */
--kolmo-char: #98c379; /* Characters */
--kolmo-number: #d19a66; /* Numbers */
--kolmo-constructor: #c678dd; /* Constructors */
--kolmo-symbol: #56b6c2; /* Special symbols (λ, Π, ∀) */
--kolmo-operator: #e06c75; /* Operators */
--kolmo-declaration: #c678dd; /* Keywords: data, import */
--kolmo-definition: #d19a66; /* Keywords: def, gen */
--kolmo-control: #e5c07b; /* Keywords: if, else, case */
--kolmo-variable: #61afef; /* Variables */
--kolmo-match: #98c379; /* Keywords: match, switch */
--kolmo-delimiter: #c678dd; /* Delimiters: (), [], {} */
--kolmo-punctuation: #e5c07b; /* Punctuation: , ; : . */
}
/* Optional: Override the background and text colors */
.kolmo-syntax {
color: #abb2bf; /* Default text color */
background-color: #282c34; /* Background color */
}
<link rel="stylesheet" href="dist/kolmo.css">
<link rel="stylesheet" href="path/to/my-theme.css">
Available theme variables and their usage:
Variable | Description |
---|---|
--kolmo-comment | Single-line comments starting with // |
--kolmo-char | Character literals |
--kolmo-number | Numeric literals |
--kolmo-constructor | Constructors (#Name), <>, ->, [] |
--kolmo-symbol | Special symbols like λ, Π, ∀ |
--kolmo-operator | Mathematical and logical operators |
--kolmo-declaration | Declaration keywords (data, import) |
--kolmo-definition | Definition keywords (def, gen) |
--kolmo-control | Control flow keywords |
--kolmo-variable | Variable names |
--kolmo-match | Pattern matching keywords |
--kolmo-delimiter | Brackets and parentheses |
--kolmo-punctuation | Punctuation marks |
FAQs
A syntax coloring lib for html texts divs, primarily for Kolmo Lang but extensible
The npm package kolmo-syntax receives a total of 5 weekly downloads. As such, kolmo-syntax popularity was classified as not popular.
We found that kolmo-syntax demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.