Giter Site home page Giter Site logo

Comments (5)

pedronauck avatar pedronauck commented on April 28, 2024 2

To facilitate user feedbacks and make a really good roadmap, now we're using Canny as a tool to create our roadmap 😍

We think that is better keep Github issues only for bugs and other issues! 🐞
This issue is already on our roadmap, so I'll close this issue in favor of it!

👉🏻 Check this issue on roadmap

from docz.

pedronauck avatar pedronauck commented on April 28, 2024 2

🎉  Fixed and released in the new v0.4.0

from docz.

pedronauck avatar pedronauck commented on April 28, 2024

Yeah, this is better I think too. I tried to do this, but unfortunately did not work very well, so how I needed to release soon I ended up leaving for later! But I have plans to fix this, thanks @mrmartineau 🙏

from docz.

albinekb avatar albinekb commented on April 28, 2024

Maybe remove <Playground> and </Playground> in here https://github.com/pedronauck/docz/blob/master/packages/docz-core/src/utils/plugin-hast.ts#L24 🤔 Maybe there's a cleaner way?

from docz.

good-idea avatar good-idea commented on April 28, 2024

This would also be nice when you need to prepare your props data in the documentation. For instance:

UserProfile.mdx:

import Username from './Username'
import { makeAvatarFromImage } from './utils'
import { userStub, imageStub } from './stubs'

## Usage

<Playground render={() => {
  const username = `@${userStub.username}`
  const avatar = makeAvatarFromImage(imageStub)

  // ... more lines of code that don't need to be displayed in the docs...

  return <UserProfile username={username} avatar={avatar} /> 
}} />

Output:

<UserProfile username={username} avatar={avatar} /> 

A related but different question: Is it possible to use javascript in MDX and make it available to the playground component?

For example:

import Username from './Username'
import { makeAvatarFromImage } from './utils'
import { userStub, imageStub } from './stubs'

const username = `@${userStub.username}`
const avatar = makeAvatarFromImage(imageStub)

// ... more lines of code that don't need to be displayed in the docs...

## Usage

<Playground>
   <UserProfile username={username} avatar={avatar} /> 
</Playground>

When I try something like this, i get username is not defined

from docz.

Related Issues (20)

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.