-
Notifications
You must be signed in to change notification settings - Fork 2k
Coffee Tags #4443
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
Coffee Tags #4443
Conversation
This works like a """ HEREDOC, but allows syntax highlights.
…unction $ coffee -s -p <<< '<!createRenderer!><a>"Hello..."' (function() { createRenderer('a', "Hello..."); }).call(this); $ coffee -s -p <<< '<a>"Hello..."' (function() { h('a', "Hello..."); }).call(this);
Hrm... this is an updated PR from #4346 @GeoffreyBooth asked for a new custom render function, this PR contains that. |
Let’s please keep this in #4346 to preserve the conversation history. I’ve reopened that pull request. As you push more commits to your branch, that PR is updated automatically. |
@GeoffreyBooth - It's weird, this duplicate PR is from the same branch where I've made my updates. Only this PR updates when I push a commit, the one from #4346 doesn't update. |
@GeoffreyBooth - ok cool... looks like it's working now. I'll do everything over in #4346 |
CoffeeTags
{div, table, th, tr} = React.DOM
)<!myRenderer!>
(the default render function ish
)<div.active@menu>
yields<div class="active" id="menu">
div
(i.e. -<>
,<.note>
, and<.active@sidebar!>
are all valid)!
on tags for unescaped content (e.g. -<span.note!> "Note: #{text}"
)?
on tags for showing debugging output (e.g. -<div?>
)div()
, you can just use<div>
)<div className: 'foo'
>)div null, "Hello"
)"h#{ level }">
can produce<h3>
)Example
CoffeeScript source
CoffeeScript output