Project Databases: Method documentation is back

Automatically translated from English

When developing an application, it can be very useful to have quick access to the details of a method (e.g., an explanation of what it does, its syntax, and a definition of the parameters passed to it). This becomes even more important when using a compiled component. You can’t look at the content of the method, so you can only rely on its documentation to understand how to use it.

The Explorer’s dialog has been enhanced and documentation is now available in 4D v18 R3 for project databases.

Documentation is saved in a file with the same name as the method or form in a documentation folder. The new format for the documentation is Markdown.

Why markdown?

The Markdown language allows you to format text and has a very simple syntax. Thus, the document is easy to read and write, without interrupting its interpretation.
Many tools use Markdown for formatting documentation. For example, GitHub provides a built-in Markdown interpreter.

Documentation in 4D

Documentation is available for:

  • Project methods
  • Database methods
  • Trigger methods
  • Project form methods
  • Table form methods
  • Classes

 

When you export your binary database as a project, your existing documentation is saved in Markdown-formatted files.

To create or edit the documentation file in a project database, click on the “Create” button or select the “Edit Documentation” menu item in the Explorer.

4D creates the corresponding file and opens it in your default editor. The file includes a template:

<!-- Type your summary here -->
## Description

## Example

```4d
Type your example here
```

You can see that the first line uses the HTML comment tags. This information is displayed in the method editor when you hover the cursor over the method. The rest of the file is displayed in the “Documentation” tab of the explorer.

Example

If we use the getWeekday method as an example, here is the result:

In an upcoming blog post, we’ll show you how to make use of comments to write your own documentation for components. Stay tuned!

Vanessa Talbot

• Product Owner •

Vanessa Talbot joined 4D Program team in June, 2014. As a Product Owner, she is in charge of writing the user stories then translating it to functional specifications. Her role is also to make sure that the feature implementation delivered is meeting the customer need.

Since her arrival, she has worked to define key features in 4D. She has worked on most of preemptive multi-threading new features and also on a very complex subject: the new architecture for engined application. Vanessa has a degree from Telecom Saint-Etienne. She began her career at the Criminal Research Institute as a developer for the audiovisual department. She has also worked in media and medical fields as expert in technical support, production as well as documenting new features.