Giter Site home page Giter Site logo

eleventy-plugin-mdx's People

Contributors

madebymike avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

eleventy-plugin-mdx's Issues

Expose page info in a React context

Hi! I’m excited about how this plugin is going.

One thing I’m trying to do is make an <Image> component to tie into @11ty/eleventy-img. What it’s missing though is knowing what page it’s rendering so it can resolve relative image paths.

11ty has support for supplying page information through shortcodes, but it does it via a this assignment that doesn’t work with React. See: https://www.11ty.dev/docs/languages/nunjucks/#access-to-page-data-values

Could this same information be available via a React context for MDX components to see?

Why React dependencies?

MDX can be used with any JSX implementation, e.g. Preact, Vue, Solid.js, etc.

So why does this project require react and react-dom?

custom root container id?

this is a wonderful plugin, love it!

i would love to set my custom root container ID. would you be willing to include this feature? i can create a pull request.

Not working with google charts

I wanted to put some charts on my landing page, and thought that this plugin + google charts (https://www.react-google-charts.com/examples/bar-chart) would be a killer combo.

The example provided in this plugin works flawlessly, but when trying the Chart component no errors are given in the terminal but the component is not rendered in the html. Do you have any idea why? (the chart example is taken directly from google charts):

---
title: AllPages
layout: "news.njk"
layouttype: "news"
description: Some fancy title
---

import { Chart } from "react-google-charts";

export const data = [
  ["City", "2010 Population", "2000 Population"],
  ["New York City, NY", 8175000, 8008000],
  ["Los Angeles, CA", 3792000, 3694000],
  ["Chicago, IL", 2695000, 2896000],
  ["Houston, TX", 2099000, 1953000],
  ["Philadelphia, PA", 1526000, 1517000],
];

export const options = {
  title: "Population of Largest U.S. Cities",
  chartArea: { width: "50%" },
  hAxis: {
    title: "Total Population",
    minValue: 0,
  },
  vAxis: {
    title: "City",
  },
};

<Chart
  chartType="BarChart"
  width="100%"
  height="400px"
  data={data}
  options={options}
/>

And in the rendered page we can see the MDX div, but it is empty:
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.