diff options
-rw-r--r-- | .gitignore (renamed from .bzrignore) | 0 | ||||
-rw-r--r-- | etc/TODO | 66 | ||||
-rw-r--r-- | license/gpl | 2 | ||||
-rw-r--r-- | parsers/ParserList.java | 3 | ||||
-rw-r--r-- | parsers/UList.java | 69 | ||||
-rw-r--r-- | styling/style.css | 13 |
6 files changed, 94 insertions, 59 deletions
@@ -1,60 +1,12 @@ SCRUF - TODO -*- mode: org; -*- * features -** proper semantic -** use markdownj for text to html5 conversion - that necessarily means scruffy markup will be done away with. -** page format options -- stream, singleton, -** build system (ant system) - -* distribution related -** NEWS file - should contain information about new releases and features(if - needed). -** HISTORY file - not required for 0.1.0 release. -** FAQ file - not required for 0.1.0 release. -* website -* finished todos - -** [done] ignore directories - way to ignore directories - -** [done] move PresentFile.java to status/ - -** [done] extension for scruffy files - extension for scruff marked-up files to make discovery easier. - -** [done] modify conversion/CanConvert.java (bug) - -** [done] link to scruffy source - include a link or something to view the 'source'. - -** [done] 'quote' special symbols inside a code-block. -** [done] 'last update' string - the 'last updated' string must be dangled somewhere in the document - that is licked by scruf. - -** [done] <meta> tags - introduce 'meta' info in html doc generated -- authorinfo. - -** [done] mailing list -** [done] build rsiddharth's weblog - Test it by generating rsiddharth's weblog using scruf. -** [done] manual - the manual file should also be part of the source distribution. -** [done] README file - a brief description of the project; pointer to website; notes on - the platform; a roadmap to important files; installation info - file; info about author; - -** [done] create a documentation section in the homepage. - -** [done] create a mailing list section in the homepage -** [hp] documentation - - introduction to 'scruf' & 'scruffy' mark-up. finished the initial - draft. It need to be edited and fine tuned. - - +** one stylesheet for a directory and all its subdirectory. + At present, each directory, irrespective of whether it is a + subdirectory or not, has one stylesheet. This is just bad design. +** bzr -> git + I might want to switch the vcs to git. This is not going to happen + any time soon, though. + +* documentation +** list mark up should be documented. diff --git a/license/gpl b/license/gpl index 48a3e5a..0204948 100644 --- a/license/gpl +++ b/license/gpl @@ -1,6 +1,6 @@ /*+ * Copyright 2012, 2013 rsiddharth <rsiddharth@ninthfloor.org> - * + * * This file is part of Scruf. * * Scruf is free software: you can redistribute it and/or modify diff --git a/parsers/ParserList.java b/parsers/ParserList.java index b155329..0ef5022 100644 --- a/parsers/ParserList.java +++ b/parsers/ParserList.java @@ -33,7 +33,8 @@ public class ParserList { parsers.add(new DocumentDate()); parsers.add(new WordDecoration()); parsers.add(new Headings()); - parsers.add(new Links()); + parsers.add(new Links()); + parsers.add(new UList()); parsers.add(new Images()); parsers.add(new Audio()); parsers.add(new Footer()); diff --git a/parsers/UList.java b/parsers/UList.java new file mode 100644 index 0000000..6d55954 --- /dev/null +++ b/parsers/UList.java @@ -0,0 +1,69 @@ +/*+ + * Copyright 2012, 2013 rsiddharth <rsiddharth@ninthfloor.org> + * + * 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 <http://www.gnu.org/licenses/>. + */ + + +package scruf.parsers; + +import java.util.regex.Pattern; +import java.util.regex.Matcher; + +public class UList implements Parser { + private Pattern pattern = Pattern.compile("^\\*\\*( )+((.+$\\n)+)",Pattern.MULTILINE); + private String list = "<li>\n$1$2</li>"; + /** + * This htmlTagPattern has a regex to deduct a html tag. + */ + private Pattern htmlTagPattern = Pattern.compile("^\\<.+?\\>(\\n?)"); + private Matcher matcher; + private Matcher htmlTag; + public String parse(String fileContent) { + StringBuffer sbuffer = new StringBuffer(); + matcher = pattern.matcher(fileContent); + + int lastEnd=0; + while(matcher.find()) { + int diff = matcher.start() - lastEnd; + + if(lastEnd == 0) { + // first list found + matcher.appendReplacement(sbuffer, "<ul>\n " + list); + } + else if(diff>1) { + // means, we are at a new list now. + // so, got close the ol' one. + sbuffer.append("\n</ul>\n"); + + // open the new list. + matcher.appendReplacement(sbuffer, "<ul>\n " + list); + } + else { + matcher.appendReplacement(sbuffer, list); + } + lastEnd = matcher.end(); + + } + // close the last found list + if(lastEnd !=0) // meaning a list was found. + sbuffer.append("\n</ul>\n"); + matcher.appendTail(sbuffer); + + return sbuffer.toString(); + } + +} diff --git a/styling/style.css b/styling/style.css index ffe1ba2..efe1e4b 100644 --- a/styling/style.css +++ b/styling/style.css @@ -82,6 +82,19 @@ pre { width:70%; } +ul { + margin-left:auto; + margin-right:auto; + border: 1px; + padding:5px; + width:70%; + text-align:justify; + line-height:170%; + list-style: square; + list-style-position: inside; +} + + div.time { font-size:0.50em; font-family:"Palatino Linotype","Book Antiqua",Palatino,"URW Palladio L",FreeSerif,serif; |