Skip to main content

Markdown + PHPDoc Docblock Support

JCB allows you to embed documentation directly inside your custom templates, layouts, or snippets using Markdown and PHPDoc-style comments

🧠 What Does This Do?

Joomla Component Builder (JCB) supports two forms of embedded documentation within custom code entities:

  1. Markdown syntax — inside README files and documentation fields.
  2. PHPDoc-style comments — inside templates, layouts, and snippets, which get preserved in the compiled output.

This lets you create structured documentation as you build your code — useful both during development and for generating reference materials automatically.

📝 Markdown Support

You can write standard Markdown syntax in:

  • README fields for templates, snippets, field types, views, etc.
  • Custom Documentation entities (in the GUI)
  • Per-entity README auto-generation
  • JCB Wiki and shared Git-based blueprints

Markdown is rendered in external viewers like GitHub/Gitea or parsed into help popovers in your component (if enabled).

Example:


## Description

This snippet handles dynamic filters in a Custom Admin View.

- Uses `Dynamic GET`
- Accepts user input
- Returns filtered SQL results

📚 PHPDoc Support

Within your PHP templates or layout files, you can embed PHPDoc-style comments like this:


/**
 * Renders a filtered dropdown of cities.
 *
 * @param  array  $items  The list of city records.
 * @return string
 */

These docblocks will be preserved in your compiled component, aiding IDE autocompletion and in-code documentation.

Supported in:

  • Templates
  • Layouts
  • Helpers
  • Custom Code Blocks

🎯 Why Use This?

  • ✅ Self-document your logic as you build
  • ✅ Improve code readability for teams
  • ✅ Automatically generate docs from codebase
  • ✅ Use GitHub/Gitea README rendering natively
  • ✅ Reduce the need for external documentation

📦 Use Cases

  • Keep your reusable Snippets or Layouts documented directly in the code
  • Annotate PHP helpers with @param, @return, and @throws tags
  • Maintain Markdown-based component-level docs for Git repositories
  • Export technical documentation automatically with the compiled ZIP

💡 Tips

  • Combine Markdown + PHPDoc for full-stack documentation: GUI + Code
  • Use JCB’s README auto-generation to output these annotations
  • You can define Markdown-formatted help fields inside Field Types for inline tooltips

✅ Conclusion

JCB's Markdown + PHPDoc support empowers developers to create fully documented, professional-grade components — from GUI to generated code. Write once, document always — right inside the builder.