2017 © Pedro Peláez
 

library textract

Extracts and combines multiline comments from php files

image

flsouto/textract

Extracts and combines multiline comments from php files

  • Saturday, November 5, 2016
  • by flsouto
  • Repository
  • 0 Watchers
  • 1 Stars
  • 11 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

textract

Overview

This command line tool allows you to extract multiline comments from php source files producing a string with all matched comments. This will not extract doc blocks, only texts between /* and */., (*1)

Installation

Either clone this repo or use composer:, (*2)

composer require flsouto/textract

For convenience I recommend you create an alias to the "process" script:, (*3)

alias textract='php /path/to/flsouto/textract/process.php'

Usage

Say we have created two scripts containing multiline comments:, (*4)

source1.php:, (*5)

<?php

/*
This line and
this other line
must be extracted
*/
function test(){
    return '';
}

/* 
This line should also be extracted
*/

source2.php:, (*6)

<?php

/*
More text from source2
*/

Now, if we run textract from the command line:, (*7)

textract source1.php source2.php

We get this output:, (*8)

This line and
this other line
must be extracted

This line should also be extracted

More text from source2

Instead, we could write:, (*9)

textract source1.php source2.php > output.md

And we would have the output saved to the output.md file., (*10)

Final thoughts

I use this utility for producing documentations out of the source code itself because I think it speeds up the process a lot. Also, if you are interested in this kind of thing, you should take a look at this other utility I created which allows you to extract snippets from your source code, execute them, and paste both the snippet and output in your markdown documentation: markdown-x, (*11)

The Versions

05/11 2016

dev-master

9999999-dev

Extracts and combines multiline comments from php files

  Sources   Download

by Fabio Souto

development command-line documentation parsers

05/11 2016

1.0.0

1.0.0.0

Extracts and combines multiline comments from php files

  Sources   Download

by Fabio Souto

development command-line documentation parsers