-
Notifications
You must be signed in to change notification settings - Fork 38
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
Require multiple sections in all simplates #297
Comments
Per May 2014 call, we're punting this until after we have more experience writing editor plugins. |
I'm looking at refactoring simplates and this is at issue there. Current state of things:
Possibilty space:OTP = 'one time python', PPP = 'per-pagehit-python' Given a Basically it seems to boil down to OTP{0,1}PPP{1}template{0,} which is a bit problematic to parse since there's no indicator of the PPP section or of the templates (b/c templates can be default media type using the default renderer so nothing needs to be specified in the header). Ideas:
I'm currently in favor of option 1. |
+1 for option 1, my text editor can't highlight single-page simplates properly. |
Right now there's the weird 'is_bound' exception to the parsing method - should we ditch that? How many pages on gratipay would that break? |
The previous behavior was: 1 page: template The design principle was (and is on this ticket) "progressive enhancement of the developer experience," so you could have an Aspen learning experience like this:
It's just a bit clunkier if step one is:
The current status quo was for the sake of making editor plugins easier to write, which it sounds like may indeed be the case. I can live with that tradeoff. |
Okay, to answer my own question, there are no pages on gratipay.com with less than three sections. (Actaully, they all have 3 sections, with 3 exceptions that have 4 sections). So going with option 1 and ditching the weird is_bound thing wouldn't have much effect. |
How could there be? Requiring at least three sections is our current behavior.
|
It's only our current behavior if NOT
Anyway, the fact that even you think it's okay to just require those top two sections means to me that it should be okay to actually do so and drop the conditional on |
Ah, I see now, sorry: we still implement the relaxed behavior for !m @pjz |
I like the relaxed behavior, but we need some way to know, when there are more than two sections, whether there are one or two python sections. Or is this not worth solving? |
I think we should just go with requiring both initial Python sections, because it makes the semantics so much simpler. |
Done in #481 |
Ah, you're right! That's why we decided to forego the DWIM magic. |
'Straightforward syntax hilighting' will still work if you have 3+ sections. The DWIM code is 1) convenient and 2) simplifies the code, actually, because from a simplate point of view it's now impossible to have an invalid simplate since it can now have any number of sections, which is a big win, IMO - it makes simplates a little more transparent. |
@pjz Why is that true now but wasn't true two months ago? |
That comment says 'single page' - and I said '3+ sections'. sections == pages. Still true. |
The question here is: should "at least 3 sections" be a rule enforced by aspen, or only a recommendation? |
@pjz and I talked about this on the October, 2015 call (#507). I don't think we have enough experience writing editor plugins to make a good decision about this one way or another. As we're now suggesting, an individual or project can adopt an "at least three sections" convention. I think we should let this stand and revisit if/when we have more experience. |
Closing in favor of AspenWeb/simplates.org#1. |
Right now this is an error as a negotiated simplate (
foo.spt
):Why? Can it not be? We should render and serve that as text/html (cf. #296).
The text was updated successfully, but these errors were encountered: