Skip to content

Commit

Permalink
Add solution.html files
Browse files Browse the repository at this point in the history
  • Loading branch information
mjackson committed Apr 10, 2015
1 parent 94ca6e2 commit cdbaac0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
subjects/index.html
subjects/**/index.html
subjects/**/solution.html
subjects/**/lecture.html
7 changes: 6 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var fs = require('fs');
var fileExists = fs.existsSync;
var mkdirp = require('mkdirp');
var path = require('path');
var webpack = require('webpack');
Expand All @@ -17,7 +18,10 @@ module.exports = {
devtool: 'eval',

entry: DIRS.reduce(function (entries, dir) {
entries[dir+'-exercise'] = path.join(CODE, dir, 'exercise.js');
if (fileExists(path.join(CODE, dir, 'exercise.js')))
entries[dir+'-exercise'] = path.join(CODE, dir, 'exercise.js');
if (fileExists(path.join(CODE, dir, 'solution.js')))
entries[dir+'-solution'] = path.join(CODE, dir, 'solution.js');
entries[dir+'-lecture'] = path.join(CODE, dir, 'lecture.js');
return entries;
}, {}),
Expand Down Expand Up @@ -57,6 +61,7 @@ function makeIndex() {

DIRS.forEach(function (dir) {
fs.writeFileSync('./subjects/'+dir+'/index.html', makeMarkup(dir+'-exercise'));
fs.writeFileSync('./subjects/'+dir+'/solution.html', makeMarkup(dir+'-solution'));
fs.writeFileSync('./subjects/'+dir+'/lecture.html', makeMarkup(dir+'-lecture'));
});
}
Expand Down

0 comments on commit cdbaac0

Please sign in to comment.