5 ms·
Just tested and it will be a huge productivity improvement for me. Is there any way to inspect what libraries have been added for temporary swings? Do you plan
by methyl 6y ago
Just tested and it will be a huge productivity improvement for me. Is there any way to inspect what libraries have been added for temporary swings? Do you plan to add sharing functionality, so that I can send over URL for anyone to explore the playground?
- lostintangent 6y agoHey! By default, none of the current templates add any libraries to the swing. However, I'm planning on adding new template galleries to make it easy to create/explore ideas using popular frameworks. I'd love to hear if you have any suggestions for what you'd like to see me prioritize (e.g. React, Tailwind, etc.), since I'll be working on that this weekend :D That said, when you create/open a swing, there will be a "CodeSwing" view on the Explorer tab, which displays all the files in the swing. One of those files will be called "codeswing.json", which is the manifest for the swing itself. If you click on it, you'll see two array properties, called "scripts" and "styles", which list the libraries that have been added to the swing. When you add a new library via the "Add Library" command, it will add the selected library to that file: https://github.com/codespaces-contrib/codeswing#external-libraries https://github.com/codespaces-contrib/codeswing#external-lib.... Let me know if you have any feedback on that experience! Regarding sharing: I maintain another VS Code extension called GistPad (https://aka.ms/gistpad https://aka.ms/gistpad) that allows you to login with GitHub and then manage gists/repos without cloning/committing files. GistPad has an integration with CodeSwing that allows you to create swings as gists, and then edit/share them with others: https://github.com/codespaces-contrib/gistpad#codeswing https://github.com/codespaces-contrib/gistpad#codeswing. Since GistPad shows your starred gists, and lets you follow other GitHub users, you can also share swings by simply starring/following others that are creating swings in gists. Additionally, since you can create new swings as local directories (using the "CodeSwing: New Swing..." command), you could store a swing in a GitHub/BB/GitLab repo, and then when others clone and open that repo in VS Code, the CodeSwing extension will detect the swing and automatically launch the right coding environment. The gif in the project's README shows that in action using GitHub Codespaces. Let me know if any of that sounds interesting, or if you have feedback on how I could improve the overall experience. Thanks so much for checking out CodeSwing!
- methyl 6y agoThat are all great plans! React template would be useful, I guess should be more popular than Less/Sass templates. For sharing via GistPad: a great start, but ultimately I'd love to share with people without VSCode via hosted URL. There's an excellent bl.ocks.org that can render Gist in a browser (just replace gist.github.com with bl.ocks.org if you have index.html file: https://gist.github.com/methyl/f4c2395f941493b6bf5212dac5e44b2c https://gist.github.com/methyl/f4c2395f941493b6bf5212dac5e44... => https://bl.ocks.org/methyl/f4c2395f941493b6bf5212dac5e44b2c https://bl.ocks.org/methyl/f4c2395f941493b6bf5212dac5e44b2c or if you prefer direct link add /raw https://bl.ocks.org/methyl/raw/f4c2395f941493b6bf5212dac5e44b2c/ https://bl.ocks.org/methyl/raw/f4c2395f941493b6bf5212dac5e44...). I guest GistPad integration could generate those sharable links. I also noticed there is a preview mode in GistPad. How does it differ from CodeSwing?
- lostintangent 6y agoAh, got it. Apologies for misunderstanding! I'm currently working on the ability to export a swing to CodePen and Bl.ocks, so that you can create your swings in VS Code, and then share them with the appropriate communities. I should have both of these done this weekend. Would that work for your workflow? Since you can export CodePens as gists, and all Bl.ocks are already gists, you can actually already open any CodePens/Bl.ocks inside of GistPad right now. So I just need to finalize the swing->CodePen/Bl.ocks experience. Regarding GistPad: it bundles CodeSwing along with it (as an optional, uninstallable dependency), so that you can install GistPad and use it to create code snippets/swings/notes/etc. So CodeSwing is the core "interactive coding playground" environment, that can be used with or without GistPad. And GistPad is effectively a virtual filesystem for VS Code, that allows you to edit gists and repos as if they were always-available files.