Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2005:
[Freeciv-Dev] (PR#10284) [Request]Docs: distribute FAQ into freeciv/docs
Home

[Freeciv-Dev] (PR#10284) [Request]Docs: distribute FAQ into freeciv/docs

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Cc: freeciv-data@xxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#10284) [Request]Docs: distribute FAQ into freeciv/docs/
From: "Egor Vyscrebentsov" <evyscr@xxxxxxxxx>
Date: Mon, 24 Oct 2005 00:31:25 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=10284 >

> [evyscr - Sep 23 20:12:58 2004]:
> 
> Good daytime!
> 
> It would be nice to see FAQ file in freeciv distribution, wouldn't it?

Pre-alpha version of simple script that generates text FAQ file from
http://www.freeciv.org/index.php/FAQ is attached.

TODO:
1. Write numbers at answers.
2. Support other languages (we have at least 'pl' at www.freeciv.org)
3. Other improvements :)

--
Thanks, evyscr.
#!/usr/bin/perl

$faq_url = "http://www.freeciv.org/index.php/FAQ";;
$faq_file = "FAQ";

open(FILE, ">$faq_file") || die ("Cannot open file $faq_file for writing.\n");

@content = `links -dump "$faq_url"`;

my $i = 0;
foreach my $line(@content) {
  $line =~ s/^\s*\[edit\]/\-\-\-\-\-\-\-/;
  $line =~ s/\s+$//;
  $line =~ s/^\s*FAQ$/                  Freeciv Frequently Asked Questions 
\(FAQ\)/;
  $line =~ s/^\s*From Freeciv$/                 (from $faq_url)/;
  if ($line =~ m/^\s*(\-){15,}$/) {
    last;
  }
  if ($i++ > 1) {
    print FILE "$line\n";
  }
}
close(FILE);

print "File $faq_file has written successfully\n";

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#10284) [Request]Docs: distribute FAQ into freeciv/docs/, Egor Vyscrebentsov <=