Re: Plain text file on web server, questions please...
- From: Ohmster <nowayin@xxxxxxxx>
- Date: Sun, 17 Jun 2007 17:07:37 +0200 (CEST)
Bit Twister <BitTwister@xxxxxxxxxxxxxxxx> wrote in
news:slrnf7ah3m.ukj.BitTwister@xxxxxxxxxxxxxxx:
Hello Bit Twister, nice to see you again my friend,
I
Since I do not want to have two copies of the FAQ (More chance for
errors and also more work to maintain.), is there any way in Linux to
automate making an HTML wrapper to throw around this text document,
strictly for online viewing that would add the HTML tags to the online
version such as <body></body>, and especially the link tags like this:
<A href="http://www.foobar.com/foobarFAQ.txt">FAQ</A>
I have been using Linux for over ten years but some of the really in
depth stuff I really am not familiar with (Just ask me what "awk" is,
therewill probably tell you that it is a sound that birds make. <g>) Is
a utility that would do this or can it be done with a shell script
perhaps? All links in the text document would begin with http:// and
that is something identifiable to search for if one were to try and
script it.
Just for fun, create fyi.txt, head.html and tail.html files.
Wow, this looks really interesting, this is kind of like logwatch. I have
been getting plain text versions of logwatch in my email every day for
years then found out that you can get html versions too, if you like. My
version of logwatch did not have the headers for html, I had to search
out some rpm files to get the right one that had the html headers and now
I get html logwatch files in my email and it works really good. You aim
to do something of the same is what I gather. Maybe I could examine those
logwatch html header files to see how it was done for logwatch. Let's see
where those files are, shall we?
[root@ohmster ~]# locate logwatch |grep htm
/usr/share/doc/selinux-policy-2.4.6/html/admin_logwatch.html
/usr/share/logwatch/default.conf/html
/usr/share/logwatch/default.conf/html/footer.html
/usr/share/logwatch/default.conf/html/header.html
[root@ohmster ~]#
Awwww, maybe not too helpful as the only links in the logwatch file are
anchors to different sections of it and then "back to top" anchors.
Still, it is something to consider.
head.html has
<HTML>
<BODY BGCOLOR="#99CCCC" LINK="#0000FF" VLINK="#FF0000"
ALINK="#FF0000" TEXT="#000000">
<pre>
I got it, but what does the <pre> tag mean or do? I've never heard of it.
tail.html has
</pre>
</BODY>
</HTML>
That's about rigth, but this time you close the </pre> tag. What is that
<pre> tag? Did you make that up or is it a real html tag, Bit?
faq.txt has
Today's tip
For extra points, read http://tldp.org/LDP/abs/html/index.html
Right, right, go on.
Now run the command
cat head.html faq.txt tail.html > aa.html
To test, put aa.html in your browser and see if it works.
Ahhhh, yes, I see. I will try this and get back to you. Not sure about
this though as I think I would need <A href= tags. How could a header and
a footer insert such tags into a decent sized text document? I will try
it and get back to you real soon though.
[snip]Could cron be used to copy the document over prior to adding the HTML
tags right before posting and then when posting again, do the same
thing, this way that if anything changed in the FAQ, it would also be
changed in the online version as well?
Well, your script just does the commands you would do by hand. You
have to figure out how to compute any variables.
I have a humor/fyi email list kinda like you do.
Instead of version I used date.
I saved the rest but it adds to the confusion right now on how to get <a
href= tags into a text document at this moment. Will try the head, txt,
tail idea and then get back to you with the results. Thanks for your
input Bit Twister.
--
~Ohmster
ohmster at ohmster dot com
Put "messageforohmster" in message body
(That is Message Body, not Subject!)
to pass my spam filter.
.
- Follow-Ups:
- Re: Plain text file on web server, questions please...
- From: Bit Twister
- Re: Plain text file on web server, questions please...
- From: Cousin Stanley
- Re: Plain text file on web server, questions please...
- References:
- Re: Plain text file on web server, questions please...
- From: Bit Twister
- Re: Plain text file on web server, questions please...
- Prev by Date: Re: Buffer Overflow Protection.
- Next by Date: Re: Plain text file on web server, questions please...
- Previous by thread: Re: Plain text file on web server, questions please...
- Next by thread: Re: Plain text file on web server, questions please...
- Index(es):
Relevant Pages
|