From b0d917dd4c108e8896677b3322d87a68247dc3a7 Mon Sep 17 00:00:00 2001 From: Danilo Prates Date: Thu, 29 Sep 2016 08:37:02 -0300 Subject: [PATCH] Removes mixed space and tab. Includes the project name to the HTML title. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - The HTML templates are mixing spaces and tabs, leaving to a broken indentation. I’ve added a .editorconfig file and removed spaces on the templates. - Added the Project title to the HTML templates --- .editorconfig | 19 +++++++++++++++++++ generator/generator.js | 3 +++ generator/templates/index-bundle.html | 20 ++++++++++---------- generator/templates/index.html | 20 ++++++++++---------- 4 files changed, 42 insertions(+), 20 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..b8ecd8c --- /dev/null +++ b/.editorconfig @@ -0,0 +1,19 @@ +# EditorConfig is awesome: http://EditorConfig.org + +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +end_of_line = lf +insert_final_newline = true + +# HTML +[*.html] +indent_style = tab +indent_size = 2 + +# HTML +[*.js] +indent_style = tab +indent_size = 2 diff --git a/generator/generator.js b/generator/generator.js index 5a48c86..18f2dd6 100644 --- a/generator/generator.js +++ b/generator/generator.js @@ -29,6 +29,9 @@ var generator = { }, project: function(project, opt) { + templates.indexhtml = templates.indexhtml.replace('{{project-title}}', project); + templates.indexhtmlb = templates.indexhtmlb.replace('{{project-title}}', project); + mkdir(project, function() { if(opt.bundle) { createLibraries(project) diff --git a/generator/templates/index-bundle.html b/generator/templates/index-bundle.html index d1728d6..df02bac 100644 --- a/generator/templates/index-bundle.html +++ b/generator/templates/index-bundle.html @@ -2,10 +2,10 @@ - - + + - New p5 Project + {{project-title}} @@ -14,13 +14,13 @@ diff --git a/generator/templates/index.html b/generator/templates/index.html index 5b0a0e2..a8c8a42 100644 --- a/generator/templates/index.html +++ b/generator/templates/index.html @@ -2,10 +2,10 @@ - - + + - New p5 Project + {{project-title}} @@ -14,13 +14,13 @@