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

Give more data to renderers #415

Merged
merged 3 commits into from
Feb 16, 2015
Merged

Give more data to renderers #415

merged 3 commits into from
Feb 16, 2015

Conversation

Changaco
Copy link
Member

@Changaco Changaco commented Feb 7, 2015

Currently renderers only get the path of the simplate (filepath) and the content of the page (raw). It would be useful if they also got the content type (so they can determine the appropriate escaping rules for example, cf AspenWeb/aspen.py-plugins#9) and the position of the page in the simplate (so error messages can use the correct line numbers).

This PR makes the offset and media_type variables accessible to renderers.

@pjz
Copy link
Contributor

pjz commented Feb 7, 2015

Good idea. Needs tests, doc changes (if any), maybe examples.

@Changaco Changaco force-pushed the renderers-more-data branch 2 times, most recently from 95a31ce to 81689fd Compare February 14, 2015 13:09
@Changaco Changaco force-pushed the renderers-more-data branch from 81689fd to a92137e Compare February 15, 2015 09:40
@Changaco Changaco force-pushed the renderers-more-data branch from a92137e to 9c9fb67 Compare February 15, 2015 09:44
@Changaco
Copy link
Member Author

I've updated the docstrings and added a basic test of a custom renderer. Back to you @pjz.

@pjz
Copy link
Contributor

pjz commented Feb 16, 2015

Am I missing where this tests the added 'renderer-knows-media-type' functionality?

@Changaco
Copy link
Member Author

@pjz It's not very straightforward I guess, but it's there.

pjz added a commit that referenced this pull request Feb 16, 2015
@pjz pjz merged commit bd0934f into master Feb 16, 2015
@Changaco Changaco deleted the renderers-more-data branch February 18, 2015 11:46
Changaco pushed a commit that referenced this pull request Mar 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants