PHP code example of awema-pl / module-docs

1. Go to this page and download the library: Download awema-pl/module-docs 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/ */

    

awema-pl / module-docs example snippets


Docs::routes();

use Docs;

Docs::all($withDocs = true);

Docs::get(['package1' => ['1.0', '2.6'], 'package2' => '1.3', 'package3'], 'package4', $withDocs = true);

Docs::package('package1', $withDocs = true);

Docs::versions('package1', $withDocs = true);

Docs::version('package1', '1.0', $withDocs = true);

Docs::files('package1', '1.0', $withDocs = true);

Docs::file('package1', '1.0', 'file.md');

Docs::fileContent('package1', '1.0', 'file.md');

Docs::list();

Docs::list('package1');

Docs::list('package1', '1.0');

Docs::list('package1', '1.0', 'file.md');

[
  [
    "name" => "package1",
    "versions" => [
      [ 
        "name" => "1.0",
        "files" => [
          [
            "name" => "index.md",
            "content" => "# Title"
          ],
          [
            "name" => "doc1.md",
            "content" => "Doc 1 content"
          ]
        ]
      ],
      ...
      [ 
        "name" => "2.6",
        "files" => [ ... ]
      ]
    ]
  ],
  ...  
  [
    "name" => "package4",
    "versions" => [ ... ]
  ]
]

[
  "name" => "package1",
  "versions" => [
    [ 
      "name" => "1.0",
      "files" => [
        [
          "name" => "index.md",
          "content" => "# Title"
        ],
        [
          "name" => "doc1.md",
          "content" => "Doc 1 content"
        ]
      ]
    ],
    ...
    [ 
      "name" => "2.6",
      "files" => [ ... ]
    ]
  ]
]

[
  [ 
    "name" => "1.0",
    "files" => [
      [
        "name" => "index.md",
        "content" => "# Title"
      ],
      [
        "name" => "doc1.md",
        "content" => "Doc 1 content"
      ]
    ]
  ],
  ...
  [ 
    "name" => "2.6",
    "files" => [ ... ]
  ]
]

[ 
  "name" => "1.0",
  "files" => [
    [
      "name" => "index.md",
      "content" => "# Title"
    ],
    [
      "name" => "doc1.md",
      "content" => "Doc 1 content"
    ]
  ]
]

[
  [
    "name" => "index.md",
    "content" => "# Title"
  ],
  [
    "name" => "doc1.md",
    "content" => "Doc 1 content"
  ]
]

[
  "name" => "index.md",
  "content" => "# Title"
]

[
  "package1",
  "package2",
  ...
  "package6"
]

[
  "0.1",
  "0.2",
  ...
  "2.18"
]

[
  "index.md",
  "doc1.md",
  ...
  "doc4.md"
]
bash
php artisan vendor:publish --provider="AwemaPL\Docs\DocsServiceProvider" --tag="views"
bash
php artisan vendor:publish --provider="AwemaPL\Docs\DocsServiceProvider" --tag="config"