Skip to content

Commit

Permalink
Replaced default code "A.method" with "ZenUML".
Browse files Browse the repository at this point in the history
  • Loading branch information
MrCoder committed Nov 11, 2023
1 parent cb2971a commit 42615d8
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,20 @@ const logger = parentLogger.child({ name: "main" });

// find the fist element with tag `pre` and class `zenuml`
const elm = document.querySelector("pre.zenuml");
// get the code from the element
const code =
elm?.textContent?.trim() ||
`
// comment
A
A.method`;
const code = "ZenUML";
// @ts-ignore
const zenUml = new ZenUml(elm);
console.log("set zenUML to window");

// @ts-ignore
window.zenUml = zenUml;
zenUml.render(code, { theme: "theme-default" }).then((r) => {
logger.debug("render resolved", r);
});
zenUml
.render(code, {
enableMultiTheme: false,
stickyOffset: 0,
theme: "theme-default",
})
.then((r) => {
logger.debug("render resolved", r);
});
// @ts-ignore
window.parentLogger = parentLogger;

0 comments on commit 42615d8

Please sign in to comment.