Skip to content

Commit 5df4e7d

Browse files
committed
docs: add AI metadata to priority pages
1 parent 98ff41f commit 5df4e7d

17 files changed

Lines changed: 485 additions & 63 deletions

File tree

scripts/generate-llms-full.js

Lines changed: 54 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,41 @@ function parseFrontmatter(content) {
3737

3838
const raw = match[1];
3939
const meta = {};
40+
let currentArrayKey = null;
41+
42+
function cleanValue(value) {
43+
value = value.trim();
44+
if (value.startsWith('"') && value.endsWith('"')) {
45+
return value.slice(1, -1);
46+
}
47+
if (value.startsWith("'") && value.endsWith("'")) {
48+
return value.slice(1, -1);
49+
}
50+
return value;
51+
}
52+
4053
for (const line of raw.split("\n")) {
54+
const arrayItemMatch = line.match(/^\s+-\s+(.*)$/);
55+
if (currentArrayKey && arrayItemMatch) {
56+
meta[currentArrayKey].push(cleanValue(arrayItemMatch[1]));
57+
continue;
58+
}
59+
4160
const m = line.match(/^([a-zA-Z0-9_-]+):\s*(.*)$/);
4261
if (m) {
43-
let value = m[2].trim();
44-
if (value.startsWith('"') && value.endsWith('"')) {
45-
value = value.slice(1, -1);
46-
} else if (value.startsWith("'") && value.endsWith("'")) {
47-
value = value.slice(1, -1);
62+
const key = m[1];
63+
const value = m[2].trim();
64+
if (value === "") {
65+
meta[key] = [];
66+
currentArrayKey = key;
67+
} else {
68+
meta[key] = cleanValue(value);
69+
currentArrayKey = null;
4870
}
49-
meta[m[1]] = value;
71+
continue;
5072
}
73+
74+
currentArrayKey = null;
5175
}
5276
return { frontmatter: match[0], body: content.slice(match[0].length), meta };
5377
}
@@ -295,6 +319,29 @@ function getDocUrl(filePath, meta) {
295319
return `https://docs.nervos.org/docs/${withoutExt}`;
296320
}
297321

322+
function formatPageMetadata(meta) {
323+
const fields = [
324+
["description", "Description"],
325+
["tags", "Tags"],
326+
["audience", "Audience"],
327+
["related", "Related"],
328+
["difficulty", "Difficulty"],
329+
["last_reviewed", "Last reviewed"],
330+
];
331+
const lines = [];
332+
333+
for (const [key, label] of fields) {
334+
const value = meta[key];
335+
if (Array.isArray(value) && value.length > 0) {
336+
lines.push(`${label}: ${value.join(", ")}`);
337+
} else if (typeof value === "string" && value.length > 0) {
338+
lines.push(`${label}: ${value}`);
339+
}
340+
}
341+
342+
return lines.length > 0 ? `${lines.join("\n")}\n\n` : "";
343+
}
344+
298345
function main() {
299346
const files = walk(DOCS_DIR).sort();
300347

@@ -328,6 +375,7 @@ function main() {
328375
output += `---\n\n`;
329376
output += `## Source: ${relative}\n`;
330377
output += `URL: ${url}\n\n`;
378+
output += formatPageMetadata(meta);
331379
output += cleaned;
332380
output += "\n\n";
333381
}

website/docs/ckb-fundamentals/cell-model.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
11
---
22
id: cell-model
33
title: Cell Model
4+
description: "Understand CKB's generalized UTXO Cell Model, including Live Cells, Dead Cells, capacity, ownership, state rent, and scalability."
5+
tags:
6+
- concept
7+
- cell-model
8+
- utxo
9+
- capacity
10+
- transaction
11+
audience:
12+
- dApp developers
13+
- Script developers
14+
related:
15+
- /docs/getting-started/how-ckb-works
16+
- /docs/tech-explanation/cell
17+
- /docs/tech-explanation/capacity
18+
- /docs/tech-explanation/transaction
19+
difficulty: beginner
20+
last_reviewed: 2026-06-24
421
---
522

623
> Nervos CKB inherits Bitcoin’s architecture and creates the Cell Model, a generalized UTXO model as state storage.

website/docs/ckb-fundamentals/nervos-blockchain.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
---
22
id: nervos-blockchain
33
title: Nervos Blockchain
4+
description: "Get a beginner overview of Nervos CKB as a layered, proof-of-work blockchain for CKBytes, on-chain state, and CKB-VM programs."
5+
tags:
6+
- concept
7+
- layer-1
8+
- ckb-vm
9+
- consensus
10+
audience:
11+
- dApp developers
12+
- Script developers
13+
related:
14+
- /docs/getting-started/how-ckb-works
15+
- /docs/ckb-fundamentals/cell-model
16+
- /docs/ckb-fundamentals/ckb-vm
17+
- /docs/ckb-fundamentals/consensus
18+
difficulty: beginner
19+
last_reviewed: 2026-06-24
420
---
521

622
## What is the Nervos Blockchain?
@@ -32,7 +48,7 @@ Further information about CKByte will be presented in the [Cell Model](cell-mode
3248

3349
## Programming on Nervos
3450

35-
Nervos offers smart contract programmability using a growing number of well-known general-purpose programming languages, such as Javascript, Rust, and C.
51+
Nervos offers smart contract programmability using a growing number of well-known general-purpose programming languages, such as JavaScript, Rust, and C.
3652

3753
All programs on Nervos can store data and state on-chain,which makes creating complex applications and customized tokens a simple and straightforward process.
3854

website/docs/dapp/create-dob.mdx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
---
22
id: create-dob
33
title: Create a DOB
4+
description: "Build a dApp that uses the Spore Protocol to turn user-provided content into an immutable on-chain digital object on CKB."
5+
tags:
6+
- dapp
7+
- tutorial
8+
- spore
9+
- cell-data
10+
- ccc
11+
audience:
12+
- dApp developers
13+
related:
14+
- /docs/assets-token-standards/spore-protocol
15+
- /docs/dapp/write-message
16+
- /docs/dapp/create-token
17+
- /docs/sdk-and-devtool/ccc
18+
difficulty: intermediate
19+
last_reviewed: 2026-06-24
420
---
521

622
import Tabs from "@theme/Tabs";
@@ -170,7 +186,7 @@ const renderSpore = async () => {
170186

171187
## Congratulations!
172188

173-
By following this tutorial this far, you have mastered how digital-object works on CKB. Here's a quick recap:
189+
After following this tutorial, you have mastered how digital objects work on CKB. Here's a quick recap:
174190

175191
- How Spore protocol works on CKB
176192
- Create an on-chain digital object with a picture via Spore-SDK

website/docs/dapp/create-token.mdx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
---
22
id: create-token
33
title: Create a Fungible Token
4+
description: "Issue and query a custom fungible token on CKB using the xUDT standard, Type Scripts, Cell data, and the CCC SDK."
5+
tags:
6+
- dapp
7+
- tutorial
8+
- xudt
9+
- type-script
10+
- ccc
11+
audience:
12+
- dApp developers
13+
related:
14+
- /docs/assets-token-standards/xudt
15+
- /docs/dapp/transfer-ckb
16+
- /docs/dapp/create-dob
17+
- /docs/sdk-and-devtool/ccc
18+
difficulty: intermediate
19+
last_reviewed: 2026-06-24
420
---
521

622
import Tabs from "@theme/Tabs";
@@ -209,7 +225,7 @@ const txHash = await signer.sendTransaction(tx);
209225

210226
## Congratulations!
211227

212-
By following this tutorial this far, you have mastered how custom tokens work on CKB. Here's a quick recap:
228+
After following this tutorial, you have mastered how custom tokens work on CKB. Here's a quick recap:
213229

214230
- Create a CKB transaction containing a xUDT Cell in the outputs
215231
- The data of the xUDT Cell contains the amount number of the token

website/docs/dapp/simple-lock.mdx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
11
---
22
id: simple-lock
33
title: Build a Simple Lock
4+
description: "Build a full-stack CKB dApp with a toy hash Lock Script, script deployment, frontend integration, and token unlocking flow."
5+
tags:
6+
- dapp
7+
- tutorial
8+
- script
9+
- lock-script
10+
- ckb-js-vm
11+
audience:
12+
- dApp developers
13+
- Script developers
14+
related:
15+
- /docs/script/intro-to-script
16+
- /docs/script/js/js-vm
17+
- /docs/script/rust/rust-example-simple-lock
18+
- /docs/dapp/transfer-ckb
19+
difficulty: advanced
20+
last_reviewed: 2026-06-24
421
---
522

623
import Tabs from "@theme/Tabs";

website/docs/dapp/transfer-ckb.mdx

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
---
22
id: transfer-ckb
33
title: Transfer CKB
4+
description: "Build a simple dApp that generates accounts, checks CKB balances, creates a transfer transaction, pays fees, and broadcasts it."
5+
tags:
6+
- dapp
7+
- tutorial
8+
- ccc
9+
- transaction
10+
- cell-model
11+
audience:
12+
- dApp developers
13+
related:
14+
- /docs/getting-started/quick-start
15+
- /docs/sdk-and-devtool/ccc
16+
- /docs/dapp/write-message
17+
- /docs/ckb-fundamentals/cell-model
18+
difficulty: beginner
19+
last_reviewed: 2026-06-24
420
---
521

622
import Tabs from "@theme/Tabs";
@@ -73,7 +89,7 @@ export async function capacityOf(address: string): Promise<bigint> {
7389
```
7490

7591
:::tip
76-
In Nervos CKB, Shannon is the smallest currency unit, with 1 CKB = 10^8 Shannons. This unit system is similar to Bitcoin's Satoshis, where 1 Bitcoin = 10^8 Satoshis. In CCC SDK, the value handle are mostly done in the **Shannon unit**.
92+
In Nervos CKB, Shannon is the smallest currency unit, with 1 CKB = 10^8 Shannons. This unit system is similar to Bitcoin's Satoshis, where 1 Bitcoin = 10^8 Satoshis. In the CCC SDK, values are mostly handled in the **Shannon unit**.
7793
:::
7894

7995
Next, we can start to transfer balance. Check out the transfer function in `lib.ts`:
@@ -148,7 +164,7 @@ You can open the console on the browser to see the full transaction to confirm t
148164

149165
## Congratulations!
150166

151-
By following this tutorial this far, you have mastered how balance transfers work on CKB. Here's a quick recap:
167+
After following this tutorial, you have mastered how balance transfers work on CKB. Here's a quick recap:
152168

153169
- The capacity of a Cell indicates both the CKB balance and the amount of data that can be stored in the Cell simultaneously.
154170
- Transferring CKB balance involves transferring some Cells from the sender to the receiver.

website/docs/dapp/write-message.mdx

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
---
22
id: store-data-on-cell
33
title: Store Data on Cell
4+
description: "Build a dApp that writes a text message into CKB Cell data, then reads the Live Cell back and decodes the stored value."
5+
tags:
6+
- dapp
7+
- tutorial
8+
- cell-data
9+
- cell-model
10+
- ccc
11+
audience:
12+
- dApp developers
13+
related:
14+
- /docs/dapp/transfer-ckb
15+
- /docs/ckb-fundamentals/cell-model
16+
- /docs/tech-explanation/outputs-data
17+
- /docs/sdk-and-devtool/ccc
18+
difficulty: beginner
19+
last_reviewed: 2026-06-24
420
---
521

622
import Tabs from "@theme/Tabs";
@@ -19,7 +35,7 @@ import ExampleLink from "@components/ExampleLink";
1935

2036
In this tutorial, you will learn how to tuck a nifty message - "**Hello CKB!**" - into a <Tooltip>Cell</Tooltip> on the CKB blockchain. Imagine it as sending a message in a bottle, but the ocean is digital, and the bottle is a super secure, tamper-proof CKB Cell!
2137

22-
As you have learned from the first tutorial [Transfer CKB](/docs/dapp/transfer-ckb), the Cell can store any type of data in the data field of Cell structure. Here we will put a text message encoding in hex string format and store it in the data field. Once your words are encoded and inscribed into the blockchain, we'll then get the hex string from the same Cell back and then decode them to the original text message. the method of encoding and decoding is totally up to your favorite, we use the `TextDecoder` for simplicity through the tutorial.
38+
As you learned from the first tutorial, [Transfer CKB](/docs/dapp/transfer-ckb), a Cell can store any type of data in the data field of the Cell structure. Here, we will encode a text message as a hex string and store it in the data field. Once your words are encoded and inscribed into the blockchain, we'll get the hex string back from the same Cell and decode it to the original text message. The encoding and decoding method is up to you; we use `TextDecoder` for simplicity throughout the tutorial.
2339

2440
## Setup Devnet & Run Example
2541

@@ -40,11 +56,11 @@ You can also read the full code online or download it <ExampleLink path="dApp/st
4056

4157
## Behind the Scene
4258

43-
Open the `lib.ts` file in your project, it lists all the important functions that do the most of work for the project.
59+
Open the `lib.ts` file in your project. It lists the important functions that do most of the work for the project.
4460

4561
### Encode & Decode Message
4662

47-
Since Cell's data field can store any type of data, we need to design our encoding and decoding method for the message we want to read and write on-chain.
63+
Since a Cell's data field can store any type of data, we need to design an encoding and decoding method for the message we want to read and write on-chain.
4864

4965
```ts
5066
export function utf8ToHex(utf8String: string): string {
@@ -99,7 +115,7 @@ const tx = ccc.Transaction.from({
99115

100116
Here we build the output Cell to store the message data by putting the hex format of the text message into the data field of the output Cell.
101117

102-
Next, we ask CCC to complete the transaction for us with transaction fee:
118+
Next, we ask CCC to complete the transaction for us with a transaction fee:
103119

104120
```ts
105121
// Complete missing parts for transaction
@@ -145,7 +161,7 @@ export async function readOnChainMessage(txHash: string, index = "0x0") {
145161

146162
## Congratulations!
147163

148-
By following this tutorial this far, you have mastered how storing data on Cells works on CKB. Here's a quick recap:
164+
After following this tutorial, you have mastered how storing data on Cells works on CKB. Here's a quick recap:
149165

150166
- We can store arbitrary data in the `data` field of Cell.
151167
- We need a way to encode and decode our data for understanding and using our raw on-chain data later.

website/docs/getting-started/how-ckb-works.mdx

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
11
---
22
id: how-ckb-works
33
title: How CKB Works
4+
description: "Learn how CKB uses Cells, Scripts, transactions, CKB-VM, and proof-of-work consensus to secure and update on-chain state."
5+
tags:
6+
- concept
7+
- cell-model
8+
- script
9+
- transaction
10+
- ckb-vm
11+
audience:
12+
- dApp developers
13+
- Script developers
14+
related:
15+
- /docs/getting-started/quick-start
16+
- /docs/ckb-fundamentals/cell-model
17+
- /docs/script/intro-to-script
18+
- /docs/tech-explanation/transaction
19+
difficulty: beginner
20+
last_reviewed: 2026-06-24
421
---
522

623
# How CKB Works
@@ -78,7 +95,7 @@ Cells that have not been consumed are known as Live Cells, and these are availab
7895
src="/img/how-ckb-works/confirm.png"
7996
width="688px"
8097
height="276px"
81-
alt="Miners select the transaciton from the mempool and include it in a new block. The block is added to the blockchain after validation."
98+
alt="Miners select the transaction from the mempool and include it in a new block. The block is added to the blockchain after validation."
8299
/>{" "}
83100

84101
As a result:
@@ -101,7 +118,7 @@ A Script in CKB is a binary executable that can be executed on-chain. It is a
101118
/>{" "}
102119

103120
- `code_hash` : identifies the Script code to be loaded into the CKB-VM
104-
- `hash_type` : indicates the the method CKB-VM uses to locate the Script code or Script.
121+
- `hash_type` : indicates the method CKB-VM uses to locate the Script code or Script.
105122
- `args` : provides specific arguments that differentiate one Script from another, such as a users’s public key hash.
106123

107124
There’re two main types of Scripts:

0 commit comments

Comments
 (0)