Yes, that is the idea- all the inner content or descendant nodes will now have implicit spacing- adding a '>' to get the "huge win" scenario from the examples given. I do think it adds confusion for new users- it isn't something we would want to use in a tutorial. It would be a feature for users already comfortable with Hamlet. Perhaps '<p>>' is actually too subtle. Some alternatives:<div>
<br></div><div><p>spaced></div><div><p>S></div><div><p>#></div><div><p>< ><div><br></div><div>There is also a possibility of adding an indicator inside the tag.</div><div><p=></div>
<div><p=spaced></div><div><p=#><br><div><br> <br><div class="gmail_quote">On Mon, May 23, 2011 at 11:22 PM, Mark Bradley <span dir="ltr"><<a href="mailto:barkmadley@gmail.com">barkmadley@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div></div><div class="h5">On Tue, May 24, 2011 at 4:13 PM, Michael Snoyman <<a href="mailto:michael@snoyman.com">michael@snoyman.com</a>> wrote:<br>
> On Tue, May 24, 2011 at 7:00 AM, Greg Weber <<a href="mailto:greg@gregweber.info">greg@gregweber.info</a>> wrote:<br>
>><br>
>> The Yesod homepage looks like this:<br>
>> <p><br>
>> If you are new to Yesod, you should start off with #<br>
>> <a href=@{FiveMinutesR}>the five minute start instructions<br>
>> . The #<br>
>> <a href=@{ScreencastsR}>screencasts<br>
>> \ give a nice introduction to some of the advanced concepts, and<br>
>> #<br>
>> <a href=@{BookR}>the book<br>
>> \ is the recommended approach to learning Yesod. Ask the #<br>
>> <a href=@{CommunityR}>commnunity<br>
>> \ for help.<br>
>> Allowing one-line tags in positions other than the very beginning allows for<br>
>> the removal of the '#' character:<br>
>> <p><br>
>> If you are new to Yesod, you should start off with<br>
>> \ <a href=@{FiveMinutesR}>the five minute start instructions<br>
>> . The <a href=@{ScreencastsR}>screencasts<br>
>> \ give a nice introduction to some of the advanced concepts, and<br>
>> \ <a href=@{BookR}>the book<br>
>> \ is the recommended approach to learning Yesod. Ask the<br>
>> \ <a href=@{CommunityR}>commnunity<br>
>> \ for help.<br>
>> Having implicit spaces is actually a huge win here:<br>
>> <p><br>
>> If you are new to Yesod, you should start off with<br>
>> <a href=@{FiveMinutesR}>the five minute start instructions<br>
>> The<br>
>> <a href=@{ScreencastsR}>screencasts<br>
>> give a nice introduction to some of the advanced concepts, and<br>
>> <a href=@{BookR}>the book<br>
>> is the recommended approach to learning Yesod. Ask the<br>
>> <a href=@{CommunityR}>commnunity<br>
>> for help.<br>
>> But I am wondering if it is best to keep things the way they are but just<br>
>> indicate when there should be implicit spaces. My thought is to somehow use<br>
>> angle brackets. Changing <p> to <p>> would indicate implicit spaces.<br>
><br>
> What's the advantage of adding a new syntax for "implicit" space<br>
> versus just explicitly adding the space?<br>
<br>
</div></div>I think he means that the child nodes of <p>> would be affected by<br>
some implicit spacing rules.<br>
<br>
Personally I prefer one consistent behaviour (explicit spacing every<br>
time). Trying to get too smart will get confusing and inaccurate<br>
quickly.<br>
<div><div></div><div class="h5"><br>
><br>
> Michael<br>
><br>
>> Greg Weber<br>
>> On Fri, May 20, 2011 at 8:22 AM, Patrick Brisbin <<a href="mailto:pbrisbin@gmail.com">pbrisbin@gmail.com</a>> wrote:<br>
>>><br>
>>> On 05/20/11 at 11:12am, Daniel Patterson wrote:<br>
>>> > I think what the original author was saying was that when you make a new<br>
>>> > line with html, whitespace is inserted, not whether hamlet should<br>
>>> > automatically insert space after every tag.<br>
>>> ><br>
>>> > So yes, writing <p>hello<strong>there</strong></p> should not put white<br>
>>> > spacing.<br>
>>> ><br>
>>> > But when you write, in html:<br>
>>> > <p>hello<br>
>>> > <strong>there</strong></p><br>
>>> ><br>
>>> > It is equivalent to <p>hello <strong>there</strong></p> (note the<br>
>>> > space).<br>
>>><br>
>>> Isn't that simply due to the fact that HTML compresses whitespace across<br>
>>> the board? (turning that "\n\t" or "\n " into just " ")<br>
>>><br>
>>> Leading spaces in hamlet are used to define nesting, so also compressing<br>
>>> this whitespace (rather than stripping it) would produce odd effects:<br>
>>><br>
>>> <div><br>
>>> <p>Hey<br>
>>> <strong>there<br>
>>><br>
>>> Would turn into<br>
>>><br>
>>> <div> <p>Hey <strong>there</strong></p></div><br>
>>><br>
>>> Which has an unneeded space after the parent <div><br>
>>><br>
>>> Right?<br>
>>><br>
>>> ><br>
>>> ><br>
>>> > On May 19, 2011, at 11:57 PM, Michael Snoyman wrote:<br>
>>> ><br>
>>> > > On Thu, May 19, 2011 at 11:49 PM, Patrick Palka <<a href="mailto:patrick@parcs.ath.cx">patrick@parcs.ath.cx</a>><br>
>>> > > wrote:<br>
>>> > >> I find it a bit unintuitive that the hamlet code<br>
>>> > >><br>
>>> > >> <p>hello<br>
>>> > >> <strong>there<br>
>>> > >><br>
>>> > >> or<br>
>>> > >><br>
>>> > >> <p><br>
>>> > >> hello<br>
>>> > >> <strong>there<br>
>>> > >><br>
>>> > >> generates the html<br>
>>> > >><br>
>>> > >> <p>hello<strong>there</strong></p><br>
>>> > >><br>
>>> > >> I expected there to be a space between "hello" and "there" similar to<br>
>>> > >> what<br>
>>> > >> the html specifications dictate. Is this behavior intentional or an<br>
>>> > >> oversight? If it's the former, then what is the recommended way to<br>
>>> > >> simulate<br>
>>> > >> my expected behavior? Appending a space to the end of a line is<br>
>>> > >> mentally ugly and syntactically obscure.<br>
>>> > ><br>
>>> > > I'm not sure what you mean by "what the html specifications dictate."<br>
>>> > > HTML is whitespace-sensitive, meaning that:<br>
>>> > ><br>
>>> > > <i>foo</i> <b>bar</b><br>
>>> > ><br>
>>> > > and<br>
>>> > ><br>
>>> > > <i>foo</i><b>bar</b><br>
>>> > ><br>
>>> > > Are different. Now, in all likelihood in the above example, you will<br>
>>> > > want to have the whitespace surrounding tags. But consider the<br>
>>> > > following HTML:<br>
>>> > ><br>
>>> > > <p>You are logged in as <i>Michael Snoyman</i>, <a<br>
>>> > > href="/logout">logout</a>.</p><p>Another paragraph.</p><br>
>>> > ><br>
>>> > > In the case of the <i> and <a> tags, we definitely do *not* want to<br>
>>> > > add whitespace after the tag (though we do want it before the tag). In<br>
>>> > > the case of <p>, we don't care one way or another, but adding the<br>
>>> > > whitespace everywhere will take up (a trivial amount of) extra<br>
>>> > > bandwidth. tl;dr: Sometimes you don't want the whitespace.<br>
>>> > ><br>
>>> > > So when designing Hamlet, I thought up a few possibilities:<br>
>>> > ><br>
>>> > > 1) What we do now: all whitespace must be explicit.<br>
>>> > > 2) Implicitly add whitespace before/after every tag.<br>
>>> > > 3) Do something "smart", adding whitespace where it's desired.<br>
>>> > ><br>
>>> > > (2) isn't really an option because it makes having a tag as the last<br>
>>> > > word in a sentence impossible. (3) gives me the creeps: I like smart<br>
>>> > > libraries, but I will *never* trust a library to do this kind of stuff<br>
>>> > > correctly all the time, even if I'm the one making up the rules for it<br>
>>> > > to follow! And I have no doubt that it will quickly devolve into 500<br>
>>> > > lines of hairy code to try and cover millions of corner cases. Oh, and<br>
>>> > > don't forget that there are other languages than English that might<br>
>>> > > approach it differently.<br>
>>> > ><br>
>>> > > I suppose another possibility is (2) along with some special way of<br>
>>> > > forcing the removal of extra whitespace, but this seemed much less<br>
>>> > > intuitive than the current approach.<br>
>>> > ><br>
>>> > > Anyway, that's the reasoning behind this stuff, if people have better<br>
>>> > > ideas, I'd like to hear them.<br>
>>> > ><br>
>>> > > Michael<br>
>>> > ><br>
>>> > > _______________________________________________<br>
>>> > > web-devel mailing list<br>
>>> > > <a href="mailto:web-devel@haskell.org">web-devel@haskell.org</a><br>
>>> > > <a href="http://www.haskell.org/mailman/listinfo/web-devel" target="_blank">http://www.haskell.org/mailman/listinfo/web-devel</a><br>
>>> ><br>
>>> ><br>
>>> > _______________________________________________<br>
>>> > web-devel mailing list<br>
>>> > <a href="mailto:web-devel@haskell.org">web-devel@haskell.org</a><br>
>>> > <a href="http://www.haskell.org/mailman/listinfo/web-devel" target="_blank">http://www.haskell.org/mailman/listinfo/web-devel</a><br>
>>><br>
>>> --<br>
>>> patrick brisbin<br>
>>><br>
>>> _______________________________________________<br>
>>> web-devel mailing list<br>
>>> <a href="mailto:web-devel@haskell.org">web-devel@haskell.org</a><br>
>>> <a href="http://www.haskell.org/mailman/listinfo/web-devel" target="_blank">http://www.haskell.org/mailman/listinfo/web-devel</a><br>
>><br>
>><br>
>> _______________________________________________<br>
>> web-devel mailing list<br>
>> <a href="mailto:web-devel@haskell.org">web-devel@haskell.org</a><br>
>> <a href="http://www.haskell.org/mailman/listinfo/web-devel" target="_blank">http://www.haskell.org/mailman/listinfo/web-devel</a><br>
>><br>
>><br>
><br>
> _______________________________________________<br>
> web-devel mailing list<br>
> <a href="mailto:web-devel@haskell.org">web-devel@haskell.org</a><br>
> <a href="http://www.haskell.org/mailman/listinfo/web-devel" target="_blank">http://www.haskell.org/mailman/listinfo/web-devel</a><br>
><br>
<br>
<br>
<br>
</div></div><font color="#888888">--<br>
-barkmadley<br>
sent from an internet enabled device<br>
</font></blockquote></div><br></div></div></div>