bbc / alephant-renderer Goto Github PK
View Code? Open in Web Editor NEWRender HTML snippets inside Alephant
License: MIT License
Render HTML snippets inside Alephant
License: MIT License
The example shows...
data = {
:summary => 'Light rain starting tonight.',
:temp => '11.86'
}.to_json
But this throws the following error...
/Users/markmcdonnell/.gem/ruby/2.0.0/gems/hashie-3.3.1/lib/hashie/mash.rb:177:in `deep_update': undefined method `each_pair' for "{\"summary\":\"Light rain starting tonight.\",\"temp\":\"11.86\"}":String (NoMethodError)
I was able to get the example to work by not converting data
to JSON
We would like the English translation returned when no translation exists. So 'another_party_6' would be returned if it is not found.
cc @stevenjack and @tnyuan
It looks like we raise an exception but then never catch it anywhere?
@base_path = File.directory?(path) ? path : (raise "Invalid path: '#{path}'")
https://github.com/BBC-News/alephant-renderer/blob/master/lib/alephant/renderer/view_mapper.rb#L20
I've looked inside both Alphant-Publisher-Queue and Alphant-Publisher-Request but neither appear to catch it.
Currently this gem returns an array of components (Views) when Alephant::Renderer::Renderer.views
is called.
You then have to call #render
on a specific view to render the content, for example (taken from alephant-publisher-request):
Alephant::Renderer.create(config, data).views[component_id].render
Do we not want the templates to be rendered ahead of time?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.