Skip to content
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

factor out simplates #341

Closed
chadwhitacre opened this issue May 7, 2014 · 22 comments
Closed

factor out simplates #341

chadwhitacre opened this issue May 7, 2014 · 22 comments

Comments

@chadwhitacre
Copy link
Contributor

I think we should promote simplates as their own thing. I just bought simplates.org for the purpose. Simplates are a file format for web programming. We should define a standard and release a reference implementation in Python, used by Aspen. We should get simplates supported on GitHub in code blocks and in their Ace editor.

This is a meta issue that will result in new issues. Wanted to capture the general idea.

@chadwhitacre
Copy link
Contributor Author

I think simplates should be promoted separately from Aspen because what's really needed for Aspen to take root is for tooling to arise around simplates. Think http://prose.io/ as well as Ace and other editor plugins. If simplates are a thing of their own apart from Aspen, it's going to be easier for the wider open-source community to take simplates on board, which (perhaps counter-intuitively) will have a beneficial effect on Aspen.

@chadwhitacre chadwhitacre mentioned this issue Jun 4, 2014
36 tasks
@chadwhitacre
Copy link
Contributor Author

We've got http://simplates.org/ up now. Still need to factor out the library.

@webmaven
Copy link

You might have some success promoting it as a simpler alternative to iPython notebooks.

@techtonik
Copy link
Contributor

I actually thought they are a part of Gratipay code and not Aspen.

@chadwhitacre
Copy link
Contributor Author

On #472 it sounds like @pjz has some code on this, but we may end up dropping back and trying strategy 1:

  1. Disentangle Aspen's http API from simplates without creating a new library (parallel to how we disentangled the dispatcher).
  2. Make a new library off the bat.

@pjz
Copy link
Contributor

pjz commented Jul 30, 2015

Working toward this slowly. Some hangups I could use opinions/ideas on:

  1. Renderers are really part of simplates, but right now they're in aspen.renderers with simplates in aspen.resources. Maybe simplates should go into aspen.simplates with aspen.resources doing the deciding whether to use simplates or a simple static resource object? And then renderers could go in aspen.simplate.renderers ?
  2. Where should website.default_renderers_by_media_type end up?
  3. Where should website.renderer_factories end up? maybe simplate.renderer.factories() ?

@chadwhitacre
Copy link
Contributor Author

  1. Sounds about right.

2 and 3) Let's maybe look at Jinja2 and other templating systems. I believe they generally handle this with a Context object.

@chadwhitacre
Copy link
Contributor Author

Where "this" is library configuration.

@pjz
Copy link
Contributor

pjz commented Jul 31, 2015

So:

  • Move simplates to aspen.simplates; make aspen.resources still choose between simplates and static resources.
  • Move aspen.renderers under aspen.simplates
  • Make a stub aspen.renderers for backwards compatibility with the renderer modules
  • Make SimplateFactory to hold config data like the renderer registry (aka renderer_factories) default_renderers_by_media_type
  • more TBD.

Sound good?

@chadwhitacre
Copy link
Contributor Author

@pjz lgtm

!m @pjz

P.S. I'm on vacation for a week. :] 🌴

@pjz
Copy link
Contributor

pjz commented Jul 31, 2015

...be careful, I might Change The World while you're gone :)

@pjz
Copy link
Contributor

pjz commented Jul 31, 2015

All but the last checkbox there is done in #481 now.

@pjz
Copy link
Contributor

pjz commented Aug 2, 2015

...and now that's done too. With more to come!

@pjz
Copy link
Contributor

pjz commented Aug 3, 2015

Simplates are mostly factored out now. Happy vacation!

@chadwhitacre
Copy link
Contributor Author

😲

@pjz
Copy link
Contributor

pjz commented Aug 10, 2015

Once the current PR has landed, the next piece will be to actually factor them out into a separate repo with packaging, docs, etc. And also change all the aspen renderer modules into simplate renderer modules. So if someone wants pystache support they'll have to install aspen and simplates-pystache.

It would also be cool to have adapters like maybe flask-simplates or django-simplates, if there's glue code there that could be factored out.

@chadwhitacre
Copy link
Contributor Author

It would also be cool to have adapters like maybe flask-simplates or django-simplates

Yes! Ideally we can generate enough interest amongst the Flask and Django communities that those shims will get written by third parties.

@chadwhitacre
Copy link
Contributor Author

What's our plan for other languages besides Python? Currently our application/simplate proto-specification doesn't allow for explicating the language of the first and second sections.

@chadwhitacre
Copy link
Contributor Author

Let's use https://github.com/gratipay/simplates.org/issues to manage the "factoring out" part.

@chadwhitacre chadwhitacre changed the title factor out and promote simplates factor out simplates Aug 10, 2015
@chadwhitacre
Copy link
Contributor Author

The scope of the simplates.org repo is:

  • the application/simplate specification
  • linking to implementations and tooling
  • marketing in general

The Python library we factor out should land at https://github.com/gratipay/simplates.py and be linked on simplates.org as the reference implementation.

@chadwhitacre
Copy link
Contributor Author

Obvious solution would be a shebang at the top:

#!python
[---]
[---] text/html
Greetings, program!

@pjz mentions this on #474.

@Changaco
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants