1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { getWebLoaderBuilder } from "https://esm.town/v/bluemsn/getWebLoaderBuilder";
export const loaderSampleWeb = (async () => {
let builder, loader, docs;
// Load markdown files from GitHub
builder = await getWebLoaderBuilder(
"https://github.com/webup/agi-talks/tree/master/pages/common/",
"github",
{ branch: "master", recursive: false, unknown: "warn" },
);
loader = await builder();
docs = await loader.load();
console.log('load github pages content:\n', docs[0].pageContent);
// Load the same file as raw webpage
builder = await getWebLoaderBuilder(
"https://raw.githubusercontent.com/webup/agi-talks/master/pages/common/end.md",
);
loader = await builder();
docs = await loader.load();
console.log('load html content:\n', docs[0].pageContent);
})();
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
December 2, 2023