Chromium Code Reviews| Index: chrome/common/extensions/docs/server2/template_utility.py |
| diff --git a/chrome/common/extensions/docs/server2/template_utility.py b/chrome/common/extensions/docs/server2/template_utility.py |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a9ff1fbec8cc43fa1719dde4136ee24850432e51 |
| --- /dev/null |
| +++ b/chrome/common/extensions/docs/server2/template_utility.py |
| @@ -0,0 +1,13 @@ |
| +# Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
| +import json |
| + |
| +from third_party.handlebar import Handlebar |
| + |
| +class TemplateUtility(object): |
| + def RenderTemplate(self, json_str, content): |
|
Aaron Boodman
2012/06/02 07:50:22
Nit: It would be more intuitive to me if the templ
cduvall
2012/06/02 19:12:05
Done.
|
| + template = Handlebar(content) |
| + content = template.render(json.loads(json_str), {'templates': []}).text |
| + return content |