-
Notifications
You must be signed in to change notification settings - Fork 555
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
Support injection from multiple files from tabs #1388
Comments
In case you are wondering, here is the HTML that I quickly put together to create the sample used in the opening comment:
It should be easy enough to create a Liquid tag to make creation of these tabbed structures easier and less error prone in markdown files. |
@chalin, is this request primarily about how code is rendered when the inject script fails to replace the correct elements with a DartPad iframe? If so, how often is that happening? |
No, the main reason is that it is easier to use the current code-excerpt tooling to separately extract individual files of a multifile example, and place each file in a div-separated code block, than it is to create a single code block with files separated by custom Also, it would nicely support #1390. |
I'm working on adding interactive examples to the flutter_hooks repo and this would help tremendously. Here's the solution without this feature: We have a script that pulls the library into one file, we hide that in the If we could pre-load the main.dart with whatever docstring-code-block we want, and use the body of a Let me know if I'm making this too complicated. |
With #2808, it was decided to not support the multi-file use case to focus on what DartPad does best. If anyone is still interested in this, please open a new issue for discussion, thanks! |
DartPad inject feature supports injecting single-file examples from fenced code like this:
Multifile support currently uses special markers within the same code block like this:
A nice thing about supporting injection from regular code blocks is that is that if injection fails then the user still sees the regular code block.
It would be great if the injector would get multi-file content from different tabs that could be rendered in the page like this:
There are different ways to encode tabbed content like this, including Bootstrap tabs; essentially having code blocks in separate
<div>
elements. This would make it much easier to extra code excerpts using current toolsing. /cc @kwalrath @legalcodesThe text was updated successfully, but these errors were encountered: