From f6f99c41dbd86f85ce816ea8d388e44e04aed6cc Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Sat, 27 Oct 2012 16:34:13 +0530 Subject: modified: .bzrignore conversion/ConvertDirectory.java (bug-fix) It is checked whether file "index" is modified since the last conversion. This check was not performed before. conversion/ConvertFile.java Some optimization there. Now we check if the file content is "empty" before we delve into conversion. index/IndexCreator.java # "index" file is created in the directory, if it is not created. # write() renamed to shouldConvert(). The method now returns true when a link is added to 'index' or when the index.html file does not exists. io/ReadFile.java # Exception message for made verbose. todo --- io/ReadFile.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'io') diff --git a/io/ReadFile.java b/io/ReadFile.java index beccdc3..2607b16 100644 --- a/io/ReadFile.java +++ b/io/ReadFile.java @@ -44,7 +44,7 @@ public class ReadFile { new FileReader(file)); }catch(FileNotFoundException e) { throw new RuntimeException("Unable to open file :" - +file.getName()); + +file.getAbsolutePath()); } String line; StringBuilder sbuilder = new StringBuilder(); -- cgit v1.2.3 From 1f61844084d9e9383b3be04ff8f60c11eb628075 Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Wed, 31 Oct 2012 22:00:35 +0530 Subject: modified: conversion/ConvertDirectory.java (minor edit) index/IndexCreator.java (removed code which (1) creates a index file, if it is not present (2) checks for the existence of index.html) io/WriteFile.java (made the stdout message more verbose) parsers/Header.java ('scruf' footer links to scruf's project page) todo (1 task completed) --- io/WriteFile.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'io') 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. -- cgit v1.2.3 From e1804b3d0ef3be3db8be169043c6eae8a98bbc86 Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Wed, 31 Oct 2012 23:32:29 +0530 Subject: added: status/ status/DirectoryInfo.java (record the directory 'level' at which scruf is parsing with respect to 'root' directory.) modified: Scruf.java (added a line to start the directory level count at zero) conversion/ConvertDirectory.java (DirectoryInfo.level used to take count of directory 'leve') conversion/ConvertFile.java (lines related to 'footer' things were removed) io/PresentFile.java ( 'footer' & 'backButton' field removed) parsers/BackButton.java (back button placement happens in the parse method itself, instead of doing it in Header.java) (back button is not placed, if the present directory is root directory) parsers/Footer.java (footer placement happens in the parse method itself, instead of doing it in Header.java) parsers/Header.java (back button placement & footer placement removed.) --- io/PresentFile.java | 2 -- 1 file changed, 2 deletions(-) (limited to 'io') diff --git a/io/PresentFile.java b/io/PresentFile.java index 14ca7b5..9a3deaa 100644 --- a/io/PresentFile.java +++ b/io/PresentFile.java @@ -30,8 +30,6 @@ import java.io.*; */ public class PresentFile { public static String name; - public static String footer; - public static String backButton; public static File file; } -- cgit v1.2.3 From ceed73fa063ffb3b72d21c8a8800122c115acc58 Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Sat, 10 Nov 2012 11:29:31 +0530 Subject: marked-up files should have a '.scruffy' extension from now on. This commit is an un-stable commit. It has bugs. removed: io/PresentFile.java (moved to status/PresentFile.java) added: conversion/CreateHtmlFile.java (creates a corresponding '.html' file for a given '.scruffy' marked-up file) (needs some fine-tuning) status/PresentFile.java (see above) modified: conversion/ConvertFile.java (CreatHtmlFile object takes care of producing a corresponding html 'File') conversion/FileSieve.java (regex modified to reflect the '.scruffy' extension) index/IndexCreator.java (edits to reflect the '.scruffy' extension) parsers/BackButton.java (edit to reflect the '.scruffy' extension) parsers/DocumentName.java (edit to reflect the package change for PresentFile class) parsers/Header.java (edit to reflect the package change for PresentFile class) todo (updated todo) --- io/PresentFile.java | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 io/PresentFile.java (limited to 'io') diff --git a/io/PresentFile.java b/io/PresentFile.java deleted file mode 100644 index 9a3deaa..0000000 --- a/io/PresentFile.java +++ /dev/null @@ -1,37 +0,0 @@ -/*+ - * Copyright 2012 rsiddharth - * Email: - * - * This file is part of Scruf. - * - * Scruf is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - - -package scruf.io; - -import java.io.*; - -/** - * Contains information about the present file that - * is being parsed by the parsers. - * - */ -public class PresentFile { - public static String name; - public static File file; -} - - - -- cgit v1.2.3