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
html tidy? #341
Comments
JSBin rocks! I'd switch from JSFiddle, if it supported tidying up HTML, CSS and JS. |
Maybe adding this would also solve #339? |
Yeah, I mean as a principle, it should probably be optional (via a UI flag perhaps), sometimes you want things reformatted (especially if you're cut and pasting from a messy 3rd party site). An other times you want it to leave your code alone |
I'm just imagining a button that calls tidy (or similar) on the |
Not hard to implement. You pull the tidy library, and run I've been thinking about (for a few years now) about a plugin/extension Let me think about it a bit more... |
great, thanks again remy! |
I wrote myself a Chrome Extension to do this..... |
👍 |
This is pseudo-code because I don't have the time at the moment at work to do a full fork-edit-pr, But couldn't this be done by doing then: var htmlTidy = require('htmltidy').tidy;
htmlTidy(jsbin.panels.panels.html.getCode(), function(err, html) {
jsbin.panels.panels.html.setCode(html)
}); Either run it by key combo (I'm partial to ctrl/cmd+shift+L) or by menu item. |
There's no require client side in jsbin and getCode is a promise. ie. It's It also needs to ignore markdown and support jade? (Or ignore). On Mon, 27 Oct 2014 14:42 Jon Wolfe notifications@github.com wrote:
|
I'll try to have a PR in around Tuesday night for this. I don't know if there's even is a Jade beautifier since it's whitespace dependent. I'll just have it check the panel setting up at the top to see if it's set to HTML and only run if so. |
The jsbin.state object will tell you which processor is in effect. On Mon, 27 Oct 2014 15:04 Jon Wolfe notifications@github.com wrote:
|
Gotcha. I can see the code in my head, I just need some time to pin it down and check it. |
@JonathanWolfe how's this coming along 😺? |
Work went from busy to crazy so I pushed it to the back burner. Maybe in a week? We're wrapping up 2 projects soon in the next couple days so I should get time again. |
Awesome, that's great, thank you! |
Done! |
pretty cool! ;) |
Hi @remy love this beautify feature, however for some weird reason. My Command + Shift + L stopped working after couple of times. I am using chrome on a mac. Also I am noticing it works if am logged out of my account. I tried making my settings to default ... however when I am logged in the beautify code feature still doesn't work. |
Hi remy,
Is there already a feature to allow tidying of HTML (e.g. the way the command-line tool "tidy" does)? Mostly I'm just looking for a way to copy in poorly formatted code from a given website, then make it presentable so students can seethe structure a little better. I can do this directly with tidy but it would be cool if jsbin let me (and my students) click a button somewhere... Thanks,
matt
The text was updated successfully, but these errors were encountered: