diff --git a/projects/cetz-editor/definitions.typ b/projects/cetz-editor/definitions.typ new file mode 100644 index 00000000..21b545ec --- /dev/null +++ b/projects/cetz-editor/definitions.typ @@ -0,0 +1,21 @@ + +#let x-circle(rad: 200, inner-text: "") = { + circle((0, 0), radius: rad, name: node-label) + debug-label((-rad*0.7, -rad*0.7)) + content(node-label, inner-text) +} +#let x-rect(x: 200, y: none, inner-text: "") = { + let y = if y == none { + x + } else { + y + } + rect((0, 0), (x, y), name: node-label) + debug-label((0, 0)) + content(node-label, inner-text) +} +#let x-arrow(start: (0, 10), end: (50, 10), inner-text: "", mark: (end: ">")) = { + set-style(mark: (fill: none, size: 14)) + line(start, end, name: "t", mark: mark) + content("t", inner-text) +} \ No newline at end of file diff --git a/projects/cetz-editor/definitions.yaml b/projects/cetz-editor/definitions.yaml deleted file mode 100644 index 445a1ce1..00000000 --- a/projects/cetz-editor/definitions.yaml +++ /dev/null @@ -1,43 +0,0 @@ -definitions: - - id: x-circle - props: # default props - rad: 200 - inner-text: '""' - draw: | - { - circle((0, 0), radius: rad, name: node-label) - debug-label((-rad*0.7, -rad*0.7)) - content(node-label, inner-text) - } - - id: x-rect - props: # default props - x: 200 - y: none - inner-text: '""' - draw: | - { - let y = if y == none { - x - } else { - y - } - rect((0, 0), (x, y), name: node-label) - debug-label((0, 0)) - content(node-label, inner-text) - - } - - id: x-arrow - props: # default props - start: (0, 10) - end: (50, 10) - inner-text: '""' - mark: | - (end: ">") - draw: | - { - set-style(mark: (fill: none, size: 7)) - line(start, end, name: "t", mark: mark) - content("t", inner-text) - } -width: 600pt -height: 600pt diff --git a/projects/cetz-editor/index.html b/projects/cetz-editor/index.html index 0cf35abb..e0352b1a 100644 --- a/projects/cetz-editor/index.html +++ b/projects/cetz-editor/index.html @@ -2,299 +2,319 @@
- - - -