foldingcommunity / pagerenderer Goto Github PK
View Code? Open in Web Editor NEWComponent to render pages from templates and translation files.
Component to render pages from templates and translation files.
Once it has been built, this rendering component needs to be integrated with the interface component that will push the rendered pages to Wordpress.
Looks like some PO file editors insert additional header tags that raise the expectation that a date value is included there. The Babel library used to parse the PO files sees these missing values as error and throws an exception.
I didn't look into it very closely yet, but it can easily be seen if you run the render.py
right now. It prints:
Rendering templates\together-we-are-powerful.php
...
โ Failed to generate for es-MX: time data '' does not match format '%Y-%m-%d %H:%M'
A quick look at the relevant PO file shows that there are header entries called POT-Creation-Date
and PO-Revision-Date
, which are not present in the other translation files.
At the moment a very simple fake rendering function is taking care of replacing the inline markdown with proper HTML.
I originally tried to use markdown,markdown()
to do this, but couldn't find an easy way of preventing the insertion of HTML tags as wrapper around the entire string.
At the moment the placeholders in the template are {{{ mustache }}}
style, but I created a very simple and stupid helper function to take care of replacing them with the actual values.
I started out using chevron.render()
to do this, but unfortunately Mustache considers dots (.
) in keys to be an indicator for a nested scope. As we have full paragraphs in our keys, this doesn't work. Another issue was that chevron
does not support defining a fallback if a key is missing and just replaces it with an empty string, which I believe we do not want.
There is absolutely no test coverage right now. We should have at least some basic unit tests and maybe a few component tests to make sure this thing won't randomly break once we start rely on it.
To get started I just created two very basic templates that have nothing to do with how the corresponding pages actually look like.
We need to create proper templates for all the pages.
I would also recommend to place those templates in a separate repository and not to have them in here. They could be imported here via a git submodule.
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.