{"id":15048578,"url":"https://github.com/mizchi/amdx","last_synced_at":"2025-04-10T01:24:19.870Z","repository":{"id":40835024,"uuid":"250072382","full_name":"mizchi/amdx","owner":"mizchi","description":"Accelarated MDX","archived":false,"fork":false,"pushed_at":"2023-01-06T06:15:15.000Z","size":2121,"stargazers_count":83,"open_issues_count":32,"forks_count":12,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-24T03:11:22.668Z","etag":null,"topics":["md","mdx","mdxx"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mizchi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-25T19:29:42.000Z","updated_at":"2024-06-09T09:27:25.000Z","dependencies_parsed_at":"2023-02-05T12:31:12.400Z","dependency_job_id":null,"html_url":"https://github.com/mizchi/amdx","commit_stats":null,"previous_names":[],"tags_count":59,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mizchi%2Famdx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mizchi%2Famdx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mizchi%2Famdx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mizchi%2Famdx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mizchi","download_url":"https://codeload.github.com/mizchi/amdx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248138871,"owners_count":21053972,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["md","mdx","mdxx"],"created_at":"2024-09-24T21:14:10.605Z","updated_at":"2025-04-10T01:24:19.846Z","avatar_url":"https://github.com/mizchi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AMDX\n\nAccelerated MDX\n\n## Features\n\n- MDX to AMP\n- AMP Friendly Output\n- Opinionated remark settings\n\n  - Highlight with `refract`\n  - frontmatter\n  - Gen `amp-img` from `img` with `{amp: true}` config\n  - Gen `amp-mathml` from `$$ ~ $$`\n\n- Rich parser and thin runner to preprocess\n- Worker Friendy: Compile to pure JSON to postMessage\n\n## AMDX document example\n\nUse `.mdx` extension to highlight\n\n```md\n\u003c!-- foo.mdx --\u003e\n\nimport Bar from \"./bar\"\n\n# Hello from Foo\n\n\u003cBar /\u003e\n```\n\n```md\n\u003c!-- bar.mdx --\u003e\n\nimport Bar from \"./bar\"\n\n# Bar\n```\n\nrender foo.mdx (with amdx-loader/rollup-plugin-amdx)\n\n```tsx\nimport React from \"react\";\nimport ReactDOM from \"react-dom/server\";\nimport Foo from \"./foo.mdx\";\n\nconst str = ReactDOMServer.renderToString(\u003cFoo /\u003e);\nconsole.log(str);\n```\n\n## packages\n\n- `amdx-loader`: webpack-loader\n- `amdx`: parser and compiler by remark\n- `amdx-runner`: runner for parsed json\n- `amdx-cli`: `amdx` cli tools\n- `rollup-plugin-amdx`: rollup plugin\n\n## AMDXG: Static Site generator with next.js\n\n- `amdxg-docs`: Doc by amdx on `next.js`\n- `amdxg-components`: ssg components\n- `amdxg-cli`: ssg components\n\n## CLI\n\n```bash\n# install\n$ npm install amdx-cli -g\n```\n\n## webpack loader\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      // add this rule\n      {\n        test: /\\.mdx?/,\n        loader: \"amdx-loader\",\n      },\n    ],\n  },\n};\n```\n\n## rollup\n\n```js\n// rollup.config.js\nimport { amdx } from \"rollup-plugin-amdx\";\nexport default {\n  // ...\n  plugins: [amdx()],\n};\n```\n\n## API\n\n```js\nimport React from \"react\";\nimport ReactDOM from \"react-dom\";\n\nimport { compile } from \"amdx-runner\";\nimport { parse } from \"amdx\";\n\nconst ast = parse(`# hello`);\n\nfunction App(props) {\n  return const el = compile(ast, {\n    props,\n    components: {},\n    h: React.createElement,\n    Fragment: React.Fragment\n  });\n}\n\nReactDOM.render(\u003cApp /\u003e, document.querySelector(\"#main\"));\n```\n\n## TODO\n\n- [x] title\n- [x] amp-img\n- [x] Social Share button\n- [x] CLI Scaffolding\n- [x] Google Analytics\n- [x] Header\n- [x] Fix css on export\n- [x] amdx-runner: amp option\n- [x] amdxg Support `styled-components`\n- [x] amdxg AMP Install Service Worker\n- [x] amdxg Refactor layout css\n- [x] amdxg `amp-img` fixed height\n- [x] compiler: heading slug\n- [x] compiler: toc\n- [x] amdxg Fix css\n- [x] amdxg Support amp-social-share\n- [x] amdxg amdxg-cli\n- [x] parser: Support amp-mathml\n- [x] CI\n- [x] amdxg Gen git history\n- [x] amdxg Link to GitHub PR\n- [x] amdxg-components: create\n- [x] amdxg Render mdx on `pages/*.mdx` =\u003e auto gen /docs by getStaticProps\n- [x] amdxg Gen RSS\n- [x] Rename to something =\u003e amdx\n- [ ] amdxg amp-script compiler or `new:script` boilerplate\n- [ ] amdxg clickable anchor\n- [ ] Fix prism\n- [ ] Fix amp-img\n- [ ] Next 9.4 ssg fallback mode\n\n## LICENSE\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmizchi%2Famdx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmizchi%2Famdx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmizchi%2Famdx/lists"}