diff --git a/.gitignore b/.gitignore index 0bda02ce..11a10266 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ coverage node_modules +*.tgz +stats.json # `lib` is not included in git repo lib diff --git a/.npmignore b/.npmignore index c03f9f39..e56f1255 100644 --- a/.npmignore +++ b/.npmignore @@ -1,7 +1,15 @@ +coverage +__fixtures__ +__mocks__ __snapshots__ *.spec.js app docs +yarn.lock +stats.json +*.tgz +*.log +/webpack.config.js # `lib` is included in npm dist !lib diff --git a/README.md b/README.md index ba58ae0f..5fb7b014 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ This is a _Markdown Component_ file. Here you can include JSX-style assignment e Props passed to this component are available as `props`, so you can embed those too! Hello there, {{ props.who || 'world' }}! -Another cool thing you can do is use JSX **directly** - here’s an SVG element, used inline: {{ }}. +Another cool thing you can do is use JSX **directly** - here’s an SVG element, used inline: . ``` @@ -69,7 +69,6 @@ _**Note**: destructuring imports must be quoted, but others need not be._ The above `mdx` file will produce the following module within Webpack; ```javascript -// Module generated from Markdown by markdown-component-loader v0.8.0 import React from 'react'; import PropTypes from 'prop-types'; import { name, version } from './package.json'; @@ -88,7 +87,7 @@ function MarkdownComponent(props) {
This is a Markdown Component file. Here you can include JSX-style assignment expressions; this component was generated using version { version } of { name }!
Props passed to this component are available as props, so you can embed those too! Hello there, { props.who || 'world' }!
Another cool thing you can do is use JSX directly - here’s an SVG element, used inline: { }.
+Another cool thing you can do is use JSX directly - here’s an SVG element, used inline: .
This is a Markdown Component file. Here you can include JSX-style assignment expressions; this component was generated using version { version } of { name }!
Props passed to this component are available as props, so you can embed those too! Hello there, { props.who || 'world' }!
Another cool thing you can do is use JSX directly - here’s an SVG element, used inline: { }.
+Another cool thing you can do is use JSX directly - here’s an SVG element, used inline: .
{{{'{\{ }\}'}}}
+Hello, your user agent is {{{'{{ window.navigator.userAgent }}'}}}.
```
## Give it a go!
diff --git a/app/repl.js b/app/repl.js
index 2c198dbe..76811591 100644
--- a/app/repl.js
+++ b/app/repl.js
@@ -1,5 +1,5 @@
/* global ace, document */
-import markdownComponentLoader from '../src';
+import convert from '../src/convert';
require('./repl.css');
@@ -60,16 +60,11 @@ class REPL {
this.clearOutput();
try {
- transformed = markdownComponentLoader.call(
+ transformed = convert(
+ code,
{
- cacheable() {},
- options: {
- markdownComponentLoader: {
- passElementProps: false
- }
- }
- },
- code
+ passElementProps: false
+ }
);
} catch (err) {
this.printError(`Errors:\n${err.message}`);
diff --git a/docs/0.8.0/1e7ea3e8ac242d69c669bb535d4bdcf1.svg b/docs/0.8.0/1e7ea3e8ac242d69c669bb535d4bdcf1.svg
new file mode 100644
index 00000000..043b65f2
--- /dev/null
+++ b/docs/0.8.0/1e7ea3e8ac242d69c669bb535d4bdcf1.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/docs/0.8.0/a5a1086ede729f7cef67ad849ec9c985.svg b/docs/0.8.0/a5a1086ede729f7cef67ad849ec9c985.svg
new file mode 100644
index 00000000..95a81473
--- /dev/null
+++ b/docs/0.8.0/a5a1086ede729f7cef67ad849ec9c985.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/docs/app.css b/docs/0.8.0/app.css
similarity index 100%
rename from docs/app.css
rename to docs/0.8.0/app.css
diff --git a/docs/app.css.map b/docs/0.8.0/app.css.map
similarity index 100%
rename from docs/app.css.map
rename to docs/0.8.0/app.css.map
diff --git a/docs/app.js b/docs/0.8.0/app.js
similarity index 100%
rename from docs/app.js
rename to docs/0.8.0/app.js
diff --git a/docs/app.js.map b/docs/0.8.0/app.js.map
similarity index 100%
rename from docs/app.js.map
rename to docs/0.8.0/app.js.map
diff --git a/docs/0.8.0/fe46ca0e3ce2350d930eaa2581cca071.png b/docs/0.8.0/fe46ca0e3ce2350d930eaa2581cca071.png
new file mode 100644
index 00000000..973774a1
Binary files /dev/null and b/docs/0.8.0/fe46ca0e3ce2350d930eaa2581cca071.png differ
diff --git a/docs/0.8.0/index.html b/docs/0.8.0/index.html
new file mode 100644
index 00000000..4db09fa7
--- /dev/null
+++ b/docs/0.8.0/index.html
@@ -0,0 +1,13 @@
+
+
+
+ p&&(p=e.lineIndent),r(s))f++;else{if(e.lineIndent
t)&&0!==i)h(e,"bad indentation of a sequence entry");else if(e.lineIndent-1&&(s=a?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n"))):s=e.stylize("[Circular]","special")),E(o)){if(a&&i.match(/^\d+$/))return s;o=JSON.stringify(""+i),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function f(e,t,n){var r=0;return e.reduce(function(e,t){return r++,t.indexOf("\n")>=0&&r++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}function h(e){return Array.isArray(e)}function m(e){return"boolean"==typeof e}function g(e){return null===e}function b(e){return null==e}function v(e){return"number"==typeof e}function _(e){return"string"==typeof e}function y(e){return"symbol"===(void 0===e?"undefined":O(e))}function E(e){return void 0===e}function S(e){return x(e)&&"[object RegExp]"===T(e)}function x(e){return"object"===(void 0===e?"undefined":O(e))&&null!==e}function w(e){return x(e)&&"[object Date]"===T(e)}function C(e){return x(e)&&("[object Error]"===T(e)||e instanceof Error)}function D(e){return"function"==typeof e}function A(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"===(void 0===e?"undefined":O(e))||void 0===e}function T(e){return Object.prototype.toString.call(e)}function N(e){return e<10?"0"+e.toString(10):e.toString(10)}function M(){var e=new Date,t=[N(e.getHours()),N(e.getMinutes()),N(e.getSeconds())].join(":");return[e.getDate(),P[e.getMonth()],t].join(" ")}function k(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},I=/%[sdj%]/g;t.format=function(e){if(!_(e)){for(var t=[],n=0;n_?1:-1;else for(f=-1,p=0;++fv[f]?1:-1;break}if(!(p<0))break;for(u=_==s?i:m;_;){if(v[--_]x&&c(y,o,n.RM,v[0]!==h),y},m.eq=function(e){return!this.cmp(e)},m.gt=function(e){return this.cmp(e)>0},m.gte=function(e){return this.cmp(e)>-1},m.lt=function(e){return this.cmp(e)<0},m.lte=function(e){return this.cmp(e)<1},m.sub=m.minus=function(e){var t,n,r,i,a=this,o=a.constructor,s=a.s,c=(e=new o(e)).s;if(s!=c)return e.s=-c,a.plus(e);var l=a.c.slice(),u=a.e,d=e.c,p=e.e;if(!l[0]||!d[0])return d[0]?(e.s=-c,e):new o(l[0]?a:0);if(s=u-p){for((i=s<0)?(s=-s,r=l):(p=u,r=d),r.reverse(),c=s;c--;r.push(0));r.reverse()}else for(n=((i=l.lengthc;)s=t[l]+a[c]*i[l-c-1]+s,t[l--]=s%10,s=s/10|0;t[l]=(t[l]+s)%10}for(s&&++e.e,t[0]||t.shift(),c=t.length;!t[--c];t.pop());return e.c=t,e},m.toString=m.valueOf=m.toJSON=function(){var e=this,t=e.constructor,n=e.e,r=e.c.join(""),i=r.length;if(n<=t.E_NEG||n>=t.E_POS)r=r.charAt(0)+(i>1?"."+r.slice(1):"")+(n<0?"e":"e+")+n;else if(n<0){for(;++n;r="0"+r);r="0."+r}else if(n>0)if(++n>i)for(n-=i;n--;r+="0");else n1&&(r=r.charAt(0)+"."+r.slice(1));return e.s<0&&e.c[0]?"-"+r:r},m.toExponential=function(e){return null==e?e=this.c.length-1:(e!==~~e||e<0||e>1e6)&&l("!toExp!"),o(this,e,1)},m.toFixed=function(e){var t,n=this,r=n.constructor,i=r.E_NEG,a=r.E_POS;return r.E_NEG=-(r.E_POS=1/0),null==e?t=n.toString():e===~~e&&e>=0&&e<=1e6&&(t=o(n,n.e+e),n.s<0&&n.c[0]&&t.indexOf("-")<0&&(t="-"+t)),r.E_NEG=i,r.E_POS=a,t||l("!toFix!"),t},m.toPrecision=function(e){return null==e?this.toString():((e!==~~e||e<1||e>1e6)&&l("!toPre!"),o(this,e-1,2))},u=a(),void 0!==(r=function(){return u}.call(t,n,t,e))&&(e.exports=r)}()},function(e,t,n){"use strict";t.randomBytes=t.rng=t.pseudoRandomBytes=t.prng=n(164),t.createHash=t.Hash=n(165),t.createHmac=t.Hmac=n(451);var r=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(Object.keys(n(637)));t.getHashes=function(){return r};var i=n(453);t.pbkdf2=i.pbkdf2,t.pbkdf2Sync=i.pbkdf2Sync;var a=n(639);["Cipher","createCipher","Cipheriv","createCipheriv","Decipher","createDecipher","Decipheriv","createDecipheriv","getCiphers","listCiphers"].forEach(function(e){t[e]=a[e]});var o=n(650);["DiffieHellmanGroup","createDiffieHellmanGroup","getDiffieHellman","createDiffieHellman","DiffieHellman"].forEach(function(e){t[e]=o[e]});var s=n(654);["createSign","Sign","createVerify","Verify"].forEach(function(e){t[e]=s[e]}),t.createECDH=n(692);var c=n(693);["publicEncrypt","privateEncrypt","publicDecrypt","privateDecrypt"].forEach(function(e){t[e]=c[e]}),["createCredentials"].forEach(function(e){t[e]=function(){throw new Error(["sorry, "+e+" is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))}})},function(e,t,n){"use strict";(function(t){function n(e){if(e.length%r!=0){var n=e.length+(r-e.length%r);e=t.concat([e,i],n)}for(var a=new Array(e.length>>>2),o=0,s=0;o>>r[c]&1;for(var c=s;c0||t.cmpn(-i)>0;){var a=e.andln(3)+r&3,o=t.andln(3)+i&3;3===a&&(a=-1),3===o&&(o=-1);var s;if(0==(1&a))s=0;else{var c=e.andln(7)+r&7;s=3!==c&&5!==c||2!==o?a:-a}n[0].push(s);var l;if(0==(1&o))l=0;else{var c=t.andln(7)+i&7;l=3!==c&&5!==c||2!==a?o:-o}n[1].push(l),2*r===s+1&&(r=1-r),2*i===l+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return n}function a(e,t,n){var r="_"+t;e.prototype[t]=function(){return void 0!==this[r]?this[r]:this[r]=n.call(this)}}function o(e){return"string"==typeof e?c.toArray(e,"hex"):e}function s(e){return new l(e,"hex","le")}var c=t,l=n(33),u=n(65),d=n(468);c.assert=u,c.toArray=d.toArray,c.zero2=d.zero2,c.toHex=d.toHex,c.encode=d.encode,c.getNAF=r,c.getJSF=i,c.cachedProperty=a,c.parseBytes=o,c.intFromLE=s},function(e,t,n){"use strict";function r(e,t){this.type=e,this.p=new a(t.p,16),this.red=t.prime?a.red(t.prime):a.mont(this.p),this.zero=new a(0).toRed(this.red),this.one=new a(1).toRed(this.red),this.two=new a(2).toRed(this.red),this.n=t.n&&new a(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var n=this.n&&this.p.div(this.n);!n||n.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function i(e,t){this.curve=e,this.type=t,this.precomputed=null}var a=n(33),o=n(56),s=o.utils,c=s.getNAF,l=s.getJSF,u=s.assert;e.exports=r,r.prototype.point=function(){throw new Error("Not implemented")},r.prototype.validate=function(){throw new Error("Not implemented")},r.prototype._fixedNafMul=function(e,t){u(e.precomputed);var n=e._getDoubles(),r=c(t,1),i=(1<