PHP code example of satisfactory-tools / docs-parser

1. Go to this page and download the library: Download satisfactory-tools/docs-parser library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

satisfactory-tools / docs-parser example snippets


use SFTools\Data\Parser\DocsParser;

$parser = new DocsParser;
$schema = $parser->parse(file_get_contents(__DIR__ . '/docs.json')); // $schema is SFTools\Data\Schema\DocsSchema

// You can also export the schema in any format you like
use SFTools\Data\Export\WikiExporter;

$exporter = new WikiExporter;
$output = $exporter->export($schema);

// $output is an array of [file prefix => file content]; the prefix may be an empty string for single-file formats

$transformer = new MyTransformer;
$schema->transform($transformer);

$parser = new DocsParser([new MyHandler], [new MyTransformer]);
shell
composer install
php bin/docsParser [command]