summaryrefslogtreecommitdiff
path: root/2005/d/dev/todo
diff options
context:
space:
mode:
Diffstat (limited to '2005/d/dev/todo')
-rw-r--r--2005/d/dev/todo/tasklist.css9
-rw-r--r--2005/d/dev/todo/tasklist.dtd3
-rwxr-xr-x2005/d/dev/todo/tasklist.pl16
-rw-r--r--2005/d/dev/todo/tasklist.xsl6
4 files changed, 30 insertions, 4 deletions
diff --git a/2005/d/dev/todo/tasklist.css b/2005/d/dev/todo/tasklist.css
index 5fdb706..9a4d284 100644
--- a/2005/d/dev/todo/tasklist.css
+++ b/2005/d/dev/todo/tasklist.css
@@ -50,12 +50,19 @@ div.subtask {
/* border: 1px solid black; */
}
-div.desc {
+div.desc, div.desc-todo {
display: block;
margin: 0;
padding: 5px;
}
+div.desc-done {
+ display: block;
+ margin: 0;
+ padding: 5px;
+ color: #888;
+}
+
div.header {
display: block;
}
diff --git a/2005/d/dev/todo/tasklist.dtd b/2005/d/dev/todo/tasklist.dtd
index ae077d2..a0a2389 100644
--- a/2005/d/dev/todo/tasklist.dtd
+++ b/2005/d/dev/todo/tasklist.dtd
@@ -9,3 +9,6 @@
<!ATTLIST task
id CDATA #REQUIRED
>
+<!ATTLIST desc
+ status (todo|done|high|low) #IMPLIED
+>
diff --git a/2005/d/dev/todo/tasklist.pl b/2005/d/dev/todo/tasklist.pl
index 5e9aaba..a08f32d 100755
--- a/2005/d/dev/todo/tasklist.pl
+++ b/2005/d/dev/todo/tasklist.pl
@@ -33,6 +33,7 @@ sub build_tab
while (<>)
{
chomp;
+ s/^[ \t]+//;
if (!defined $lastdesc && /^([a-z0-9](?:\.[a-z0-9.]+)*) (.*)/)
{
# Task.
@@ -67,7 +68,7 @@ sub build_tab
{
die "Task not defined" unless defined $task;
$$task{'desc'} = [ ] unless defined $$task{'desc'};
- if (defined $lastdesc)
+ if (defined $lastdesc && !/^[+-]/)
{
$$lastdesc .= ' ' . $_;
}
@@ -95,7 +96,18 @@ sub print_task_xml
}
for (@{$$task{'desc'}})
{
- print "$space <desc>$_</desc>\n";
+ if (/^\+ /)
+ {
+ print "$space <desc status=\"done\">$_</desc>\n";
+ }
+ elsif (/^- /)
+ {
+ print "$space <desc status=\"todo\">$_</desc>\n";
+ }
+ else
+ {
+ print "$space <desc>$_</desc>\n";
+ }
}
for (sort { $a <=> $b || $a cmp $b } keys %$task)
{
diff --git a/2005/d/dev/todo/tasklist.xsl b/2005/d/dev/todo/tasklist.xsl
index 59fa0b0..48d72b6 100644
--- a/2005/d/dev/todo/tasklist.xsl
+++ b/2005/d/dev/todo/tasklist.xsl
@@ -67,7 +67,11 @@
<xsl:template match="name|date|assignedto|desc">
<xsl:element name="div">
<xsl:attribute name="class">
- <xsl:value-of select="name()"/>
+ <xsl:choose>
+ <xsl:when test="@status"><xsl:value-of
+ select="name()"/>-<xsl:value-of select="@status"/></xsl:when>
+ <xsl:otherwise><xsl:value-of select="name()"/></xsl:otherwise>
+ </xsl:choose>
</xsl:attribute>
<xsl:value-of select="text()"/>
</xsl:element>