summaryrefslogtreecommitdiff
path: root/src/web/docs/api/gulpfile.ts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-12-17 14:35:30 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-12-17 14:35:30 +0900
commitd4fb399c95c65e4a6805e02074b8e5cc754a3822 (patch)
tree4901d6b8828aada8275feb4787fcede57eb0bd27 /src/web/docs/api/gulpfile.ts
parentUpdate api.ja.pug (diff)
downloadsharkey-d4fb399c95c65e4a6805e02074b8e5cc754a3822.tar.gz
sharkey-d4fb399c95c65e4a6805e02074b8e5cc754a3822.tar.bz2
sharkey-d4fb399c95c65e4a6805e02074b8e5cc754a3822.zip
なんかもうめっちゃ変えた
Diffstat (limited to 'src/web/docs/api/gulpfile.ts')
-rw-r--r--src/web/docs/api/gulpfile.ts11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/web/docs/api/gulpfile.ts b/src/web/docs/api/gulpfile.ts
index 2e8409c595..4c30871a0f 100644
--- a/src/web/docs/api/gulpfile.ts
+++ b/src/web/docs/api/gulpfile.ts
@@ -10,13 +10,16 @@ import * as pug from 'pug';
import * as yaml from 'js-yaml';
import * as mkdirp from 'mkdirp';
+import locales from '../../../../locales';
+import I18nReplacer from '../../../common/build/i18n';
+import fa from '../../../common/build/fa';
import config from './../../../conf';
import generateVars from '../vars';
const commonVars = generateVars();
-const langs = Object.keys(commonVars.i18n);
+const langs = Object.keys(locales);
const kebab = string => string.replace(/([a-z])([A-Z])/g, '$1-$2').replace(/\s+/g, '-').toLowerCase();
@@ -124,6 +127,9 @@ gulp.task('doc:api:endpoints', () => {
console.error(renderErr);
return;
}
+ const i18n = new I18nReplacer(lang);
+ html = html.replace(i18n.pattern, i18n.replacement);
+ html = fa(html);
const htmlPath = `./built/web/docs/${lang}/api/endpoints/${ep.endpoint}.html`;
mkdirp(path.dirname(htmlPath), (mkdirErr) => {
if (mkdirErr) {
@@ -164,6 +170,9 @@ gulp.task('doc:api:entities', () => {
console.error(renderErr);
return;
}
+ const i18n = new I18nReplacer(lang);
+ html = html.replace(i18n.pattern, i18n.replacement);
+ html = fa(html);
const htmlPath = `./built/web/docs/${lang}/api/entities/${kebab(entity.name)}.html`;
mkdirp(path.dirname(htmlPath), (mkdirErr) => {
if (mkdirErr) {