From 4d0b87a5cdb1fbdec7e0376c1b3a37e1b7ec4d7c Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Tue, 9 Mar 2021 08:22:54 -0300 Subject: [PATCH] Add Portals (#17306) * Add Portals * Add Portals --- changelog.md | 2 ++ lib/pure/htmlgen.nim | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/changelog.md b/changelog.md index 906676fb09..67c37589f0 100644 --- a/changelog.md +++ b/changelog.md @@ -207,6 +207,8 @@ provided by the operating system. - Added `jscore.debugger` to [call any available debugging functionality, such as breakpoints.](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/debugger) +- Added `htmlgen.portal` for [making "SPA style" pages using HTML only.](https://web.dev/hands-on-portals) + ## Language changes diff --git a/lib/pure/htmlgen.nim b/lib/pure/htmlgen.nim index fbecf337da..04b1c5202d 100644 --- a/lib/pure/htmlgen.nim +++ b/lib/pure/htmlgen.nim @@ -613,6 +613,10 @@ macro wbr*(e: varargs[untyped]): untyped = ## Generates the HTML `wbr` element. result = xmlCheckedTag(e, "wbr", commonAttr, "", true) +macro portal*(e: varargs[untyped]): untyped = + ## Generates the HTML `portal` element. + result = xmlCheckedTag(e, "portal", "width height type src disabled" & commonAttr, "", false) + macro math*(e: varargs[untyped]): untyped = ## Generates the HTML `math` element. MathML https://wikipedia.org/wiki/MathML