Skip to content
This repository was archived by the owner on Jan 16, 2026. It is now read-only.

Commit 3b30ca6

Browse files
committed
update
1 parent 9c70234 commit 3b30ca6

53 files changed

Lines changed: 3402 additions & 14206 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,13 @@ jobs:
6161
push: true
6262
pull: true
6363
- name: Build
64-
run: |
65-
docker compose up ci
66-
- name: Create package tarball
64+
run: docker compose up ci
65+
- name: Test
6766
run: |
6867
corepack yarn install --immutable
69-
corepack yarn pack -o libxmlwasm.tgz
68+
corepack yarn test
69+
- name: Create package tarball
70+
run: corepack yarn pack -o libxmlwasm.tgz
7071
- name: Upload package tarball
7172
uses: actions/upload-artifact@v4
7273
with:

.github/workflows/docs.yml

Lines changed: 0 additions & 66 deletions
This file was deleted.

.vscode/c_cpp_properties.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"name": "Win32",
55
"includePath": [
66
"${workspaceFolder}/prefix/**",
7+
"${workspaceFolder}/cache/build/**",
78
"D:/emsdk/upstream/emscripten/system/include/**"
89
],
910
"defines": [
@@ -23,4 +24,4 @@
2324
}
2425
],
2526
"version": 4
26-
}
27+
}

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@
5252
"xutility": "cpp",
5353
"atomic": "cpp",
5454
"cwctype": "cpp",
55-
"__tuple": "cpp"
55+
"__tuple": "cpp",
56+
"string_view": "cpp"
5657
},
5758
"search.exclude": {
5859
"**/.yarn": true,

README.md

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,31 @@ docker compose up ci
99
docker compose up wasm
1010
```
1111

12-
## Docs
12+
## Usage
1313

14-
```bash
15-
corepack yarn workspace @libxml/docs start
14+
```ts
15+
import init from "@libxml/wasm"
16+
const libxml = await init()
17+
18+
const html = `
19+
<!DOCTYPE html>
20+
<html lang="en">
21+
<head>
22+
<title>Document</title>
23+
</head>
24+
<body>
25+
<div class="container">
26+
<h1 class="title">Hello world</h1>
27+
<p>Good</p>
28+
</div>
29+
</body>
30+
</html>
31+
`.trim()
32+
33+
const doc = libxml.parseHTML(html) // Create a document
34+
const nodes = doc.getNode("//div/h1") // Get a node by xpath
35+
const h1 = nodes[0] // Get the first node
36+
console.log(h1.name) // "h1"
37+
console.log(h1.content) // "Hello world"
38+
console.log(h1.attr.class) // "title"
1639
```

docs/.gitignore

Lines changed: 0 additions & 20 deletions
This file was deleted.

docs/README.md

Lines changed: 0 additions & 41 deletions
This file was deleted.

docs/babel.config.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/blog/2019-05-28-first-blog-post.md

Lines changed: 0 additions & 12 deletions
This file was deleted.

docs/blog/2019-05-29-long-blog-post.md

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)