fune/browser/components/loop/standalone/grunttasks/marked.js
Rémy HUBSCHER fb4ec1d1e7 Bug 1044411 - Generate Loop ToS static content, r=abr,dmose; rs=ted for .hgignore changes
Bug 1044411 - Generate Loop ToS static content, priv-policy bits removed
2014-08-26 12:58:00 -05:00

36 lines
935 B
JavaScript

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
var path = require('path');
var i18n = require('i18n-abide');
module.exports = function (grunt) {
'use strict';
// convert localized TOS agreement from markdown to html partials.
function rename(destPath, srcFile) {
// Normalize the filenames to use the locale name.
var lang = srcFile.replace('.md', '');
return path.join(destPath, i18n.localeFrom(lang) + '.html');
}
grunt.config('marked', {
options: {
sanitize: false,
gfm: true
},
tos: {
files: [
{
expand: true,
cwd: '<%= project_vars.tos_md_src %>',
src: ['**/*.md'],
dest: '<%= project_vars.tos_html_dest %>',
rename: rename
}
]
}
});
};