@ballerina/highlightjs-ballerina

中文文档
1.0.1发布于 2023/08/28Apache-2.0CommonJS零依赖近 30 天下载 2574

Ballerina language support for highlight.js

原始使用文档
文档目录6 节
  1. Usage
  2. Static website or simple usage
  3. With node or another build system
  4. License
  5. Author
  6. Links

The Ballerina programming language

GitHub (pre-)release GitHub (Pre-)Release Date GitHub last commit License Twitter Follow

Ballerina is a statically typed, open-source cloud-native programming language developed and supported by WSO2.

With Ballerina, you could easily develop microservices, API endpoints and integrations, and any other application for the cloud. Additionally, Ballerina has all the general-purpose functionalities you could expect from a modern programming language.

With Ballerina's compiler-level built-in support for widely used data types such as JSON and XML, your focus on handling structured data, network service interactions, and dealing with concurrency is made much more effective.

Providing and consuming services

It has inherently concurrent first-class language constructs for providing and consuming services.

Sequence diagrams

Sequence diagram based graphical view shows the most fundamental aspect of the semantics of a network distributed application.

Structural typing

It allows for looser coupling between distributed components and eliminates the friction of data binding.

Metadata

Extensible metadata enables easy integration of Ballerina programs with cloud platforms. You could directly generate Docker and Kubernetes artifacts straight away from the source code.

highlightjs-ballerina

This repository offers highlight.js support for Ballerina.

Usage

The first step in setting up syntax highlighting for Ballerina is to setup highlight.js library in your webpage or the node app.

Static website or simple usage

After loading highlight.js, load the CDN build of Ballerina located in the dist folder.

<!-- stylesheet -->
<link rel="stylesheet" href="https://unpkg.com/highlightjs/styles/vs.css" />

<!-- scripts -->
<script type="text/javascript" src="/path/to/highlight.min.js"></script>
<script type="text/javascript" src="/path/to/ballerina.min.js"></script>
<script type="text/javascript">
    hljs.highlightAll();
</script>

With node or another build system

If you're using Node / Webpack / Rollup / Browserify, etc, simply require the language module, then register it with Highlight.js.

var hljs = require('highlightjs');
var hljsBallerina = require('@ballerina/highlightjs-ballerina');

hljs.registerLanguage('ballerina', hljsBallerina);
hljs.highlightAll();

License

Ballerina code is distributed under Apache license 2.0.

Author

版本与发布记录

@ballerina/highlightjs-ballerina 共发布 2 个版本,首次发布于 2023/08/28;过去 12 个月发布了 0 个版本。

版本发布日期距今
1.0.1latest2023/08/283 年前
1.0.02023/08/283 年前

关于 @ballerina/highlightjs-ballerina 的常见问题

@ballerina/highlightjs-ballerina 是什么?

Ballerina language support for highlight.js

如何安装 @ballerina/highlightjs-ballerina?

在项目目录运行 npm install @ballerina/highlightjs-ballerina,或使用 pnpm add / yarn add / bun add。

@ballerina/highlightjs-ballerina 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/ballerina__highlightjs-ballerina 是否存在。

@ballerina/highlightjs-ballerina 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@ballerina/highlightjs-ballerina 可以商用吗?

@ballerina/highlightjs-ballerina 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@ballerina/highlightjs-ballerina 的下载量有多少?

根据 npm 官方下载统计,@ballerina/highlightjs-ballerina 在 2026/10/08 – 2026/11/06 这 30 天内被下载 2,574 次,日均约 86 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@ballerina/highlightjs-ballerina 还在维护吗?

最新版本 1.0.1 发布于 2023/08/28(3 年前);至今共发布 2 个版本,其中过去 12 个月发布了 0 个;首次发布于 2023/08/28。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。