diff options
-rw-r--r-- | conversion/ConvertDirectory.java | 1 | ||||
-rw-r--r-- | index/IndexCreator.java | 19 | ||||
-rw-r--r-- | io/WriteFile.java | 2 | ||||
-rw-r--r-- | parsers/Header.java | 2 | ||||
-rw-r--r-- | todo | 3 |
5 files changed, 4 insertions, 23 deletions
diff --git a/conversion/ConvertDirectory.java b/conversion/ConvertDirectory.java index 3b70a71..3dbb8eb 100644 --- a/conversion/ConvertDirectory.java +++ b/conversion/ConvertDirectory.java @@ -54,7 +54,6 @@ public class ConvertDirectory { this.convert(file); } } - boolean convertIndex = (index.shouldConvert() || canConvert.check(index.indexFile())); if(convertIndex) diff --git a/index/IndexCreator.java b/index/IndexCreator.java index f86f03a..ef683f7 100644 --- a/index/IndexCreator.java +++ b/index/IndexCreator.java @@ -39,13 +39,6 @@ public class IndexCreator { if(index.exists()) { indexContent.append(new ReadFile(index). getContent()); - }else { - try { - index.createNewFile(); - }catch(IOException e) { - throw new RuntimeException("Unable to create file: "+ - index.getAbsolutePath(),e); - } } } public void add(File file) { @@ -61,19 +54,9 @@ public class IndexCreator { } } public boolean shouldConvert() { - // we assume that index.html exists. - boolean indexHTMLExists=true; if(modified) new WriteFile(index,indexContent.toString()).write(); - // Check for this existence of index.html. - if(!(new File(directory,"index.html").exists())) { - indexHTMLExists=false; - } - /** - * returns true either when 'index' is modified or - * when index.html does not exists. - */ - return (modified || !indexHTMLExists); + return (modified); } public File indexFile() { return index; diff --git a/io/WriteFile.java b/io/WriteFile.java index d19bb72..0a2a1e7 100644 --- a/io/WriteFile.java +++ b/io/WriteFile.java @@ -32,7 +32,7 @@ public class WriteFile { } public void write() { try { - System.out.println("Writing..."+outputFile.getName()); + System.out.println("Writing..."+outputFile.getAbsolutePath()); BufferedWriter bwriter = new BufferedWriter (new FileWriter(outputFile)); // write content to file. diff --git a/parsers/Header.java b/parsers/Header.java index eebec5d..5cf2c55 100644 --- a/parsers/Header.java +++ b/parsers/Header.java @@ -55,7 +55,7 @@ public class Header implements Parser { sbuilder.append("</article>\n"); // add "powered by scruf" at bottom of page. sbuilder.append("\n<div class=\"scruf\">\n"); - sbuilder.append("<a href=\"/scruf/\">powered by scruf</a>"); + sbuilder.append("<a href=\"https://savannah.nongnu.org/projects/scruf/\">powered by scruf</a>"); sbuilder.append("\n</div>\n"); // Close body tag sbuilder.append("\n</body>\n"); @@ -1,5 +1,4 @@ -# IndexCreator must be modified -- the existence of indexHtml can be - checked using CanConvert object. +# the root page (of a site) should not have a ''home'' or ''back'' button. # Test it by generating your _full_ homepage using scruf. |