Difference between revisions of "FPDoc Editor"

From Free Pascal wiki
Jump to navigationJump to search
m
Line 2: Line 2:
  
 
= Introduction =
 
= Introduction =
FPDoc is the Free Pascal documentation tool to create help files. Lazarus provides two editors to create/update FPDoc source code documentation. One simple and integrated called '''FPDoc Editor''', which is described on this page, and one complete editor called LazDE.
+
FPDoc is the Free Pascal documentation tool which is specifically designed to create help files for individual units of Pascal source code. For more information about FPDoc see here: [http://lazarus-ccr.sourceforge.net/fpcdoc/fpdoc/fpdoc.html Free Pascal documentation tool manual].
  
About FPDoc see here: [http://lazarus-ccr.sourceforge.net/fpcdoc/fpdoc/fpdoc.html Free Pascal documentation tool manual].
+
Lazarus provides two help file editors either of which you can use to create or update source code documentation in FPDoc format. The simpler editor, integrated into the Lazarus IDE is called '''FPDoc Editor''', and is described on this page. There is also a more complete and complex editor called LazDE.
  
The big brother of the ''FPDoc Editor'' is '''lazde''' the lazarus documentation editor. It is a standalone application which can be found in ($LazDir)/doceditor/lazde.lpi, and needs to be compiled using the IDE then runs outside the IDE.
+
'''LazDE''' is a bigger brother to '''FPDoc Editor''' and is the Lazarus Documentation Editor. See here: [[Lazarus_Documentation_Editor|LazDE - Lazarus Documentation Editor]]
 
+
It is a standalone application (not an integral part of the IDE). It is located at ($LazDir)/doceditor/lazde.lpi. Once you have compiled the lazde project (using Lazarus) LazDE then runs outside the IDE.
[[Lazarus_Documentation_Editor|LazDE - Lazarus Documentation Editor]]
 
  
 
= Where is the FPDoc Editor? =
 
= Where is the FPDoc Editor? =
 
The FPDoc Editor is integrated in the Lazarus IDE. It can be found under the '''View''' menu.
 
The FPDoc Editor is integrated in the Lazarus IDE. It can be found under the '''View''' menu.
  
= Usage =
+
= Using the FPDoc Editor =
Using FPDoc Editor is very simple.
+
To use the FPDoc Editor you simply:
  
1. Open the FPDoc Editor. You can find it under the menu View.
+
1. Open the FPDoc Editor. You will find it under the View menu.
  
2. Place and move the cursor. After placing the cursor on the source editor, you will notice that the caption of the FPDoc Editor form changes. The caption shows the source element selected and the filename of the documentation file. By selecting the appropriate page in the editor you can edit a specific documentation tag. Of course it is also possible to use it only as a viewer.
+
2. In the Lazarus source code editor move the cursor to some code element. You will notice that the FPDoc Editor's Caption changes to show the selected source element togeher with the filename of the documentation file. Within FPDoc Editor you can select an appropriate page where you can edit a specific documentation tag. Of course it is also possible to use FPDoc Editor only to view documentation files, without changing them.
  
3. Click on the create help button. If you have not yet setup the fpdoc search paths, the IDE will ask where to store the fpdoc files. For projects you will normally use a subdirectory 'docs'.
+
3. Click on the Create Help button. If you have not yet set up search paths for FPDoc the IDE will ask you where the FPDoc files it generates should be stored. For each of your projects you would normally provide a 'docs' subdirectory.
  
 
4. Write a short description.
 
4. Write a short description.
  
5. Click on the save button to the left or go to the next item. The editor will save it automatically.
+
5. Click on the Save button to the left or go to the next item (the editor automatically saves a description when you move away from it).
  
=Edit fpdoc entries of FPC sources, RTL and FCL=
+
=Editing FPDoc entries for the FPC sources, RTL and FCL=
  
The fpdoc entries for the FPC sources can be downloaded from svn:
+
The FPDoc entries for the FPC sources can be downloaded from svn:
  
 
  cd /home/username/yourchoice/
 
  cd /home/username/yourchoice/
Line 35: Line 34:
 
Add the path ''/home/username/yourchoice/fpcdocs'' to Tools / Options / Environment / FPDoc Editor
 
Add the path ''/home/username/yourchoice/fpcdocs'' to Tools / Options / Environment / FPDoc Editor
  
You can test it with ''TComponent.Name''.
+
A good item to test FPDoc on is ''TComponent.Name''.
  
 
= Future plans =
 
= Future plans =
Line 50: Line 49:
 
* Make FPDoc Editor create new elements in documentation
 
* Make FPDoc Editor create new elements in documentation
 
* Make FPDoc Editor create new documentation files
 
* Make FPDoc Editor create new documentation files
* Adding a small toolbar makes it possible to use the available markeup tags
+
* Adding a small toolbar makes it possible to use the available markup tags
 
* Make FPDoc Editor work on keydown in source code editor
 
* Make FPDoc Editor work on keydown in source code editor
 
* Add FPDoc Editor to IDE settings (showing and position in IDE)  
 
* Add FPDoc Editor to IDE settings (showing and position in IDE)  

Revision as of 16:23, 28 April 2013

Deutsch (de) English (en) français (fr) 日本語 (ja) polski (pl) português (pt) русский (ru)

Introduction

FPDoc is the Free Pascal documentation tool which is specifically designed to create help files for individual units of Pascal source code. For more information about FPDoc see here: Free Pascal documentation tool manual.

Lazarus provides two help file editors either of which you can use to create or update source code documentation in FPDoc format. The simpler editor, integrated into the Lazarus IDE is called FPDoc Editor, and is described on this page. There is also a more complete and complex editor called LazDE.

LazDE is a bigger brother to FPDoc Editor and is the Lazarus Documentation Editor. See here: LazDE - Lazarus Documentation Editor It is a standalone application (not an integral part of the IDE). It is located at ($LazDir)/doceditor/lazde.lpi. Once you have compiled the lazde project (using Lazarus) LazDE then runs outside the IDE.

Where is the FPDoc Editor?

The FPDoc Editor is integrated in the Lazarus IDE. It can be found under the View menu.

Using the FPDoc Editor

To use the FPDoc Editor you simply:

1. Open the FPDoc Editor. You will find it under the View menu.

2. In the Lazarus source code editor move the cursor to some code element. You will notice that the FPDoc Editor's Caption changes to show the selected source element togeher with the filename of the documentation file. Within FPDoc Editor you can select an appropriate page where you can edit a specific documentation tag. Of course it is also possible to use FPDoc Editor only to view documentation files, without changing them.

3. Click on the Create Help button. If you have not yet set up search paths for FPDoc the IDE will ask you where the FPDoc files it generates should be stored. For each of your projects you would normally provide a 'docs' subdirectory.

4. Write a short description.

5. Click on the Save button to the left or go to the next item (the editor automatically saves a description when you move away from it).

Editing FPDoc entries for the FPC sources, RTL and FCL

The FPDoc entries for the FPC sources can be downloaded from svn:

cd /home/username/yourchoice/
svn co http://svn.freepascal.org/svn/fpcdocs/trunk fpcdocs

Add the path /home/username/yourchoice/fpcdocs to Tools / Options / Environment / FPDoc Editor

A good item to test FPDoc on is TComponent.Name.

Future plans

The todo list currently contains the following items, in no particular order:

  • Write a help editor for topics.
  • Create nicer html output for the hint windows.
  • Support Operators

Done

  • Extend the link editor to show packages and identifiers
  • Add documentation tags "example" to FPDoc Editor
  • Add documentation tags "topic" to FPDoc Editor
  • Make FPDoc Editor create new elements in documentation
  • Make FPDoc Editor create new documentation files
  • Adding a small toolbar makes it possible to use the available markup tags
  • Make FPDoc Editor work on keydown in source code editor
  • Add FPDoc Editor to IDE settings (showing and position in IDE)
  • Make it work for fpc sources (rtl files already exist)
  • Add settings to environment menu
  • Make it work on project files also
  • Propose to expand documentation tags with: "todo" and "notes" (no need for that, as there are alternatives)
  • Reduce overhead even further
  • All source elements are interpreted by FPDoc Editor using codetools
  • Find inherited entries. For example TControl.Align of TButton.Align
  • Optimization: inherited Entries are parsed on idle
  • Optimization: xml files are cached, and only parsed once or if they changed on disk
  • Add a HTML viewer. This is available by installing the turbopoweriprodsgn package
  • Checks for invalid xml tags and auto repairs them