summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJuan Carlos <juancarlospaco@gmail.com>2021-03-09 08:22:54 -0300
committerGitHub <noreply@github.com>2021-03-09 12:22:54 +0100
commit4d0b87a5cdb1fbdec7e0376c1b3a37e1b7ec4d7c (patch)
tree9a19d63a528c5559af28b86d12bff3658f8f7e49
parentcc37fee0ab744e035510498024e4fee016560ab8 (diff)
downloadNim-4d0b87a5cdb1fbdec7e0376c1b3a37e1b7ec4d7c.tar.gz
Add Portals (#17306)
* Add Portals

* Add Portals
-rw-r--r--changelog.md2
-rw-r--r--lib/pure/htmlgen.nim4
2 files changed, 6 insertions, 0 deletions
diff --git a/changelog.md b/changelog.md
index 906676fb0..67c37589f 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 fbecf337d..04b1c5202 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