PHP code example of joeymckenzie / artisense

1. Go to this page and download the library: Download joeymckenzie/artisense 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/ */

    

joeymckenzie / artisense example snippets


return [

    /*
    |--------------------------------------------------------------------------
    | Documentation version
    |--------------------------------------------------------------------------
    |
    | Specifies the version of the documentation to use, with both numbered
    | versions and master available. By default, the most recent numbered
    | is used if no version is specified while attempting to download.
    |
    */

    'versions' => DocumentationVersion::VERSION_12,

    /*
    |--------------------------------------------------------------------------
    | Output Formatter
    |--------------------------------------------------------------------------
    |
    | Specifies the optional formatter that the output should use for markdown.
    | Markdown content will be returned from artisense and can be formatted
    | Using any formatting tools installed wherever artisense is running.
    |
    */

    'formatter' => BasicMarkdownFormatter::class,

    /*
    |--------------------------------------------------------------------------
    | Search Preference
    |--------------------------------------------------------------------------
    |
    | Specifies the search preferences to use when querying for documentation.
    | Ordered searches are used by default, returning results using ordered
    | phrase matching. You may choose your preference to adjust results.
    |
    */

    'search' => [
        'preference' => SearchPreference::ORDERED,
        'proximity' => 10,
    ],

    /*
    |--------------------------------------------------------------------------
    | Retain Artifacts
    |--------------------------------------------------------------------------
    |
    | Specifies the artificat retention policy artisense should use when processing
    | Laravel documentation. If set to true, documentation markdown files along
    | zip archives will be retained within the storage folder during install.
    |
    */

    'retain_artifacts' => true,

];

return [
    // Accepts a singe version
    'versions' => DocumentationVersion::VERSION_12,
    
    // You may also specify multiple versions
    'versions' => [
        DocumentationVersion::VERSION_11,
        DocumentationVersion::VERSION_12,
        DocumentationVersion::MASTER,
    ],
];

return [

    // Other configurations...
    
    // Specify a version using the `DocumentationVersion` enum
    'versions' => DocumentationVersion::MASTER
    
    // Specify versions using the `DocumentationVersion` enum
    'versions' => [
        DocumentationVersion::VERSION_12,
        DocumentationVersion::VERSION_11,
        DocumentationVersion::MASTER,
    ]
    
]

return [

    // Other configuration...

    'formatter' => \App\Support\Formatters\CustomMarkdownFormatter::class,

];



declare(strict_types=1);

namespace App\Support\Formatters;

use Artisense\Contracts\OutputFormatterContract;

final class TestOutputFormatter implements OutputFormatterContract
{
    public function format(string $markdown): string
    {
        return "FORMATTED: $markdown";
    }
}
bash
php artisan vendor:publish --tag="artisense-config"
bash
php artisan artisense:install