ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/FeepingCreaturism/Jargon.cpp
(Generate patch)

Comparing FeepingCreaturism/Jargon.cpp (file contents):
Revision 207 by Douglas Thrift, 2004-09-02T00:09:24-07:00 vs.
Revision 222 by Douglas Thrift, 2004-09-05T22:52:35-07:00

# Line 15 | Line 15 | Jargon::Jargon(const ext::String& path,
15  
16          redi::pstreambuf pin("/usr/local/bin/Xalan", args, std::ios_base::in);
17          ios::FromStreamBuf adaptor(pin);
18 +        
19          ext::Handle<xml::Document> document(xml::Parse(adaptor));
20          ext::Handle<xml::Node> jargon(*document/"jargon");
21  
22          word = *jargon/"word";
23          pronunciation = *jargon/"pronunciation";
24          grammar = *jargon/"grammar";
25 <        definition = *jargon/"definition";
25 >        definition = *jargon/"definition"/"p";
26 > }
27 >
28 > void Jargon::display(ios::PrintWriter& pout, xml::TextWriter& xhtml) const
29 > {
30 >        {
31 >                xml::ScopeElement p(xhtml, "p");
32 >                
33 >                xhtml.OpenElement("strong");
34 >                xhtml.OutputText(word + ":");
35 >                xhtml.CloseElement();
36 >
37 >                if (!pronunciation.IsEmpty()) xhtml.OutputText(" " + pronunciation);
38 >                if (!pronunciation.IsEmpty() && !grammar.IsEmpty()) xhtml.OutputText(",");
39 >                if (!grammar.IsEmpty()) xhtml.OutputText(" " + grammar);
40 >        }
41 >
42 >        definition.WriteTo(xhtml);
43   }
44  
45   struct Section
# Line 36 | Line 54 | ios::PrintWriter& operator<<(ios::PrintW
54   {
55          if (jargon.include)
56          {
57 <                //
57 >                xml::TextWriter xhtml(pout, true);
58 >
59 >                jargon.display(pout, xhtml);
60  
61                  return pout;
62          }
# Line 44 | Line 64 | ios::PrintWriter& operator<<(ios::PrintW
64          pout << "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n"
65                  << "\t\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n";
66  
67 <        xml::TextWriter xhtml(pout);
67 >        xml::TextWriter xhtml(pout, true);
68          xml::ScopeElement html(xhtml, "html");
69  
70          xhtml.SetAttribute("xmlns", "http://www.w3.org/1999/xhtml");
# Line 53 | Line 73 | ios::PrintWriter& operator<<(ios::PrintW
73                  xml::ScopeElement head(xhtml, "head");
74  
75                  xhtml.OpenElement("title");
76 <                xhtml.OutputText("Douglas Thrift's Computers Website | Jargon: \""
77 <                        + jargon.word + "\"");
76 >                xhtml.OutputText("Douglas Thrift");
77 >
78 >                pout << "'";
79 >
80 >                xhtml.OutputText("s Computers Website | Jargon: " + jargon.word);
81                  xhtml.CloseElement();
82                  xhtml.OpenElement("link");
83                  xhtml.SetAttribute("rel", "stylesheet");
# Line 138 | Line 161 | ios::PrintWriter& operator<<(ios::PrintW
161                          xhtml.OpenElement("h1");
162                          xhtml.SetAttribute("id", "title");
163                          xhtml.SetAttribute("class", "center");
164 <                        xhtml.OutputText("Jargon: \"" + jargon.word + "\"");
164 >                        xhtml.OutputText("Jargon: " + jargon.word);
165                          xhtml.CloseElement();
166                  }
167  
# Line 146 | Line 169 | ios::PrintWriter& operator<<(ios::PrintW
169                          xml::ScopeElement div(xhtml, "div");
170  
171                          xhtml.SetAttribute("class", "hr");
172 +                        jargon.display(pout, xhtml);
173                  }
174  
175                  {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines