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
Add Budou custom filter #293
Comments
I made a custom filter to apply Budou in my personal website. from jinja2 import Markup, contextfilter
from jinja2.ext import Extension
import jinja2
budou_parser = budou.authenticate('budou-cloud.json')
@contextfilter
def do_budou(context, value):
doc = context.get('doc')
if doc.locale == 'ja':
data = budou_parser.parse(value)
return Markup(data['html_code'])
else:
return value
class Wordwrap(Extension):
def __init__(self, environment):
super(Wordwrap, self).__init__(environment)
environment.filters['budou'] = do_budou @jeremydw |
@jeremydw Just a friendly ping to see if there's any update on this topic :) I'd love to commit once the structure is envisioned, so please let me know if there's anything I can help. |
Thanks for the nudge. :) We actually rolled this out on a project
successfully recently. I will update this thread with our plan when I get a
chance!
…On Thu, Feb 9, 2017 at 11:52 PM, Shuhei Iitsuka ***@***.***> wrote:
@jeremydw <https://github.com/jeremydw> Just a friendly ping to see if
there's any update on this topic :) I'd love to commit once the structure
is envisioned, so please let me know if there's anything I can help.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#293 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAndfYc3qc28tDROyOIxGbAyJkxjv6kxks5rbBcwgaJpZM4J7YXx>
.
--
jeremydw
|
Great to hear that! Thanks, looking forward to hearing the update. |
I just wanted to check if there's any update :) Please let me know if there's anything I can help! |
Sorry for dropping the ball on this! Now that we're working on simplifying extension management via Some more work needs to be done for this to work entirely with |
Acknowledged! Thank you for letting me know.
2017年6月17日(土) 4:55 Jeremy Weinstein <notifications@github.com>:
… Sorry for dropping the ball on this! Now that we're working on simplifying
extension management via grow install, we're separating out extensions
into their own repositories. I started an initial commit for a Budou
extension right here - https://github.com/grow/grow-ext-budou
Some more work needs to be done for this to work entirely with grow
install – PRs incoming.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#293 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAs2uVdV5h9h-gkW7Pwp2xMrxYnihuPgks5sEt21gaJpZM4J7YXx>
.
|
Almost done! We've added tests to verify the behavior and quick README. Feel free to look over the extension and let me know if you'd like any improvements or suggestions to the system! https://github.com/grow/grow-ext-budou Now Grow users can use budou by simply changing We need to integrate #457 and make another grow release before this works with the frozen version of Grow, but it should work as-is with the |
Also - the example data in that repository shows off a sample integration: |
Thank you Jeremy for working on this! It worked like a charm :)
Recently, Cloud NL API and Budou started to support Chinese and Korean as
well, so perhaps we can add these supports as well. I believe it's just
adding 'zh' and 'ko' in SUPPORTED_LANGUAGES.
https://cloud.google.com/natural-language/docs/languages
Thanks,
Shuhei
2017年6月26日(月) 13:58 Jeremy Weinstein <notifications@github.com>:
… Also - the example data in that repository shows off a sample integration:
https://github.com/grow/grow-ext-budou/tree/master/example
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#293 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAs2uXZvDmQp1pwj38UepZ2BHh8LSS1pks5sHzpygaJpZM4J7YXx>
.
|
At long last we can now close this issue out, as Grow |
It would be great if we can add Budou as a custom filter in order to provide organized line breaks for CJK websites. Budou is a simple python script, so migration should go smoothly.
https://github.com/google/budou
Perhaps it's better to add caching functionality to Budou before we proceed to the migration.
The text was updated successfully, but these errors were encountered: