Regex.infoArray

$info = [ 'matchList'=>$matches, // Array of all matches 'lineStart' => -1, // (not implemented, @TODO) Line in file/text that your match starts on 'lineEnd' => -1, // (not implemented, @TODO) Line in file/text that your match ends on 'text' => $text, // 'regIndex' => null, ];

Regex.onMatchBlock

@param $name The name of the matched regex set @param $match an individual preg_match_all match, using PREG_SET_ORDER ([0] is full match. [1] is capture group & so on) @param \Tlf\Scrawl\File $file The file that was matched on. Or null if not given to Regex::matchRegexes() @param $info an array of additional information. print_r(array_keys($info)) or look at the docs

Regex.structure

protected $regex = [ 'wrappedGenericBlock' => [ // 'wrappedGenericBlock' is the function to call // 'function'=> 'functionName' <- to override the regex set's name //For this regex: $1 is the key, $2 is the code, $3 is the @export_end line '/\ *(?://|#)\ @export_start(([^)]))((?:.|\r|\n)+)\ *(?://|#)\ *(@export_end(\1))/', // You can list additional regexes here ] ];

Regex.onMatchFull

/**

  • @param $name The name of the matched regex set

  • @param $match an individual preg_match_all match, using PREG_SET_ORDER ([0] is full match. [1] is capture group & so on)

  • @param \Tlf\Scrawl\File $file The file that was matched on. Or null if not given to Regex::matchRegexes()

  • @param $info an array of additional information. print_r(array_keys($info)) or look at the docs

  • @export(Regex.onMatchBlock) */ public function wrappedGenericBlock($name, $match, ?File $file, $info) { $exportBlock = $match;

    $key = $exportBlock[1];
    $code = $exportBlock[2];
    $exportLine = $exportBlock[3];
    $code = Utility::trimTextBlock($code);
    
    $this->scrawl->addOutput('key', $key, $code);
    

}

Regex.invoke

public function onSourceFileFound($file){ \Tlf\Scrawl\Regex::matchRegexes($this, $this->regex, $file); }

Technical.deleteExistingDocs.sanityCheck

if (!$dryRun&&$this->configs['deleteExistingDocs'][0]===true){ $root = $this->rootDir; $root = realpath($root); $docsDir = $this->rootDir.'/'.$this->configs['dir.docs'][0]; $docsDir = realpath($docsDir);

// To avoid removing things like /home/user/ and /var/www/ or shorter paths
// My assumption for shortest path is: /home/user/asubdir/projectdirs
// Projects COULD be at /home/user/projectdir, but mine likely never will be... & I think that seems silly.
// I expect Windows to have even longer base paths?
$rootSlashArray = explode('/', str_replace('\\', '/', $root));
$docSlashArray = explode('/', str_replace('\\','/', $docsDir));
if (strlen($docsDir)>strlen($root)
    && $root!=''
    && count($rootSlashArray)>3
    && count($docSlashArray) > count($rootSlashArray)
    && strpos($docsDir, $root)===0
) {
    \Tlf\Scrawl\Utility::DANGEROUS_removeNonEmptyDirectory($docsDir);
}

}

Configs.defaultsCode

protected function inferDefaultOptions(){ $defaults = []; $src = $this->pwd;

if (is_dir($src.'/docs'))$defaults['dir.docs'] = 'docs';
else if (is_dir($src.'/doc'))$defaults['dir.docs'] = 'doc';
else $defaults['dir.docs'] = 'doc';

if (is_dir($src.'/docs-src'))$defaults['dir.template'] = 'docs-src';
else if (is_dir($src.'/doc-src'))$defaults['dir.template'] = 'doc-src';
else $defaults['dir.template'] = 'docs-src';

if (is_dir($src.'/src'))$defaults['dir.code'] = 'src';
else if (is_dir($src.'/code'))$defaults['dir.code'] = 'code';
else $defaults['dir.code'] = 'src';

if (is_file($src.'/.config/scrawl.json')){
    $defaults['file.conf'] = '.config/scrawl.json';
} else if (is_file($src.'/.scrawl.json')){
    $defaults['file.conf'] = '.scrawl.json';
} else {
    $defaults['file.conf'] = '.config/scrawl.json';
}

$defaults['file.code.ext'] = '*';

$defaults['file.template.ext'] = '.src.md';

$defaults['deleteExistingDocs'] = false;

$defaults['markdown.preserveNewLines'] = true;
$defaults['markdown.prependGenNotice'] = true;

$defaults['scrawl.ext'] = [];

$defaults['autoload'] = ['classmap'=>[]];

$defaults['readme.copyFromDocs'] = true;


return $defaults;

}

Test.GeneralTest.testKeysExported

This is a docblock export, here for testing purposes.

Test.GeneralTest

The GeneralTest class handles most tests of this library. This key is here purely to test the @export feature

Example.DocBlockExport

/**

  • This is a docblock export, here for testing purposes.
  • @export(Test.GeneralTest.testKeysExported) */

Configs.list

  • dir.docs: docs or doc or doc
  • dir.template: docs-src or doc-src or docs-src
  • dir.code: src or code or src
  • file.conf: .config/scrawl.json or .scrawl.json or .config/scrawl.json
  • file.code.ext: *
  • file.template.ext: .src.md
  • deleteExistingDocs: false
  • markdown.preserveNewLines: true
  • markdown.prependGenNotice: true
  • scrawl.ext: []
  • readme.copyFromDocs: true

Extensions.EventsList

File code/Scrawl.php

  • Group: default, Method: onBuildStart, Calling Line: $this->extCall('default', 'onBuildStart');
  • Group: default, Method: onFileListPrepared, Calling Line: $this->extCall('default', 'onFileListPrepared', $codeFiles);
  • Group: default, Method: onSourceFileFound, Calling Line: $this->extCall('default', 'onSourceFileFound', $cf);
  • Group: default, Method: onSourceFilesDone, Calling Line: $this->extCall('default', 'onSourceFilesDone');
  • Group: default, Method: onTemplatesListPrepared, Calling Line: $this->extCall('default', 'onTemplatesListPrepared', $templateFiles);
  • Group: default, Method: onTemplateFileFound, Calling Line: $this->extCall('default', 'onTemplateFileFound', $tf);
  • Group: default, Method: onPreWriteFiles, Calling Line: $this->extCall('default', 'onPreWriteFiles');
  • Group: default, Method: onWillWriteFile, Calling Line: $this->extCall('default', 'onWillWriteFile', $of);

Extensions.CustomCall

File code/SharedExtensions/DocBlockHandler.php

  • Group: docblock, Method: n/a, Calling Line: foreach ($this->scrawl->getExtensions('docblock') as $callable){