Skip to content

Commit

Permalink
Merge pull request #2 from CyberAgentGameEntertainment/feature/tuning…
Browse files Browse the repository at this point in the history
…_bible

Add Articles
  • Loading branch information
iida-takuya-ca authored Aug 15, 2022
2 parents 6a0341f + e83fcf9 commit d7b089f
Show file tree
Hide file tree
Showing 389 changed files with 24,223 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
node_modules/
Gemfile.lock
.sass-cache/

articles/*.pdf
articles/*.epub
articles/*.html
# articles/*.md
articles/*.xml
articles/*.txt

.DS_Store
Binary file added Documentation/bible_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# A sample Gemfile
source "https://rubygems.org"

gem 'review', '5.3.0'
gem 'pandoc2review'
gem 'rake'
# gem 'review-peg', '0.2.2'
179 changes: 179 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
"use strict";

let fs = require("fs");
let yaml = require("js-yaml");

const articles = "articles";
const bookConfig = yaml.safeLoad(fs.readFileSync(`${articles}/config.yml`, "utf8"));

const reviewPrefix = process.env["REVIEW_PREFIX"] || "bundle exec ";
const reviewPostfix = process.env["REVIEW_POSTFIX"] || ""; // REVIEW_POSTFIX="-peg" npm run pdf とかするとPEGでビルドできるよ
const reviewConfig = process.env["REVIEW_CONFIG_FILE"] || "config.yml"; // REVIEW_CONFIG_FILE="config-ebook.yml" npm run pdf のようにすると別のconfigでビルドできるよ
const reviewPreproc = `${reviewPrefix}review-preproc${reviewPostfix}`;
const reviewCompile = `${reviewPrefix}review-compile${reviewPostfix}`;
const reviewPdfMaker = `${reviewPrefix}rake pdf ${reviewPostfix}`;
const reviewEpubMaker = `${reviewPrefix}rake epub ${reviewPostfix}`;
const reviewWebMaker = `${reviewPrefix}rake web ${reviewPostfix}`;
const reviewTextMaker = `${reviewPrefix}rake text ${reviewPostfix}`;
const reviewIDGXMLMaker = `${reviewPrefix}rake idgxml ${reviewPostfix}`;
const reviewVivliostyle = `${reviewPrefix}rake vivliostyle ${reviewPostfix}`;

module.exports = grunt => {
grunt.initConfig({
clean: {
review: {
src: [
`${articles}/${bookConfig.bookname}-*/`, // pdf, epub temp dir
`${articles}/*.pdf`,
`${articles}/*.epub`,
`${articles}/*.html`,
`${articles}/*.md`,
`${articles}/*.xml`,
`${articles}/*.txt`,
`${articles}/webroot`
]
}
},
shell: {
preprocess: {
options: {
execOptions: {
cwd: articles,
}
},
command: `${reviewPreproc} -r --tabwidth=2 **/*.re`
},
compile2text: {
options: {
execOptions: {
cwd: articles,
}
},
command: `${reviewTextMaker}`
},
compile2markdown: {
options: {
execOptions: {
cwd: articles,
}
},
command: `${reviewCompile} --target=markdown`
},
compile2html: {
options: {
execOptions: {
cwd: articles,
}
},
command: `${reviewCompile} --target=html --stylesheet=style.css --chapterlink`
},
compile2latex: {
options: {
execOptions: {
cwd: articles,
}
},
command: `${reviewCompile} --target=latex --footnotetext`
},
compile2idgxml: {
options: {
execOptions: {
cwd: articles,
}
},
command: `${reviewCompile} --target=idgxml`
},
compile2pdf: {
options: {
execOptions: {
cwd: articles,
}
},
command: `${reviewPdfMaker}`
},
compile2epub: {
options: {
execOptions: {
cwd: articles,
}
},
command: `${reviewEpubMaker}`
},
compile2web: {
options: {
execOptions: {
cwd: articles,
}
},
command: `${reviewWebMaker}`
},
compile2idgxmlmaker: {
options: {
execOptions: {
cwd: articles,
}
},
command: `${reviewIDGXMLMaker}`
},
compile2vivliostyle: {
options: {
execOptions: {
cwd: articles,
}
},
command: `${reviewVivliostyle}`
}
}
});

function generateTask(target) {
return ["clean", "shell:preprocess", `shell:compile2${target}`];
}

grunt.registerTask(
"default",
"原稿をコンパイルしてPDFファイルにする",
"pdf");

grunt.registerTask(
"text",
"原稿をコンパイルしてTextファイルにする",
generateTask("text"));

grunt.registerTask(
"markdown",
"原稿をコンパイルしてMarkdownファイルにする",
generateTask("markdown"));

grunt.registerTask(
"html",
"原稿をコンパイルしてHTMLファイルにする",
generateTask("html"));

grunt.registerTask(
"idgxmlmaker",
"原稿をコンパイルしてInDesign用XMLファイルにする",
generateTask("idgxmlmaker"));

grunt.registerTask(
"pdf",
"原稿をコンパイルしてLaTeXでpdfファイルにする",
generateTask("pdf"));

grunt.registerTask(
"epub",
"原稿をコンパイルしてepubファイルにする",
generateTask("epub"));

grunt.registerTask(
"web",
"原稿をコンパイルしてWebページファイルにする",
generateTask("web"));

grunt.registerTask(
"vivliostyle",
"原稿をコンパイルしてVivliostyle-CLIでpdfファイルにする",
generateTask("vivliostyle"));

require('load-grunt-tasks')(grunt);
};
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
# UnityPerformanceTuningBible
<p align="center">
<img width=350 src="Documentation/bible_logo.png" alt="UnityPerformanceTuningBible">
</p>

# Unity Performance Tuning Bible
本書はUnityのパフォーマンスチューニングに関するノウハウを体系的にまとめた書籍です。
本リポジトリから電子書籍をPDFとしてダウンロードすることができます。

ご意見、ご指摘は [Issues](https://github.com/CyberAgentGameEntertainment/UnityPerformanceTuningBible/issues)[Pull Requests](https://github.com/CyberAgentGameEntertainment/UnityPerformanceTuningBible/pulls) からお願いいたします。

## 電子書籍のダウンロード方法
1. [Releasesの最新版](https://github.com/CyberAgentGameEntertainment/UnityPerformanceTuningBible/releases/latest)へ遷移します。

2. AssetsからPDFをダウンロードします。

## Copyright
(C) 2022 CyberAgent, Inc.
Loading

0 comments on commit d7b089f

Please sign in to comment.