Sven Slootweg 2 years ago
commit
4f02c6bb1a
  1. 2
      .gitignore
  2. 76
      assets/external-link-icon.svg
  3. 85
      assets/highlight.css
  4. 174
      assets/style.css
  5. 73
      assets/validatem-icon.svg
  6. 112
      assets/validatem-logo.svg
  7. 46
      components/code.jsx
  8. 51
      components/module.jsx
  9. 25
      index.js
  10. 67
      layouts/default.jsx
  11. 26
      package.json
  12. 7
      pages/getting-started.mdx
  13. 57
      pages/index.mdx
  14. 178
      pages/modules.mdx
  15. 6121
      yarn.lock

2
.gitignore

@ -0,0 +1,2 @@
node_modules
build

76
assets/external-link-icon.svg

@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="4.2333336mm"
height="4.2333331mm"
viewBox="0 0 4.2333336 4.2333331"
version="1.1"
id="svg4542"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
sodipodi:docname="external-link-icon.svg">
<defs
id="defs4536" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.979899"
inkscape:cx="151.26617"
inkscape:cy="-15.589456"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:window-width="1870"
inkscape:window-height="1015"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1" />
<metadata
id="metadata4539">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-60.854166,-140.44207)">
<g
id="g5130"
transform="matrix(0.10748655,0,0,0.10967831,54.313162,128.80765)">
<path
inkscape:connector-curvature="0"
id="rect5087"
transform="scale(0.26458333)"
d="m 230,433.94727 v 112.85742 h 112.85742 v -70.30664 l -14.14258,14.14257 v 42.02149 h -84.57226 v -84.57227 h 47.9707 l 14.14258,-14.14257 z"
style="opacity:1;vector-effect:none;fill:#666666;fill-opacity:1;stroke:none;stroke-width:18.14173317;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:markers stroke fill" />
<path
inkscape:connector-curvature="0"
id="rect5089"
d="m 100.23894,106.07768 -17.551263,2.49133 4.40059,4.4006 -13.853999,13.854 6.25874,6.25873 13.853999,-13.854 4.400598,4.4006 z"
style="opacity:1;vector-effect:none;fill:#666666;fill-opacity:1;stroke:none;stroke-width:3.48349977;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:markers stroke fill" />
</g>
</g>
</svg>

85
assets/highlight.css

@ -0,0 +1,85 @@
/**
* GitHub Gist Theme
* Author : Anthony Attard - https://github.com/AnthonyAttard
* Author : Louis Barranqueiro - https://github.com/LouisBarranqueiro
*/
.hljs {
display: block;
/* background: white; */
padding: 0.5em;
color: #333333;
overflow-x: auto;
/* Custom: */
background: rgb(235, 235, 235);
border: 1px solid silver;
border-radius: 3px;
}
.hljs-comment,
.hljs-meta {
color: #969896;
}
.hljs-variable,
.hljs-template-variable,
.hljs-strong,
.hljs-emphasis,
.hljs-quote {
color: #df5000;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-type {
color: #d73a49;
}
.hljs-literal,
.hljs-symbol,
.hljs-bullet,
.hljs-attribute {
color: #0086b3;
}
.hljs-section,
.hljs-name {
color: #63a35c;
}
.hljs-tag {
color: #333333;
}
.hljs-title,
.hljs-attr,
.hljs-selector-id,
.hljs-selector-class,
.hljs-selector-attr,
.hljs-selector-pseudo {
color: #6f42c1;
}
.hljs-addition {
color: #55a532;
background-color: #eaffea;
}
.hljs-deletion {
color: #bd2c00;
background-color: #ffecec;
}
.hljs-link {
text-decoration: underline;
}
.hljs-number {
color: #005cc5;
}
.hljs-string {
color: #032f62;
}

174
assets/style.css

@ -0,0 +1,174 @@
@import "./highlight.css";
html, body {
margin: 0;
padding: 0;
background-color: rgb(233, 233, 233);
font-family: sans-serif;
}
a {
color: rgb(0, 112, 0);
&:visited {
color: rgb(0, 55, 0);
}
}
.header {
padding: 0 .5em;
background-color: rgb(233, 233, 233);
position: fixed;
top: 0;
left: 0;
right: 0;
& > .inner {
box-sizing: border-box;
border-bottom: 3px solid green;
height: 85px;
padding-left: 3em;
display: grid;
grid-template-columns: auto 1fr;
grid-gap: 3em;
.menu {
display: flex;
align-items: flex-end;
/* gap: 1.3em; */
.item {
display: block;
margin-bottom: .6em;
margin-right: 1.3em; /* Workaround for lacking `gap` support in browsers */
font-size: 1.3em;
color: rgb(80, 80, 80);
height: 1.3em;
text-decoration: none;
padding-bottom: .1em;
border-bottom: 2px solid silver;
/* padding: .3em .9em; */
/* border: 1px solid gray; */
/* border-radius: 3px; */
&:hover {
border-bottom-color: rgb(82, 82, 82);
}
&.active {
color: black;
border-bottom-color: rgb(0, 153, 0);
}
img.externalLink {
margin-left: .3em;
vertical-align: top;
height: 16px;
}
}
}
}
}
.content {
padding-top: 85px;
max-width: 960px;
& > .inner {
padding: 1em;
padding-left: 3em;
h1 {
margin-top: 0;
}
h2 {
border-bottom: 1px solid black;
margin-bottom: .5em;
}
}
/* ul {
font-size: .95em;
} */
li {
margin-bottom: .2em;
}
.moduleList {
display: flex;
flex-wrap: wrap;
.entry {
display: block;
width: 180px;
margin-right: .6em; /* TODO: Replace with `gap` when browsers support it */
margin-bottom: .6em; /* TODO: Replace with `gap` when browsers support it */
background: rgb(240, 240, 240);
box-shadow: 2px 2px 4px silver;
border: 1px solid transparent;
color: rgb(54, 54, 54);
text-decoration: none;
padding: .6em 1em;
&:hover {
border-color: silver;
box-shadow: 3px 3px 5px gray;
}
.name {
display: block;
color: black;
font-weight: bold;
border-bottom: 1px solid rgb(151, 151, 151);
margin-bottom: .3em;
}
.meta {
display: block;
font-size: .9em;
.label {
font-weight: bold;
margin-right: .3em;
}
.value {
display: inline-block;
}
}
.firstParty, .thirdParty {
font-size: .9em;
font-weight: bold;
}
.firstParty {
color: rgb(14, 1, 172);
}
.thirdParty {
color: rgb(22, 128, 0);
}
}
}
}
.footer {
padding: 0 .5em;
& > .inner {
border-top: 1px solid gray;
padding: .8em .5em;
padding-left: 2.5em;
}
}
.logo {
height: 80px;
}

73
assets/validatem-icon.svg

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="120"
height="120"
viewBox="0 0 31.750001 31.750001"
version="1.1"
id="svg8"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
sodipodi:docname="validatem-icon.svg">
<defs
id="defs2" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.979899"
inkscape:cx="164.91615"
inkscape:cy="47.583886"
inkscape:document-units="mm"
inkscape:current-layer="text817"
showgrid="false"
inkscape:window-width="1870"
inkscape:window-height="1015"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
fit-margin-top="3"
fit-margin-bottom="3"
fit-margin-right="3"
fit-margin-left="3"
units="px" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-32.405043,-64.590621)">
<g
aria-label="validatem"
style="font-style:normal;font-weight:normal;font-size:10.58333302px;line-height:6.61458302px;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="text817">
<path
d="M 47.155564,93.308937 H 43.451397 L 39.184991,81.380638 h 3.274219 l 2.083593,6.669705 c 0.110243,0.367477 0.371152,1.286169 0.782726,2.756077 0.0735,-0.301331 0.224161,-0.830498 0.451996,-1.5875 0.227836,-0.757003 6.893866,-17.128097 8.356424,-21.596615 h 3.241146 z"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:22.57777786px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans Bold';letter-spacing:-1.22766662px;word-spacing:0px;fill:#008000;stroke-width:0.26458332px"
id="path838"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccsccc" />
</g>
</g>
</svg>

112
assets/validatem-logo.svg

@ -0,0 +1,112 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="98.903084mm"
height="31.907118mm"
viewBox="0 0 98.903084 31.907118"
version="1.1"
id="svg8"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
sodipodi:docname="validatem-logo.svg">
<defs
id="defs2" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.979899"
inkscape:cx="164.91615"
inkscape:cy="48.417218"
inkscape:document-units="mm"
inkscape:current-layer="text817"
showgrid="false"
inkscape:window-width="1870"
inkscape:window-height="1015"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
fit-margin-top="3"
fit-margin-bottom="3"
fit-margin-right="3"
fit-margin-left="3" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-32.405043,-64.65399)">
<g
aria-label="validatem"
style="font-style:normal;font-weight:normal;font-size:10.58333302px;line-height:6.61458302px;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="text817">
<path
d="M 43.375616,93.340622 H 39.671449 L 35.405043,81.412323 h 3.274219 l 2.083593,6.669705 c 0.110243,0.367477 0.371152,1.286169 0.782726,2.756077 0.0735,-0.301331 0.224161,-0.830498 0.451996,-1.5875 0.227836,-0.757003 6.893866,-17.128097 8.356424,-21.596615 h 3.241146 z"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:22.57777786px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans Bold';letter-spacing:-1.22766662px;word-spacing:0px;fill:#008000;stroke-width:0.26458332px"
id="path838"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccsccc" />
<path
d="m 50.989442,93.561108 q -1.730816,0 -2.700955,-0.937066 -0.970139,-0.94809 -0.970139,-2.656858 0,-1.852083 1.20165,-2.822222 1.212673,-0.970139 3.505729,-0.992187 l 2.568663,-0.0441 v -0.606336 q 0,-1.168577 -0.407899,-1.730816 -0.4079,-0.573264 -1.333941,-0.573264 -0.859896,0 -1.267795,0.396875 -0.396875,0.38585 -0.496094,1.289844 l -3.230122,-0.154341 q 0.297656,-1.74184 1.5875,-2.634809 1.300868,-0.903993 3.538802,-0.903993 2.259983,0 3.483681,1.113455 1.223698,1.113455 1.223698,3.163976 v 4.343576 q 0,1.003212 0.220486,1.389063 0.23151,0.374826 0.760677,0.374826 0.352778,0 0.683507,-0.06615 v 1.675695 q -0.275608,0.06615 -0.496094,0.121267 -0.220486,0.05512 -0.440972,0.08819 -0.220486,0.03307 -0.474045,0.05512 -0.242535,0.02205 -0.573264,0.02205 -1.168576,0 -1.730816,-0.573264 -0.551215,-0.573264 -0.661458,-1.686719 h -0.06615 q -1.300868,2.348177 -3.924653,2.348177 z m 3.604948,-5.743663 -1.5875,0.02205 q -1.080382,0.0441 -1.532379,0.242535 -0.451996,0.187413 -0.694531,0.584288 -0.23151,0.396875 -0.23151,1.058334 0,0.848871 0.38585,1.267795 0.396875,0.407899 1.04731,0.407899 0.727604,0 1.322916,-0.396875 0.606337,-0.396875 0.94809,-1.091406 0.341754,-0.705556 0.341754,-1.488281 z"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:22.57777786px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans Bold';letter-spacing:-1.22766662px;word-spacing:0px;stroke-width:0.26458332px"
id="path840"
inkscape:connector-curvature="0" />
<path
d="m 59.573407,93.340622 v -16.36007 h 3.09783 v 16.36007 z"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:22.57777786px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans Bold';letter-spacing:-1.22766662px;word-spacing:0px;stroke-width:0.26458332px"
id="path842"
inkscape:connector-curvature="0" />
<path
d="m 64.607546,79.262584 v -2.282032 h 3.09783 v 2.282032 z m 0,14.078038 V 81.412323 h 3.09783 v 11.928299 z"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:22.57777786px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans Bold';letter-spacing:-1.22766662px;word-spacing:0px;stroke-width:0.26458332px"
id="path844"
inkscape:connector-curvature="0" />
<path
d="m 77.369722,93.340622 q -0.0441,-0.165365 -0.110243,-0.826823 -0.05512,-0.672483 -0.05512,-1.113455 h -0.0441 q -1.003212,2.160764 -3.81441,2.160764 -2.083594,0 -3.219097,-1.620573 -1.135504,-1.631597 -1.135504,-4.553038 0,-2.965538 1.190625,-4.575087 1.201649,-1.620573 3.395486,-1.620573 1.267795,0 2.182813,0.529167 0.926041,0.529167 1.422135,1.576476 h 0.02205 l -0.02205,-1.962327 v -4.354601 h 3.09783 v 13.758334 q 0,1.10243 0.08819,2.601736 z m -0.143316,-6.030295 q 0,-1.929254 -0.650434,-2.965538 -0.639409,-1.047309 -1.89618,-1.047309 -1.245747,0 -1.852084,1.014236 -0.606336,1.003211 -0.606336,3.075781 0,4.056944 2.436371,4.056944 1.223698,0 1.896181,-1.069357 0.672482,-1.080382 0.672482,-3.064757 z"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:22.57777786px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans Bold';letter-spacing:-1.22766662px;word-spacing:0px;stroke-width:0.26458332px"
id="path846"
inkscape:connector-curvature="0" />
<path
d="m 84.972525,93.561108 q -1.730816,0 -2.700955,-0.937066 -0.970139,-0.94809 -0.970139,-2.656858 0,-1.852083 1.201649,-2.822222 1.212674,-0.970139 3.50573,-0.992187 l 2.568663,-0.0441 v -0.606336 q 0,-1.168577 -0.4079,-1.730816 -0.407899,-0.573264 -1.333941,-0.573264 -0.859895,0 -1.267795,0.396875 -0.396875,0.38585 -0.496093,1.289844 l -3.230122,-0.154341 q 0.297656,-1.74184 1.5875,-2.634809 1.300868,-0.903993 3.538802,-0.903993 2.259983,0 3.483681,1.113455 1.223698,1.113455 1.223698,3.163976 v 4.343576 q 0,1.003212 0.220486,1.389063 0.23151,0.374826 0.760677,0.374826 0.352778,0 0.683507,-0.06615 v 1.675695 q -0.275608,0.06615 -0.496094,0.121267 -0.220486,0.05512 -0.440972,0.08819 -0.220486,0.03307 -0.474045,0.05512 -0.242535,0.02205 -0.573264,0.02205 -1.168577,0 -1.730816,-0.573264 -0.551216,-0.573264 -0.661459,-1.686719 h -0.06615 q -1.300868,2.348177 -3.924653,2.348177 z m 3.604948,-5.743663 -1.5875,0.02205 q -1.080382,0.0441 -1.532379,0.242535 -0.451996,0.187413 -0.694531,0.584288 -0.23151,0.396875 -0.23151,1.058334 0,0.848871 0.38585,1.267795 0.396875,0.407899 1.047309,0.407899 0.727604,0 1.322917,-0.396875 0.606337,-0.396875 0.94809,-1.091406 0.341754,-0.705556 0.341754,-1.488281 z"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:22.57777786px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans Bold';letter-spacing:-1.22766662px;word-spacing:0px;stroke-width:0.26458332px"
id="path848"
inkscape:connector-curvature="0" />
<path
d="m 96.610223,93.539059 q -1.367014,0 -2.105642,-0.738628 -0.738629,-0.749653 -0.738629,-2.259983 v -7.033507 h -1.51033 v -2.094618 h 1.664671 l 0.970138,-2.800173 h 1.940278 v 2.800173 h 2.259983 v 2.094618 h -2.259983 v 6.19566 q 0,0.87092 0.330729,1.289844 0.33073,0.407899 1.025261,0.407899 0.363802,0 1.036285,-0.15434 v 1.918229 q -1.146528,0.374826 -2.612761,0.374826 z"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:22.57777786px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans Bold';letter-spacing:-1.22766662px;word-spacing:0px;stroke-width:0.26458332px"
id="path850"
inkscape:connector-curvature="0" />
<path
d="m 104.75322,93.561108 q -2.68993,0 -4.13412,-1.5875 -1.444183,-1.598524 -1.444183,-4.652257 0,-2.954514 1.466233,-4.542014 1.46623,-1.5875 4.15616,-1.5875 2.56867,0 3.92466,1.708768 1.35599,1.697743 1.35599,4.982986 v 0.08819 h -7.65087 q 0,1.74184 0.63941,2.634809 0.65043,0.881945 1.84106,0.881945 1.64262,0 2.07257,-1.422136 l 2.92144,0.253559 q -1.2678,3.241146 -5.14835,3.241146 z m 0,-10.417969 q -1.09141,0 -1.68672,0.760677 -0.58429,0.760677 -0.61736,2.127691 h 4.6302 q -0.0882,-1.444184 -0.69453,-2.160764 -0.60633,-0.727604 -1.63159,-0.727604 z"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:22.57777786px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans Bold';letter-spacing:-1.22766662px;word-spacing:0px;stroke-width:0.26458332px"
id="path852"
inkscape:connector-curvature="0" />
<path
d="m 118.23197,93.340622 v -6.691754 q 0,-3.141927 -1.80798,-3.141927 -0.93707,0 -1.53238,0.959115 -0.58429,0.959115 -0.58429,2.480469 v 6.394097 h -3.09783 v -9.260417 q 0,-0.959114 -0.0331,-1.565451 -0.022,-0.617361 -0.0551,-1.102431 h 2.95451 q 0.0331,0.209462 0.0882,1.124479 0.0551,0.903994 0.0551,1.245747 h 0.0441 q 0.57327,-1.367014 1.42214,-1.984375 0.85989,-0.617361 2.05052,-0.617361 2.73403,0 3.31832,2.601736 h 0.0661 q 0.60634,-1.389063 1.45521,-1.995399 0.84887,-0.606337 2.16076,-0.606337 1.74184,0 2.65686,1.190625 0.91502,1.179601 0.91502,3.395486 v 7.573698 h -3.07578 v -6.691754 q 0,-3.141927 -1.80799,-3.141927 -0.90399,0 -1.48828,0.881945 -0.57326,0.87092 -0.62839,2.414323 v 6.537413 z"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:22.57777786px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans Bold';letter-spacing:-1.22766662px;word-spacing:0px;stroke-width:0.26458332px"
id="path854"
inkscape:connector-curvature="0" />
</g>
</g>
</svg>

46
components/code.jsx

@ -0,0 +1,46 @@
"use strict";
// NOTE: Originates from https://git.pixie.town/f0x/shayu-doc/src/branch/master/components/code.jsx
const defaultValue = require('default-value');
const React = require('react');
const {default: SyntaxHighlighter} = require('react-syntax-highlighter');
function findLanguageClass(className='') {
let lang;
let classes = className.split(' ');
classes.some((classStr) => {
let match = classStr.match(/^language-(.+)/);
if (match) {
lang = match[1];
}
return match;
});
return lang
}
let langPresets = {
default: {
showLineNumbers: true,
},
shell: {
showLineNumbers: false
}
}
function code({className, children}) {
let lang = findLanguageClass(className);
let preset = defaultValue(langPresets[lang], langPresets.default);
preset = {...langPresets.default, ...preset};
return <SyntaxHighlighter
language={defaultValue(lang, "text")}
className={className}
useInlineStyles={false}
showLineNumbers={preset.showLineNumbers}
>
{children}
</SyntaxHighlighter>
}
module.exports = code;

51
components/module.jsx

@ -0,0 +1,51 @@
"use strict";
const React = require("react");
const { validateArguments } = require("@validatem/core");
const required = require("@validatem/required");
const isString = require("@validatem/is-string");
const isBoolean = require("@validatem/is-boolean");
const defaultTo = require("@validatem/default-to");
const oneOf = require("@validatem/one-of");
module.exports = function Module(props_) {
// TODO: Move this wrapper into a module, `validate-react-props`
let [ props ] = validateArguments(arguments, [
[ "props", {
name: [ required, isString ],
url: [ isString, defaultTo(`https://www.npmjs.com/package/@validatem/${props_.name}`) ],
type: [ required, oneOf([ "validator", "combinator", "plumbing" ]) ],
validates: [ isString ],
thirdParty: [ isBoolean, defaultTo(false) ]
}],
[ "_" ],
[ "_" ]
]);
// let url = defaultValue(props.url, `https://www.npmjs.com/package/@validatem/${props.name}`);
return (
<a className="entry" href={props.url}>
<span className="name">{props.name}</span>
<span className="meta">
<span className="label">Type:</span>
<span className="value">{props.type}</span>
</span>
{(props.validates != null)
? <span className="meta">
<span className="label">Validates:</span>
<span className="value">{props.validates}</span>
</span>
: null
}
{(props.thirdParty === true)
? <span className="thirdParty">Third-party</span>
: <span className="firstParty">Maintained by core!</span>
}
</a>
);
};

25
index.js

@ -0,0 +1,25 @@
"use strict";
const shayu = require("shayu");
shayu({
basePath: __dirname,
// defaultMeta: {
// layout: 'default',
// title: 'Untitled Page'
// },
assets: {
postcssModules: [
require('postcss-import')(),
require('postcss-mixins')(),
require("postcss-nested")(),
require('postcss-simple-vars')(),
require('postcss-color-function')(),
require('autoprefixer')()
]
},
livereload: "env",
HTMLcomponents: {
code: "./components/code"
}
});

67
layouts/default.jsx

@ -0,0 +1,67 @@
"use strict";
const React = require("react");
const classnames = require("classnames");
let currentURLContext = React.createContext();
function ExternalLinkIcon() {
return <img class="externalLink" src="/assets/external-link-icon.svg" alt="External link" />;
}
function MenuItem({ url, children }) {
let currentURL = React.useContext(currentURLContext);
let isCurrentPage = (url === currentURL);
return (
<a href={url} className={classnames("item", { active: isCurrentPage })}>
{children}
</a>
);
}
module.exports = function DefaultLayout({ mdxContent, meta, pageContext }) {
console.log({ mdxContent, meta, pageContext });
console.log("toc", pageContext.getTOC().children[0].children[0].children[0]);
return (
<currentURLContext.Provider value={meta.url}>
<html lang="en">
<head>
<meta charSet="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>{meta.title} - Validatem</title>
<link rel="stylesheet" href="/assets/bundle.css"/>
</head>
<body>
<div className="header">
<div className="inner">
<img class="logo" src="/assets/validatem-logo.svg" alt="Validatem logo"/>
<div className="menu">
<MenuItem url="/">Home</MenuItem>
<MenuItem url="/getting-started">Getting started</MenuItem>
<MenuItem url="/modules">Validator index</MenuItem>
<MenuItem url="https://git.cryto.net/validatem">
Source code
<ExternalLinkIcon />
</MenuItem>
</div>
</div>
</div>
<div className="content">
<div className="inner">
{ mdxContent }
</div>
</div>
<div className="footer">
<div className="inner">
Licensed under the WTFPL or CC0, at your choice. Site built with <a href="https://shayu.it/">Shayu</a>.
</div>
</div>
</body>
</html>
</currentURLContext.Provider>
);
};

26
package.json

@ -0,0 +1,26 @@
{
"name": "site",
"version": "1.0.0",
"main": "index.js",
"repository": "git@git.cryto.net:validatem/site.git",
"author": "Sven Slootweg <admin@cryto.net>",
"license": "MIT",
"dependencies": {
"@validatem/core": "^0.3.3",
"@validatem/default-to": "^0.1.0",
"@validatem/is-boolean": "^0.1.1",
"@validatem/is-string": "^0.1.1",
"@validatem/one-of": "^0.1.1",
"@validatem/required": "^0.1.1",
"autoprefixer": "^9.8.3",
"classnames": "^2.2.6",
"default-value": "^1.0.0",
"postcss-color-function": "^4.1.0",
"postcss-import": "^12.0.1",
"postcss-mixins": "^6.2.3",
"postcss-nested": "^4.2.1",
"postcss-simple-vars": "^5.0.2",
"react-syntax-highlighter": "^12.2.1",
"shayu": "^2.0.0-rc.3"
}
}

7
pages/getting-started.mdx

@ -0,0 +1,7 @@
export const meta = {
title: "Getting started"
};
# Getting started
Stuff goes here

57
pages/index.mdx

@ -0,0 +1,57 @@
export const meta = {
title: "Home"
};
# The last validation library you'll ever need.
* Does __every kind of validation__, and does it well: it doesn't matter whether you're validating function arguments, form data, JSON request bodies, configuration files, or whatever else. As long as it's structured data of some sort, Validatem can deal with it.
* Supports the notion of __virtual properties__ in validation errors, which means that even if your data *isn't* already structured data (eg. an encoded string of some sort), you can bring your own parser, and have it integrate cleanly.
* __Easy to read__; both the code that *uses* Validatem, and the validation error messages that it produces! Your validation code doubles as in-code format documentation, and users get clear feedback about what's wrong.
* Fully __composable__: it's trivial to use third-party validators, or to write your own (reusable!) validators, whether fully custom or made up of a few other validators chained together.
* Supports __value transformation__, which means that you can even encode things like "this value defaults to X" or "when this value is a number, it will be wrapped like so" in your validation code; this can save you a bunch of boilerplate, and makes your validation code *even more complete* as format documentation.
* Validatem has a __small and modular core__, and combined with its composability, this means you won't pull any more code into your project than is strictly necessary to make your validators work! This is also an important part of making Validatem suitable for use in libraries, eg. for argument validation.
* Many __off-the-shelf validators__ are already available! You can find the full list [here](https://validatem.cryto.net/modules).
* Extensively __documented__, with clear documentation on what is considered valid, and what is not. Likewise, the plumbing libraries that you can use to write your own validators and combinators, are also well-documented.
While Validatem is suitable for any sort of validation, this unique combination of features and design choices makes it *especially* useful for validating arguments in the public API of libraries, unlike other validation libraries!
For example, you might write something like the following (from the [`icssify` library](https://git.cryto.net/joepie91/icssify/src/master/index.js)):
```js
module.exports = function (browserify, options) {
validateArguments(arguments, [
[ "browserify", required ],
[ "options", allowExtraProperties({
mode: oneOf([ "local", "global" ]),
before: arrayOf([ required, isPostcssPlugin ]),
after: arrayOf([ required, isPostcssPlugin ]),
extensions: arrayOf([ required, isString ])
})]
]);
// Implementation code goes here ...
};
```
And calling it like so:
```js
icssify(undefined, {
mode: "nonExistentMode",
before: [ NaN ],
unspecifiedButAllowedOption: true
})
```
... would then produce an error like this:
```
ValidationError: One or more validation errors occurred:
- At browserify: Required value is missing
- At options -> mode: Must be one of: 'local', 'global'
- At options -> before -> 0: Must be a PostCSS plugin
```
## Work in progress!
This site (and the library) is still being actively worked on. Parts of the documentation will be missing - but by the time Validatem reaches 1.0.0, it will all be there!

178
pages/modules.mdx

@ -0,0 +1,178 @@
export const meta = {
title: "Validator index"
};
import Module from "./components/module";
# Validator index
## Basic operations
<div class="moduleList">
<Module
name="required"
type="validator"
validates="Marks a value as being required"
/>
<Module
name="anything"
type="validator"
validates="Allows any value (no-op)"
/>
<Module
name="forbidden"
type="validator"
validates="Disallows any non-null value"
/>
<Module
name="is-value"
type="validator"
validates="A given value is exactly a specific value"
/>
<Module
name="one-of"
type="validator"
validates="A given value is one of a set of valid values"
/>
</div>
## Basic types
<div class="moduleList">
<Module
name="is-string"
type="validator"
validates="Strings"
/>
<Module
name="is-number"
type="validator"
validates="Numbers"
/>
<Module
name="is-boolean"
type="validator"
validates="Booleans"
/>
<Module
name="is-buffer"
type="validator"
validates="Buffer objects"
/>
<Module
name="is-date"
type="validator"
validates="Date objects"
/>
<Module
name="is-regular-expression"
type="validator"
validates="RegExp objects"
/>
<Module
name="is-arguments"
type="validator"
validates="arguments objects"
/>
<Module
name="is-function"
type="validator"
validates="Functions"
/>
<Module
name="is-array"
type="validator"
validates="Arrays"
/>
<Module
name="is-plain-object"
type="validator"
validates="Plain objects (eg. literals)"
/>
</div>
## Numeric values
<div class="moduleList">
<Module
name="is-integer"
type="validator"
validates="A given number is an integer"
/>
<Module
name="is-numeric"
type="validator"
validates="A given string represents a valid numeric value"
/>
</div>
## String values
<div class="moduleList">
<Module
name="is-lowercase"
type="validator"
validates="A given string is all-lowercase"
/>
<Module
name="is-uppercase"
type="validator"
validates="A given string is all-uppercase"
/>
<Module
name="is-non-empty-string"
type="validator"
validates="A given string is not completely empty"
/>
</div>
## Data structures
<div class="moduleList">
<Module
name="has-shape"
type="combinator"
validates="Object structures"
/>
<Module
name="array-of"
type="combinator"
validates="Array contents"
/>
</div>
## Networking
<div class="moduleList">
<Module
name="is-email-address"
type="validator"
validates="E-mail addresses"
/>
</div>
## String formats
<div class="moduleList">
<Module
name="is-country-code-2"
type="validator"
validates="A given string is an ISO-3166-1 alpha-2 (2 character) country code"
/>
<Module
name="is-country-code-3"
type="validator"
validates="A given string is an ISO-3166-1 alpha-3 (3 character) country code"
/>
</div>
## Other libraries
<div class="moduleList">
<Module
name="is-postcss-plugin"
type="validator"
validates="PostCSS plugins"
/>
</div>

6121
yarn.lock
File diff suppressed because it is too large
View File

Loading…
Cancel
Save