On 23 February 2011 15:52, Hannes Magnusson <hannes.magnus...@gmail.com> wrote:
> On Wed, Feb 23, 2011 at 13:30, Richard Quadling <rquadl...@gmail.com> wrote:
>> On 22 February 2011 17:16, Philip Olson <phi...@roshambo.org> wrote:
>>>
>>>> Wait. What.
>>>> Are you talking about creating a new echm.php+.bat script? is it so
>>>> different process? Do we need both chm versions?
>>>
>>> I think we need both chm versions, especially considering the size 
>>> difference (16mb of notes). As for implementation, I have no comment. :)
>>>
>>> Regards,
>>> Philip
>>>
>>>
>>
>> With regard to PhD, creating both formats is easily achieved by ...
>>
>> phd/render -P PHP -f chm -f enhancedchm
>>
>> Just adding an additional format.
>>
>> The build-chms.php script will now have to deal with 2 CHM files
>> (php_chm and php_enhancedchm).
>>
>> I'm about to commit the amendments to the enhanced chm format to NOT
>> use the output directory for the usernotes (as this is wiped for each
>> language currently).
>>
>> I would amend the build-chms.php script at the same time, but this is
>> not a tagged file, just trunk, so any changes would need to be sync'd
>> with a PhD release.
>
>
> I haven't been paying attention to svn commits for the past weeks..
> but now I'm simply confused.
>
> In the PhD format, do you hardcode the path to the usernotes?
> Is that what you have been asking about all this thread? - I was under
> the impression we were talking about that .bat script to build it.
>
> No paths should be hardcoded in PhD obviously. All paths should be
> passed to PhD. Be it CSS file to fetch and embed, or user notes to add
> and embed.
>
> -Hannes
>

The enhanced format does 2 main things.

1 - Decompresses the http://www.php.net/backend/notes/all.bz2 file
into a series of files - one for each page in the manual where the
note was added.
2 - Amends the rendered HTML output to include the notes.

In addition to this, it uses the
http://www.php.net/backend/notes/last-updated file to determine if it
is necessary to actually do all the work mentioned in point 1 above.

As the usernotes are in English, it would seem sensible to keep the
notes during the entire build process for all languages - essentially
cache the notes.

As Hannes has just mentioned, rendering both formats at the same time
will certainly make things faster.


The issue I had was that during the build process (build-chms.php),
the output directory was wiped after every language. Initially, the
output directory contained the user notes, so every language build
would wipe the notes.

I wanted to alter PhD so that --lang became a subdirectory of
--output. Because that way, I could append /notes to --output and it
wouldn't interfere with anything too much. Hannes said that could be
an issue for other applications expecting the output to be in
--output.

So, rather than having the usernotes created within --output (either
as an absolute path or as a relative path), I've gone for using
getenv('TEMP') . '/usernotes' to hold the expanded usernotes during
the build process.

As this directory is not within --output, it won't be emptied
automatically after each language.


Richard.


-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

Reply via email to