SlideShare una empresa de Scribd logo
1 de 37
Descargar para leer sin conexión
DocBlox
Your source matters
Mike van Riel
     Lead Developer of DocBlox
Technical Lead Developer for Unet B.V.
     Active with PHP since 2002
What is DocBlox?
➔   Documentation Generation Application (DGA) for PHP
➔   Inspired by phpDocumentor and JavaDoc
➔   Generates documentation from your source code
➔   Uses the structure and comments of your source code
Why DocBlox?
➔   Support for PHP 5.3+ features
➔   Performance, improved with up to 80%
➔   Memory usage, large projects use 100MB instead of
    gigabytes
➔   Active project, every month new features
    ●   Bug fixes even more frequent
➔   QA Tool for in-source documentation
Feature                                 DocBlox   phpDocumentor   Doxygen

PHP 5.3+ Support
Can cope with large projects
Search
Incremental Parsing
Doctrine Annotations
XML output
Class inheritance diagram
PDF
DocBook
Linking to external documentation
Markup of descriptions using Markdown
Latex support
Parse directly from phar
Secret feature
Who uses DocBlox?
Who uses DocBlox?



     You?
Installation
Installation via PEAR

 $ pear channel-discover pear.docblox-project.org
 $ pear channel-discover pear.michelf.com
 $ pear install docblox/DocBlox-beta



Manual installation
      See http://docs.docblox-project.org/Installation.html#manual-installation
Running docblox
$ docblox -d [FOLDER] -f [FILE] -t [DESTINATION]


OR


$ docblox parse -d [FOLDER] -f [FILE] -t [STAGING]
$ docblox transform -s [STAGING]/structure.xml -t [DESTINATION]
Running docblox: Incremental parsing
    $ docblox parse -d [FOLDER] -f [FILE] -t [STAGING]
    $ docblox transform -s [STAGING]/structure.xml -t [DESTINATION]


➔   Structure file is written to a staging location
➔   Every parsing run DocBlox will know if a file has changed
     ●   If so, re-parse
     ●   If not, re-use
➔   Advantages:
     ●   Parsing speed is increased
     ●   Structure file is not distributed along with rest of documentation
Running docblox: Incremental parsing
    $ docblox parse -d [FOLDER] -f [FILE] -t [STAGING]
    $ docblox transform -s [STAGING]/structure.xml -t [DESTINATION]



➔   Structure file is written to a staging location
➔   Every parsing run DocBlox will know if a file has changed
     ●   If so, re-parse
     ●   If not, re-use
➔   Advantages:
     ●   Parsing speed is increased
     ●   Structure file is not distributed along with rest of documentation
Running docblox: Options
$ docblox –-help
-h [--help]                   Show this help message
-q [--quiet]                  Silences the output and logging
-c [--config] [STRING]        Configuration filename OR "none", when this option is omitted DocBlox tries
                              to load the docblox.xml or docblox.dist.xml from the current working
                              directory
-f [--filename] STRING        Comma-separated list of files to parse. The wildcards ? and * are supported
-d [--directory] STRING       Comma-separated list of directories to (recursively) parse.
-t [--target] [STRING]        Path where to store the generated output (optional, defaults to "output")
-e [--extensions] [STRING]    Optional comma-separated list of extensions to parse, defaults to php, php3
                              and phtml
-i [--ignore] [STRING]        Comma-separated list of file(s) and directories that will be ignored.
                              Wildcards * and ? are supported
-m [--markers] [STRING]       Comma-separated list of markers/tags to filter, (optional, defaults
                              to: "TODO,FIXME")
-v [--verbose]                Provides additional information during parsing, usually only needed for
                              debugging purposes
--title [STRING]              Sets the title for this project; default is the DocBlox logo
--template [STRING]           Sets the template to use when generating the output
--force                       Forces a full build of the documentation, does not increment existing
                              documentation
--validate                    Validates every processed file using PHP Lint, costs a lot of performance
--parseprivate                Whether to parse DocBlocks tagged with @internal
--visibility [STRING]         Specifies the parse visibility that should be displayed in the
                              documentation (comma seperated e.g. "public,protected")
--defaultpackagename [STRING] name to use for the default package. If not specified, uses "default"
Configuration
➔   Stored as XML
➔   docblox.dist.xml or docblox.xml
<?xml version="1.0" encoding="UTF-8" ?>
<docblox>
    <parser>
        <default-package-name>DocBlox</default-package-name>
        <target>data/output</target>
    </parser>
    <transformer>
        <target>data/output</target>
    </transformer>
    <files>
        <directory>.</directory>
        <ignore>tests/*</ignore>
    </files>
</docblox>
Writing Docblocks
➔   Docblocks are used to tag elements with meta-data
➔   Specific type of comment: /** … */
➔   Three parts:
    ●   Short description, one liner
    ●   Long description, a complete description of the
        element
    ●   Tags, annotations which provide additional
        information
Docblocks - II
/**
  * This is a short description.
  *
  * This is a long description, which may span
  * multiple lines and contain {@inline} tags and
  * can be *styled* with `Markdown`.
  *
  * @param string     $a This is the first variable.
  * @param Exception $b This is the second variable.
  * @param array      $c This is the third variable.
  *
  * @return void
  */
function myFunction($a, Exception $b, array $c)
{
}
Supported elements
➔   Files
➔   Namespaces
➔   Includes & requires
➔   Classes
➔   Traits (not yet, is coming)
➔   Functions, methods and closures
➔   Properties
➔   Constants, global and class
Supported tags
➔   @abstract      ➔   @ignore     ➔   @since
➔   @access        ➔   @internal   ➔   @static
➔   @api           ➔   @license    ➔   @staticvar
➔   @author        ➔   @link       ➔   @subpackage
➔   @category      ➔   @method
                                   ➔   @throws / @throw
➔   @copyright     ➔   @name
                                   ➔   @todo
➔   @deprecated    ➔   @package
                                   ➔   @tutorial
➔   @example       ➔   @param
➔   @final         ➔   @property
                                   ➔   @uses / @usedby
➔   @filesource    ➔   @return     ➔   @var
➔   @global        ➔   @see        ➔   @version
Inheritance
➔   Docblocks inherit by default (if not overridden)
    ●   Short description
    ●   Long description
        –   Can be augmented using {@inheritdoc}
    ●   Specific tags
Inheritance - Classes
➔   Methods
➔   Properties
➔   Tags
    ●   @package
    ●   @subpackage
        –   if @package is the same as parent
    ●   @version
    ●   @copyright
    ●   @author
Inheritance - METHODS
➔   Tags
    ●   @param
    ●   @return
    ●   @throw / @throws
    ●   @version
    ●   @copyright
    ●   @author
Inheritance - Properties
➔   Tags
    ●   @var
    ●   @version
    ●   @copyright
    ●   @author
Inheritance - Example
class Parent {
    /**
     * Short description.
     *
     * @api
     * @param int    $a First param.
     * @param string $b Second param.
     */
    function doIt($a, $b) { .. }
}

class Child extends Parent {
    /**
     * Short description.
     *                                  DocBlox adds this for you.
     * @param int    $a First param.    Note the missing @api tag
     * @param string $b Second param.
     */
    function doIt($a, $b) { .. }
}
Inheritance - @inheritdoc
class Parent {
    /**
     * Short description.
     *
     * This is my long description.
     *
     * @param int    $a First param.
     * @param string $b Second param.
     */
    function doIt($a, $b) { .. }
}

class Child extends Parent {
    /**
     * Short description.
     *
     * This method adds another bit of functionality
     * {@inheritdoc}
     *
     * @param int    $a First param.
     * @param string $b Second param.
     */
    function doIt($a, $b) { .. }
}
Inheritance - @inheritdoc
class Parent {
    /**
     * Short description.
     *
     * This is my long description.
     *
     * @param int    $a First param.
     * @param string $b Second param.
     */
    function doIt($a, $b) { .. }
}

class Child extends Parent {
    /**
     * Short description.
     *
     * This method adds another bit of functionality
     * This is my long description.
     *
     * @param int    $a First param.
     * @param string $b Second param.     DocBlox adds   this for you.
     */
    function doIt($a, $b) { .. }
}
References
➔   From Docblocks you can refer to other parts of
    the documentation using
    ●   @uses         * @uses MyNamespaceClass::function()

    ●   @see          * @see MyNamespaceClass::$property

    ●   @link and {@link .. }   * @link http://my.domain link text

    ●   @example      * @example gist:123456
BONUS: Templates
➔   Templates are a sequence of data
    transformations
➔   Can contain other templates
➔   May reside anywhere; even in your own project
    ●   which is recommended for custom templates
➔   A transformation invokes a Writer
BONUS: Templates
➔   Skeleton can be generated using the following
    command:

$ docblox theme:generate -t [PATH] -n [NAME]
BONUS: THEMES
➔   Are a collection of `views`
➔   Can be transformed to a specific output
➔   Templates can cherry pick from different
    themes
➔   Themes can 'use' eachother
Secret Feature
Plugins
➔   Starting with 0.15 DocBlox will support plugins
➔   Core functionality will be captured in a plugin
    (eat your own dog food)
➔   An easy pluggable event-based system
➔   Able to manipulate many functions in DocBlox
Plugins: invoking
➔   Add to configuration file as `plugins/plugin`
    element
➔   DocBlox Core plugin is assumed when nothing
    is defined
➔   Define path and class prefix for autoloading
➔   Can have options, added in configuration file
Plugins: Configuration
<?xml version="1.0" encoding="UTF-8" ?>
<docblox>
...
    <plugins>
        <plugin path="/my/path/to/plugin_folder"
                class_prefix="My_Plugin">
            <option name="my_option">
                value
            </option>
        </plugin>
    </plugins>
...
</docblox>
Plugins - Example
class DocBlox_Plugin_Core_Listener extends DocBlox_Plugin_Abstract
{

    /**
      * Apply a set of behaviours to the given structure.
      *
      * @docblox-event transformer.pre-transform
      *
      * @param sfEvent $data
      *
      * @return void
      */
    public function applyBehaviours(sfEvent $data)
    {
        …
    }
}
Plugins - Hooks
➔   No XSL hooks to start with
➔   Limited set to start with:
    ●   system.log, default logger
    ●   system.debug, logging of debug messages
    ●   parser.log, logging of parser errors
    ●   transformer.transform.pre, adding behaviour
    ●   transformer.transform.post, post processing of output
    ●   reflection.docblock-extraction.post, validating docblock
    ●   reflection.docblock.tag.export, transform tag to specialized form
Questions?
Mike van Riel
          mike.vanriel@naenius.com
          @mvriel
          http://blog.naenius.com
          http://joind.in/3661

 Links
 ●   http://www.docblox-project.org
 ●   http://github.com/mvriel/docblox




37 / 37                                 What is SCRUM?

Más contenido relacionado

La actualidad más candente

PHP - PDO Objects
PHP - PDO ObjectsPHP - PDO Objects
PHP - PDO ObjectsAJINKYA N
 
Postgresql Database Administration- Day4
Postgresql Database Administration- Day4Postgresql Database Administration- Day4
Postgresql Database Administration- Day4PoguttuezhiniVP
 
Adodb Pdo Presentation
Adodb Pdo PresentationAdodb Pdo Presentation
Adodb Pdo PresentationTom Rogers
 
Cascading at the Lyon Hadoop User Group
Cascading at the Lyon Hadoop User GroupCascading at the Lyon Hadoop User Group
Cascading at the Lyon Hadoop User Groupacogoluegnes
 
Postgresql Database Administration- Day3
Postgresql Database Administration- Day3Postgresql Database Administration- Day3
Postgresql Database Administration- Day3PoguttuezhiniVP
 
Unix primer
Unix primerUnix primer
Unix primerdummy
 
Applications for the Enterprise with PHP (CPEurope)
Applications for the Enterprise with PHP (CPEurope)Applications for the Enterprise with PHP (CPEurope)
Applications for the Enterprise with PHP (CPEurope)Robert Lemke
 
documents writing with LATEX
documents writing with LATEXdocuments writing with LATEX
documents writing with LATEXAnusha Vajrapu
 
第2回 Hadoop 輪読会
第2回 Hadoop 輪読会第2回 Hadoop 輪読会
第2回 Hadoop 輪読会Toshihiro Suzuki
 

La actualidad más candente (20)

Perl Intro 6 Ftp
Perl Intro 6 FtpPerl Intro 6 Ftp
Perl Intro 6 Ftp
 
Chapter 11
Chapter 11Chapter 11
Chapter 11
 
Devtools cheatsheet
Devtools cheatsheetDevtools cheatsheet
Devtools cheatsheet
 
Comparing SAS Files
Comparing SAS FilesComparing SAS Files
Comparing SAS Files
 
PHP - PDO Objects
PHP - PDO ObjectsPHP - PDO Objects
PHP - PDO Objects
 
Pig
PigPig
Pig
 
Files
FilesFiles
Files
 
Postgre sql unleashed
Postgre sql unleashedPostgre sql unleashed
Postgre sql unleashed
 
Postgresql Database Administration- Day4
Postgresql Database Administration- Day4Postgresql Database Administration- Day4
Postgresql Database Administration- Day4
 
Hive
HiveHive
Hive
 
Adodb Pdo Presentation
Adodb Pdo PresentationAdodb Pdo Presentation
Adodb Pdo Presentation
 
Cascading at the Lyon Hadoop User Group
Cascading at the Lyon Hadoop User GroupCascading at the Lyon Hadoop User Group
Cascading at the Lyon Hadoop User Group
 
Unit 4 lecture-3
Unit 4 lecture-3Unit 4 lecture-3
Unit 4 lecture-3
 
Postgresql Database Administration- Day3
Postgresql Database Administration- Day3Postgresql Database Administration- Day3
Postgresql Database Administration- Day3
 
Hbase
HbaseHbase
Hbase
 
Data manipulation language
Data manipulation languageData manipulation language
Data manipulation language
 
Unix primer
Unix primerUnix primer
Unix primer
 
Applications for the Enterprise with PHP (CPEurope)
Applications for the Enterprise with PHP (CPEurope)Applications for the Enterprise with PHP (CPEurope)
Applications for the Enterprise with PHP (CPEurope)
 
documents writing with LATEX
documents writing with LATEXdocuments writing with LATEX
documents writing with LATEX
 
第2回 Hadoop 輪読会
第2回 Hadoop 輪読会第2回 Hadoop 輪読会
第2回 Hadoop 輪読会
 

Destacado

Scrum in the Wild at #dpc10
Scrum in the Wild at #dpc10Scrum in the Wild at #dpc10
Scrum in the Wild at #dpc10Mike van Riel
 
Struggle & survival part 2
Struggle & survival part 2Struggle & survival part 2
Struggle & survival part 2Tyson Gannon
 
2010re9clinicalbeforeandafter
2010re9clinicalbeforeandafter2010re9clinicalbeforeandafter
2010re9clinicalbeforeandaftermarydelialuna
 
Nation Report Pt2[1]
Nation Report Pt2[1]Nation Report Pt2[1]
Nation Report Pt2[1]Tyson Gannon
 
Scrum in the Wild - phpBenelux 2011
Scrum in the Wild - phpBenelux 2011Scrum in the Wild - phpBenelux 2011
Scrum in the Wild - phpBenelux 2011Mike van Riel
 
California ch.6 and 13
California ch.6 and 13California ch.6 and 13
California ch.6 and 13Tyson Gannon
 

Destacado (7)

Scrum in the Wild at #dpc10
Scrum in the Wild at #dpc10Scrum in the Wild at #dpc10
Scrum in the Wild at #dpc10
 
Struggle & survival part 2
Struggle & survival part 2Struggle & survival part 2
Struggle & survival part 2
 
2010re9clinicalbeforeandafter
2010re9clinicalbeforeandafter2010re9clinicalbeforeandafter
2010re9clinicalbeforeandafter
 
Nation Report Pt2[1]
Nation Report Pt2[1]Nation Report Pt2[1]
Nation Report Pt2[1]
 
Scrum in the Wild - phpBenelux 2011
Scrum in the Wild - phpBenelux 2011Scrum in the Wild - phpBenelux 2011
Scrum in the Wild - phpBenelux 2011
 
SCRUM in the Wild
SCRUM in the WildSCRUM in the Wild
SCRUM in the Wild
 
California ch.6 and 13
California ch.6 and 13California ch.6 and 13
California ch.6 and 13
 

Similar a DocBlox: your source matters @ #pfc11

The Beauty and the Beast
The Beauty and the BeastThe Beauty and the Beast
The Beauty and the BeastBastian Feder
 
The Beauty And The Beast Php N W09
The Beauty And The Beast Php N W09The Beauty And The Beast Php N W09
The Beauty And The Beast Php N W09Bastian Feder
 
Php Documentor The Beauty And The Beast
Php Documentor The Beauty And The BeastPhp Documentor The Beauty And The Beast
Php Documentor The Beauty And The BeastBastian Feder
 
Fluent Development with FLOW3 1.0
Fluent Development with FLOW3 1.0Fluent Development with FLOW3 1.0
Fluent Development with FLOW3 1.0Robert Lemke
 
Getting Into FLOW3 (DPC12)
Getting Into FLOW3 (DPC12)Getting Into FLOW3 (DPC12)
Getting Into FLOW3 (DPC12)Robert Lemke
 
Fluent Development with FLOW3 1.0
Fluent Development with FLOW3 1.0Fluent Development with FLOW3 1.0
Fluent Development with FLOW3 1.0Robert Lemke
 
Using Document Databases with TYPO3 Flow
Using Document Databases with TYPO3 FlowUsing Document Databases with TYPO3 Flow
Using Document Databases with TYPO3 FlowKarsten Dambekalns
 
Introduction To Ant
Introduction To AntIntroduction To Ant
Introduction To AntRajesh Kumar
 
IPCSE12: Getting into FLOW3
IPCSE12: Getting into FLOW3IPCSE12: Getting into FLOW3
IPCSE12: Getting into FLOW3Robert Lemke
 
AWS Hadoop and PIG and overview
AWS Hadoop and PIG and overviewAWS Hadoop and PIG and overview
AWS Hadoop and PIG and overviewDan Morrill
 
FLOW3 Tutorial - T3CON11 Frankfurt
FLOW3 Tutorial - T3CON11 FrankfurtFLOW3 Tutorial - T3CON11 Frankfurt
FLOW3 Tutorial - T3CON11 FrankfurtRobert Lemke
 
BITS: Introduction to Linux - Text manipulation tools for bioinformatics
BITS: Introduction to Linux - Text manipulation tools for bioinformaticsBITS: Introduction to Linux - Text manipulation tools for bioinformatics
BITS: Introduction to Linux - Text manipulation tools for bioinformaticsBITS
 
Getting Into FLOW3 (TYPO312CA)
Getting Into FLOW3 (TYPO312CA)Getting Into FLOW3 (TYPO312CA)
Getting Into FLOW3 (TYPO312CA)Robert Lemke
 
Building maintainable javascript applications
Building maintainable javascript applicationsBuilding maintainable javascript applications
Building maintainable javascript applicationsequisodie
 
Ant_quick_guide
Ant_quick_guideAnt_quick_guide
Ant_quick_guideducquoc_vn
 
FFW Gabrovo PMG - PHP OOP Part 3
FFW Gabrovo PMG - PHP OOP Part 3FFW Gabrovo PMG - PHP OOP Part 3
FFW Gabrovo PMG - PHP OOP Part 3Toni Kolev
 

Similar a DocBlox: your source matters @ #pfc11 (20)

Inside DocBlox
Inside DocBloxInside DocBlox
Inside DocBlox
 
The Beauty and the Beast
The Beauty and the BeastThe Beauty and the Beast
The Beauty and the Beast
 
The Beauty And The Beast Php N W09
The Beauty And The Beast Php N W09The Beauty And The Beast Php N W09
The Beauty And The Beast Php N W09
 
Php Documentor The Beauty And The Beast
Php Documentor The Beauty And The BeastPhp Documentor The Beauty And The Beast
Php Documentor The Beauty And The Beast
 
Fluent Development with FLOW3 1.0
Fluent Development with FLOW3 1.0Fluent Development with FLOW3 1.0
Fluent Development with FLOW3 1.0
 
Getting Into FLOW3 (DPC12)
Getting Into FLOW3 (DPC12)Getting Into FLOW3 (DPC12)
Getting Into FLOW3 (DPC12)
 
Fluent Development with FLOW3 1.0
Fluent Development with FLOW3 1.0Fluent Development with FLOW3 1.0
Fluent Development with FLOW3 1.0
 
Using Document Databases with TYPO3 Flow
Using Document Databases with TYPO3 FlowUsing Document Databases with TYPO3 Flow
Using Document Databases with TYPO3 Flow
 
Introduction To Ant
Introduction To AntIntroduction To Ant
Introduction To Ant
 
IPCSE12: Getting into FLOW3
IPCSE12: Getting into FLOW3IPCSE12: Getting into FLOW3
IPCSE12: Getting into FLOW3
 
latest slide
latest slidelatest slide
latest slide
 
testing add
testing addtesting add
testing add
 
AWS Hadoop and PIG and overview
AWS Hadoop and PIG and overviewAWS Hadoop and PIG and overview
AWS Hadoop and PIG and overview
 
FLOW3 Tutorial - T3CON11 Frankfurt
FLOW3 Tutorial - T3CON11 FrankfurtFLOW3 Tutorial - T3CON11 Frankfurt
FLOW3 Tutorial - T3CON11 Frankfurt
 
BITS: Introduction to Linux - Text manipulation tools for bioinformatics
BITS: Introduction to Linux - Text manipulation tools for bioinformaticsBITS: Introduction to Linux - Text manipulation tools for bioinformatics
BITS: Introduction to Linux - Text manipulation tools for bioinformatics
 
Getting Into FLOW3 (TYPO312CA)
Getting Into FLOW3 (TYPO312CA)Getting Into FLOW3 (TYPO312CA)
Getting Into FLOW3 (TYPO312CA)
 
Building maintainable javascript applications
Building maintainable javascript applicationsBuilding maintainable javascript applications
Building maintainable javascript applications
 
Ant_quick_guide
Ant_quick_guideAnt_quick_guide
Ant_quick_guide
 
Mongo-Drupal
Mongo-DrupalMongo-Drupal
Mongo-Drupal
 
FFW Gabrovo PMG - PHP OOP Part 3
FFW Gabrovo PMG - PHP OOP Part 3FFW Gabrovo PMG - PHP OOP Part 3
FFW Gabrovo PMG - PHP OOP Part 3
 

Último

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 

Último (20)

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 

DocBlox: your source matters @ #pfc11

  • 2. Mike van Riel Lead Developer of DocBlox Technical Lead Developer for Unet B.V. Active with PHP since 2002
  • 3. What is DocBlox? ➔ Documentation Generation Application (DGA) for PHP ➔ Inspired by phpDocumentor and JavaDoc ➔ Generates documentation from your source code ➔ Uses the structure and comments of your source code
  • 4.
  • 5. Why DocBlox? ➔ Support for PHP 5.3+ features ➔ Performance, improved with up to 80% ➔ Memory usage, large projects use 100MB instead of gigabytes ➔ Active project, every month new features ● Bug fixes even more frequent ➔ QA Tool for in-source documentation
  • 6. Feature DocBlox phpDocumentor Doxygen PHP 5.3+ Support Can cope with large projects Search Incremental Parsing Doctrine Annotations XML output Class inheritance diagram PDF DocBook Linking to external documentation Markup of descriptions using Markdown Latex support Parse directly from phar Secret feature
  • 9. Installation Installation via PEAR $ pear channel-discover pear.docblox-project.org $ pear channel-discover pear.michelf.com $ pear install docblox/DocBlox-beta Manual installation See http://docs.docblox-project.org/Installation.html#manual-installation
  • 10. Running docblox $ docblox -d [FOLDER] -f [FILE] -t [DESTINATION] OR $ docblox parse -d [FOLDER] -f [FILE] -t [STAGING] $ docblox transform -s [STAGING]/structure.xml -t [DESTINATION]
  • 11. Running docblox: Incremental parsing $ docblox parse -d [FOLDER] -f [FILE] -t [STAGING] $ docblox transform -s [STAGING]/structure.xml -t [DESTINATION] ➔ Structure file is written to a staging location ➔ Every parsing run DocBlox will know if a file has changed ● If so, re-parse ● If not, re-use ➔ Advantages: ● Parsing speed is increased ● Structure file is not distributed along with rest of documentation
  • 12. Running docblox: Incremental parsing $ docblox parse -d [FOLDER] -f [FILE] -t [STAGING] $ docblox transform -s [STAGING]/structure.xml -t [DESTINATION] ➔ Structure file is written to a staging location ➔ Every parsing run DocBlox will know if a file has changed ● If so, re-parse ● If not, re-use ➔ Advantages: ● Parsing speed is increased ● Structure file is not distributed along with rest of documentation
  • 13. Running docblox: Options $ docblox –-help -h [--help] Show this help message -q [--quiet] Silences the output and logging -c [--config] [STRING] Configuration filename OR "none", when this option is omitted DocBlox tries to load the docblox.xml or docblox.dist.xml from the current working directory -f [--filename] STRING Comma-separated list of files to parse. The wildcards ? and * are supported -d [--directory] STRING Comma-separated list of directories to (recursively) parse. -t [--target] [STRING] Path where to store the generated output (optional, defaults to "output") -e [--extensions] [STRING] Optional comma-separated list of extensions to parse, defaults to php, php3 and phtml -i [--ignore] [STRING] Comma-separated list of file(s) and directories that will be ignored. Wildcards * and ? are supported -m [--markers] [STRING] Comma-separated list of markers/tags to filter, (optional, defaults to: "TODO,FIXME") -v [--verbose] Provides additional information during parsing, usually only needed for debugging purposes --title [STRING] Sets the title for this project; default is the DocBlox logo --template [STRING] Sets the template to use when generating the output --force Forces a full build of the documentation, does not increment existing documentation --validate Validates every processed file using PHP Lint, costs a lot of performance --parseprivate Whether to parse DocBlocks tagged with @internal --visibility [STRING] Specifies the parse visibility that should be displayed in the documentation (comma seperated e.g. "public,protected") --defaultpackagename [STRING] name to use for the default package. If not specified, uses "default"
  • 14. Configuration ➔ Stored as XML ➔ docblox.dist.xml or docblox.xml <?xml version="1.0" encoding="UTF-8" ?> <docblox> <parser> <default-package-name>DocBlox</default-package-name> <target>data/output</target> </parser> <transformer> <target>data/output</target> </transformer> <files> <directory>.</directory> <ignore>tests/*</ignore> </files> </docblox>
  • 15. Writing Docblocks ➔ Docblocks are used to tag elements with meta-data ➔ Specific type of comment: /** … */ ➔ Three parts: ● Short description, one liner ● Long description, a complete description of the element ● Tags, annotations which provide additional information
  • 16. Docblocks - II /** * This is a short description. * * This is a long description, which may span * multiple lines and contain {@inline} tags and * can be *styled* with `Markdown`. * * @param string $a This is the first variable. * @param Exception $b This is the second variable. * @param array $c This is the third variable. * * @return void */ function myFunction($a, Exception $b, array $c) { }
  • 17. Supported elements ➔ Files ➔ Namespaces ➔ Includes & requires ➔ Classes ➔ Traits (not yet, is coming) ➔ Functions, methods and closures ➔ Properties ➔ Constants, global and class
  • 18. Supported tags ➔ @abstract ➔ @ignore ➔ @since ➔ @access ➔ @internal ➔ @static ➔ @api ➔ @license ➔ @staticvar ➔ @author ➔ @link ➔ @subpackage ➔ @category ➔ @method ➔ @throws / @throw ➔ @copyright ➔ @name ➔ @todo ➔ @deprecated ➔ @package ➔ @tutorial ➔ @example ➔ @param ➔ @final ➔ @property ➔ @uses / @usedby ➔ @filesource ➔ @return ➔ @var ➔ @global ➔ @see ➔ @version
  • 19. Inheritance ➔ Docblocks inherit by default (if not overridden) ● Short description ● Long description – Can be augmented using {@inheritdoc} ● Specific tags
  • 20. Inheritance - Classes ➔ Methods ➔ Properties ➔ Tags ● @package ● @subpackage – if @package is the same as parent ● @version ● @copyright ● @author
  • 21. Inheritance - METHODS ➔ Tags ● @param ● @return ● @throw / @throws ● @version ● @copyright ● @author
  • 22. Inheritance - Properties ➔ Tags ● @var ● @version ● @copyright ● @author
  • 23. Inheritance - Example class Parent { /** * Short description. * * @api * @param int $a First param. * @param string $b Second param. */ function doIt($a, $b) { .. } } class Child extends Parent { /** * Short description. * DocBlox adds this for you. * @param int $a First param. Note the missing @api tag * @param string $b Second param. */ function doIt($a, $b) { .. } }
  • 24. Inheritance - @inheritdoc class Parent { /** * Short description. * * This is my long description. * * @param int $a First param. * @param string $b Second param. */ function doIt($a, $b) { .. } } class Child extends Parent { /** * Short description. * * This method adds another bit of functionality * {@inheritdoc} * * @param int $a First param. * @param string $b Second param. */ function doIt($a, $b) { .. } }
  • 25. Inheritance - @inheritdoc class Parent { /** * Short description. * * This is my long description. * * @param int $a First param. * @param string $b Second param. */ function doIt($a, $b) { .. } } class Child extends Parent { /** * Short description. * * This method adds another bit of functionality * This is my long description. * * @param int $a First param. * @param string $b Second param. DocBlox adds this for you. */ function doIt($a, $b) { .. } }
  • 26. References ➔ From Docblocks you can refer to other parts of the documentation using ● @uses * @uses MyNamespaceClass::function() ● @see * @see MyNamespaceClass::$property ● @link and {@link .. } * @link http://my.domain link text ● @example * @example gist:123456
  • 27. BONUS: Templates ➔ Templates are a sequence of data transformations ➔ Can contain other templates ➔ May reside anywhere; even in your own project ● which is recommended for custom templates ➔ A transformation invokes a Writer
  • 28. BONUS: Templates ➔ Skeleton can be generated using the following command: $ docblox theme:generate -t [PATH] -n [NAME]
  • 29. BONUS: THEMES ➔ Are a collection of `views` ➔ Can be transformed to a specific output ➔ Templates can cherry pick from different themes ➔ Themes can 'use' eachother
  • 31. Plugins ➔ Starting with 0.15 DocBlox will support plugins ➔ Core functionality will be captured in a plugin (eat your own dog food) ➔ An easy pluggable event-based system ➔ Able to manipulate many functions in DocBlox
  • 32. Plugins: invoking ➔ Add to configuration file as `plugins/plugin` element ➔ DocBlox Core plugin is assumed when nothing is defined ➔ Define path and class prefix for autoloading ➔ Can have options, added in configuration file
  • 33. Plugins: Configuration <?xml version="1.0" encoding="UTF-8" ?> <docblox> ... <plugins> <plugin path="/my/path/to/plugin_folder" class_prefix="My_Plugin"> <option name="my_option"> value </option> </plugin> </plugins> ... </docblox>
  • 34. Plugins - Example class DocBlox_Plugin_Core_Listener extends DocBlox_Plugin_Abstract { /** * Apply a set of behaviours to the given structure. * * @docblox-event transformer.pre-transform * * @param sfEvent $data * * @return void */ public function applyBehaviours(sfEvent $data) { … } }
  • 35. Plugins - Hooks ➔ No XSL hooks to start with ➔ Limited set to start with: ● system.log, default logger ● system.debug, logging of debug messages ● parser.log, logging of parser errors ● transformer.transform.pre, adding behaviour ● transformer.transform.post, post processing of output ● reflection.docblock-extraction.post, validating docblock ● reflection.docblock.tag.export, transform tag to specialized form
  • 37. Mike van Riel mike.vanriel@naenius.com @mvriel http://blog.naenius.com http://joind.in/3661 Links ● http://www.docblox-project.org ● http://github.com/mvriel/docblox 37 / 37 What is SCRUM?