diff --git a/build.sbt b/build.sbt index 521b0d1..f0a9039 100644 --- a/build.sbt +++ b/build.sbt @@ -99,7 +99,7 @@ lazy val docs = project // Add highlight.js for code examples .internalJS(Root / "highlight.min.js") .site - .internalJS(Root / "highlightWrapper.js") + .internalJS(Root / "aquascape.js") .site .internalCSS(Root / "a11y-dark.min.css"), laikaExtensions += AquascapeDirectives, diff --git a/docs/aquascape.js b/docs/aquascape.js new file mode 100644 index 0000000..0ebccd1 --- /dev/null +++ b/docs/aquascape.js @@ -0,0 +1,55 @@ +var aquascape = (function () { + + /** Draws an aquascape svg in-browser. + * + * @param exampleObject An instance of `aquascape.examples.Example`. + * @param codeId The html id of the element that should be populated. + * @param frameIds An instance of `aquascape.examples.FrameIds` + */ + function example(exampleObject, codeId, frameIds) { + highlightExampleCode(codeId); + exampleObject.draw(codeId, frameIds); + }; + + /** Draws an aquascape svg in-browser with a single user input. + * + * The user-input is provided through an element. + * + * @param exampleObject An instance of `aquascape.examples.Example`. + * @param codeId The html id of the element that should be populated. + * @param frameIds An instance of `aquascape.examples.FrameIds` + * @param labelId The html id of the