Re: [PHP-DOC] (New Version) - Patch to build only one file

2004-01-10 Thread Gabor Hojtsy
Hi Fernando!

>From what I have seen so far, the script seems to be good for
translation workers (and manual writers) until we can get livedocs
working for them. BTW livedocs is partly intended to solve the problem
your script is aimed at solving, though it does much more, so the need
for livedocs is not threatened :)

I would like to propose a "build-by-id" working mechanism instead for
the script, so instead of:

  make file=./en/reference/mysql/functions/mysql-query.xml

one would be able to write:

  make id=myqsl-query

Since addentities.php.in should be able to find a file with this ID
defined. If one would try to build parts of individual files, then that
would overcomplicate things, so the file in which that ID is defined
should be selected... To be more clear:

  make id=security.filesystem

would not build the filesystem security part of the security section,
but the whole security section instead (since security.filesystem is
defined in the file which is the security section itself :)

This does not have the advantage of shell autocomplete, but people do
need to type less :)

Feel free to commit the script and the changes to the makefile :)

Goba


Re: [PHP-DOC] (New Version) - Patch to build only one file

2004-01-10 Thread Nuno Lopes
Hi Fernando,

I think this script is great and you should commit it.
Don't forget to change the header of the script and include the PHP licence.

Nuno



> I build a new version with the ideas from Goba (Thanks!), now there is
only one script in php
> and it is in english.
> This is more simple, so, to use:

(...)

> Fernando Correa da Conceição


[PHP-DOC] (New Version) - Patch to build only one file

2004-01-10 Thread Fernando Correa da Conceição



I build a new version with the ideas from Goba 
(Thanks!), now there is only one script in php and it is in 
english.
This is more simple, so, to use:
 
Apply the path to Makefile.in 
Add the script to /scripts
./configure
make file=file to generate, example:
make 
file=./en/reference/mysql/functions/mysql-query.xml
 
Index: 
Makefile.in===RCS 
file: /repository/phpdoc/Makefile.in,vretrieving revision 1.146diff -u 
-r1.146 Makefile.in--- Makefile.in 3 Jan 2004 12:32:15 
- 1.146+++ Makefile.in 10 Jan 2004 19:35:29 -@@ -21,6 
+21,12 @@  all: html +ifdef 
file+buildfile=addentities.xml.tmp+else+buildfile=manual.xml+endif+ # 
{{{ variables  [EMAIL PROTECTED]@@@ -167,7 +173,8 
@@ html/index.html: manual.xml $(HTML_DEPS)  @test -d 
html || mkdir html  $(PHP) -q 
$(scriptdir)/rtlpatch/hackmanuallang.php $(LANGDIR)- $(JADE) $(CATALOG) 
-d $(HTML_STYLESHEET) -V use-output-dir -t sgml $(XMLDCL) 
manual.xml+ $(PHP) -q $(scriptdir)/addentities.php 
$(file)+ $(JADE) $(CATALOG) -d $(HTML_STYLESHEET) -V use-output-dir -t 
sgml $(XMLDCL) $(buildfile)  $(PHP) -q 
$(scriptdir)/html_syntax.php html html/  $(PHP) -q 
$(scriptdir)/rtlpatch/hackmanuallang.php 
en  $(HACK_RTL_LANGS_PAGES)
 
***
addentities.php.in
 
/*** by Fernando Correa da 
Conceição ** This script let you compile 
only one file. Use:* make file=filename* example:* make 
file=./en/reference/mysql/functions/mysql-query.xml* to all functions from a 
extension* make 
file=./en/reference/mysql/reference.xml*/$file=$argv[1];// if we are 
working with the default rule, exit// TODO: maybe do this on 
Makefileif($file == "") exit;
 
$lines=file($file);
 
// this is the beginning from 
manual.xml.in$header = <<  
"@srcdir@/dtds/dbxml-4.1.2/docbookx.dtd" [
 

 
%language-defs;%language-snippets;
 

 
%language-defs.default;%language-snippets.default;
 

 
%phpweb.entities;
 

 

 
%global.entities;%file.entities;%build.version;
 
%missing-entities;
 
]>endblock;
 
// here a add the beginning from 
manual.xml.in// and the tags  and  to make jade 
happy$lines[1].="\n".$header."\n\n";
 
// join all again and add closing tags for book and 
article$output=join("",$lines);$output.="\n\n";
 
// generate a temp file with all 
things$saveto="./addentities.xml.tmp";if (!$handle = fopen($saveto, 
'w')) {   echo "Error, can´t create/open 
($saveto)";   exit;}if (!fwrite($handle, $output)) 
{    print "Error, can´t write 
($saveto)";    exit;}
 
?>
 
Fernando Correa da ConceiçãoICQ 
168518047 http://manualphp.sourceforge.netParticipe 
da Tradução do Manual do PHP