Mattias Gaertner wrote:
On Sat, 04 Feb 2006 01:31:34 +0800
Funky Beast <[EMAIL PROTECTED]> wrote:


Mattias Gaertner wrote:

On Thu, 02 Feb 2006 23:19:00 +0800
Funky Beast <[EMAIL PROTECTED]> wrote:


Reading:--
But if we use these methods to read an FPC xml document which i checked
out from fpcdocs trunk, their contents are heavily populated with a lot
of html tags within the contents. The problem for LazDoc's read method
will be that when it reads an html tag, it will consider it as a new item,
thus it can't completely read a description element full of html tags,
which are a norm in FPC documents, causing incomplete content.

LazDe on the other hand reads the contents by streaming it through DOM,
and the contents are read with the html tags intact for display. The
resulted read content can then be sent to any HTML viewer component for
display without further processing.

Thus CodeHelp adopts LazDe's method of reading.


So, here they are the same.
What's the difference? I mean, why write a new editor, instead of extending
LazDE?


I'm not writing a new editor, the editor project you saw was
just for testing the functions i wrote for the class in CodeHelp.pas.

LazDe is already a very versatile fpdoc document designer
that uses and follows fpdoc's functions and rules/conventions.

I see LazDe as a document creator and designer and
LazDoc as a document maintainer.

I'm actually extending LazDoc through the class in the
CodeHelp unit by providing:

-Remedy to the read/write methods from/to the xml documents.
-Facilities for a number of items stated in the
 Lazarus-CCR/LazDoc's "Future Plans".



Writing:--
LazDoc writes its content to xml elements with CreateTextNode() method.
So if there are html tags in the contents, the tags are converted to
some what wierd values, e.g. <b> tag will be written to the xml document
phisically as '&lt;b&gt;'. When you open that modified document with
LazDe or FPDE or any text editor, you will see '&lt;b&gt;' as part of
the content instead of the <b> tag. You can only see the <b> tag only
when viewed with LazDoc.


Then LazDoc methods must be improved.
LazDe's method of writing doesn't have that effect.
Thus CodeHelp adopts LazDe's method of writing also.

CodeHelp attempts to provide:
-Tools to LazDoc for easy management of xml documents for both Lazarus and
FPC.


You mean fpdoc, don't you?

Yes.




 (As Darius Blaszijk suggested on the other thread:
  news://news.gmane.org:119/[EMAIL PROTECTED]
  n)

-Easy scalability for future expansions if new subitems needs to be added
to
 xml documents, as everything is centralized in one unit.


Why is scalability easy, if everything is in one unit?


LazDoc maintains documents by following the current layout of
the xml documents, decided by fpdoc. If the layout changes or
expanded in future, we only need to change CodeHelp to adapt
to the new layout, with minimum or no code change in
LazDoc's frontend.

-Serves as a help-content search and collection tool.


Good.

-It will eventually be generating or formating html contents to be fed
 to any html viewer for display.


Nice. Will it use fpdoc's html generator?


I'm still digesting that part of fpdoc.
But for Code-Completion hints, the html contents will
be manually crafted, as we don't need to put the whole
document into the hint window for quick reference.

Thus fulfilling your item no. 3:
- the parsing of the fpdoc xml item and showing as formatted text :-)


ideintf/helpintf.pas

HelpDatabases contains all help databases. A Help database can be for
example a TFPDocHTMLHelpDatabase.
Every lazarus package can register one or more help databases.
The IDE registers some default help databases: RTL, FCL, LCL and
MainHelp. MainHelp is currently a simple THTMLHelpDatabase. The RTL help database is registered for all *.pas and *.pp files in the
file path '$(FPCSrcDir)/rtl' and all sub directories.
So, when the user presses F1 on an identifier, say 'TObject', the IDE
searches the declaration. It finds it in
$(FPCSrcDir)/rtl/inc/objpash.inc which belongs to
$(FPCSrcDir)/rtl/linux/system.pp. Now the IDE searches a help database
with this unit and finds the RTL help db. It then tells the help
database to show the help for 'system.pp TObject'. Because the RTL help
db is a TFPDocHTMLHelpDatabase, it simply converts it into an URL and
starts a browser to show that page.


Thanks, then i'll have to digest helpintf.pas for the formating of
"SeeAlso" links in the xml documents.


If you miss a feature, don't hesitate to ask.

Mattias


_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to