Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Live examples for documentation #35188

Closed
2 tasks done
EricSimons opened this issue Oct 13, 2021 · 2 comments
Closed
2 tasks done

Live examples for documentation #35188

EricSimons opened this issue Oct 13, 2021 · 2 comments
Assignees
Labels

Comments

@EricSimons
Copy link

Prerequisites

Proposal

As users browse Bootstrap's various components, it would be helpful to have a link to a live environment where they can instantly try it out and fiddle around. This accelerates learning, encourages prototyping, and ultimately helps developers adopt bootstrap.

Because nearly all the examples in the docs include the relevant HTML in the corresponding code block this can be integrated very easily with existing online playgrounds like StackBlitz (of which I'm the co-creator and has been recommended by the Bootstrap maintainers for bug repros, etc).

With the StackBlitz JS SDK you can spawn playgrounds on-demand using the codeblock's contents when the user clicks an example. This ensures the docs themselves are the "source of truth" for all live examples contents and doesn't require additional maintenance.

I spent a few hours creating a PoC of how this could work and it seems to be pretty lightweight (here's the code diff, very WIP/not cleaned up yet). Also have included a GIF below of it in action:

bs-1

Motivation and context

This would be a boon for developers interacting with the Bootstrap docs whether for learning, prototyping, or for bug repros. For these reasons other popular OSS libraries often have similar integrations- for example, ReactJS.org uses Codepen, Angular.io uses StackBlitz, etc etc.

Would this be something the Bootstrap team/community would be open to accepting PRs for? If so, would love to discuss any additional details and then I can work on making an official PR. (I would've already created a PR but the contributing guide asks that folks file an issue before opening up PRs for new functionality, hence the creation of this issue :)

@XhmikosR XhmikosR self-assigned this Nov 2, 2021
@XhmikosR
Copy link
Member

XhmikosR commented Dec 2, 2021

@EricSimons could you please make a clean PR (without any dist files) so that we can check this out live?

As long as we don't load unnecessary stuff and we don't delay page loading, I'm all for improving the experience. We can discuss the implementation details in your PR.

@mdo
Copy link
Member

mdo commented Apr 12, 2022

Closing as fixed since #35644 was merged :).

@mdo mdo closed this as completed Apr 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants