GithubHelp home page GithubHelp logo

pagerenderer's Introduction

Folding @ home Page Renderer

This application takes the translations from FoldingCommunity/Translate and injects them into templates to render out HTML pages for all the languages we are supporting.

It is part of a larger system (currently in construction), which will semi-automate the updating of the Folding @ home website.

Usage

  1. Make sure you initialized and updated the submodules

    $ git submodules init
    $ git submodules update
    

    This will make sure that you have the latest version of all the translations and templates.

  2. Just run the rendering script and it will dump the rendered pages into output/:

    $ python3 render.py
    

Next Steps

This application is currently in a very early stage. There are lots of things to improve:

Check out the open issues to find out more.

pagerenderer's People

Contributors

tar-minyatur avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

delizald

pagerenderer's Issues

Page rendering fails if translation file contains certain empty header tags

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.

Use a proper templating engine/library

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.

Add tests

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.

Use a proper Markdown renderer

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.

Create proper templates for all pages (in a separate repository?)

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.