Accelerated MDX
-
MDX to AMP
-
AMP Friendly Output
-
Opinionated remark settings
- Highlight with
refract
- frontmatter
- Gen
amp-img
fromimg
with{amp: true}
config - Gen
amp-mathml
from$$ ~ $$
- Highlight with
-
Rich parser and thin runner to preprocess
-
Worker Friendy: Compile to pure JSON to postMessage
Use .mdx
extension to highlight
<!-- foo.mdx -->
import Bar from "./bar"
# Hello from Foo
<Bar />
<!-- bar.mdx -->
import Bar from "./bar"
# Bar
render foo.mdx (with amdx-loader/rollup-plugin-amdx)
import React from "react";
import ReactDOM from "react-dom/server";
import Foo from "./foo.mdx";
const str = ReactDOMServer.renderToString(<Foo />);
console.log(str);
amdx-loader
: webpack-loaderamdx
: parser and compiler by remarkamdx-runner
: runner for parsed jsonamdx-cli
:amdx
cli toolsrollup-plugin-amdx
: rollup plugin
amdxg-docs
: Doc by amdx onnext.js
amdxg-components
: ssg componentsamdxg-cli
: ssg components
# install
$ npm install amdx-cli -g
module.exports = {
module: {
rules: [
// add this rule
{
test: /\.mdx?/,
loader: "amdx-loader",
},
],
},
};
// rollup.config.js
import { amdx } from "rollup-plugin-amdx";
export default {
// ...
plugins: [amdx()],
};
import React from "react";
import ReactDOM from "react-dom";
import { compile } from "amdx-runner";
import { parse } from "amdx";
const ast = parse(`# hello`);
function App(props) {
return const el = compile(ast, {
props,
components: {},
h: React.createElement,
Fragment: React.Fragment
});
}
ReactDOM.render(<App />, document.querySelector("#main"));
- title
- amp-img
- Social Share button
- CLI Scaffolding
- Google Analytics
- Header
- Fix css on export
- amdx-runner: amp option
- amdxg Support
styled-components
- amdxg AMP Install Service Worker
- amdxg Refactor layout css
- amdxg
amp-img
fixed height - compiler: heading slug
- compiler: toc
- amdxg Fix css
- amdxg Support amp-social-share
- amdxg amdxg-cli
- parser: Support amp-mathml
- CI
- amdxg Gen git history
- amdxg Link to GitHub PR
- amdxg-components: create
- amdxg Render mdx on
pages/*.mdx
=> auto gen /docs by getStaticProps - amdxg Gen RSS
- Rename to something => amdx
- amdxg amp-script compiler or
new:script
boilerplate - amdxg clickable anchor
- Fix prism
- Fix amp-img
- Next 9.4 ssg fallback mode
MIT