Skip to content

Add new API page - #47

Draft
zaerl wants to merge 2 commits into
mainfrom
add/site-api-page
Draft

Add new API page#47
zaerl wants to merge 2 commits into
mainfrom
add/site-api-page

Conversation

@zaerl

@zaerl zaerl commented Jul 27, 2026

Copy link
Copy Markdown
Owner

No description provided.

zaerl added 2 commits July 27, 2026 17:40
Signed-off-by: Francesco Bigiarini <francesco.bigiarini@gmail.com>
Signed-off-by: Francesco Bigiarini <francesco.bigiarini@gmail.com>
@zaerl zaerl self-assigned this Jul 27, 2026
@zaerl zaerl changed the title Add/site api page Add new API page Jul 27, 2026
Comment thread src/site/footer.html
function callAPI(func, args = []) {
let name = func.replace(/^mjb_/, '');
name = name.replace(/_([a-z])/g, (_, letter) => letter.toUpperCase());
console.log(`Calling API function: ${name} with arguments:`, args);
Comment thread src/site/footer.html
value = readCodepoint(value);

if(value === -1) {
funcResults.innerHTML = `Invalid codepoint: ${form.elements[`${func}-${arg.name}`].value}`;
Comment thread src/site/footer.html
data = encodingToString(data, true);
}

funcResults.innerHTML = data;
Comment thread src/site/footer.html
try {
data = callAPI(functions[func].wasmName, args);
} catch (error) {
funcResults.innerHTML = error.message;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants