Skip to content

Commit

Permalink
Updated with dark mode details.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mistralys committed Mar 15, 2021
1 parent 3791b85 commit d4281f3
Showing 1 changed file with 36 additions and 18 deletions.
54 changes: 36 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,29 +29,29 @@ will display them.
```php
<?php

declare(strict_types=1);
declare(strict_types=1);

use Mistralys\MarkdownViewer\DocsManager;
use Mistralys\MarkdownViewer\DocsViewer;
use Mistralys\MarkdownViewer\DocsManager;
use Mistralys\MarkdownViewer\DocsViewer;

if(!file_exists('vendor/autoload.php')) {
die('Please run <code>composer install</code> first.');
}

if(!file_exists('vendor/autoload.php')) {
die('Please run <code>composer install</code> first.');
}
require_once 'vendor/autoload.php';

require_once 'vendor/autoload.php';
$manager = new DocsManager();

$manager = new DocsManager();

// Add all the files you wish to view here, along with
// a title that will be shown in the UI.
$manager->addFile('Title of the file', '/path/to/documentation.md');
// Add all the files you wish to view here, along with
// a title that will be shown in the UI.
$manager->addFile('Title of the file', '/path/to/documentation.md');

// The viewer needs to know the URL to the vendor/ folder, relative
// to the script. This is needed to load the clientside dependencies,
// like jQuery and Bootstrap.
(new DocsViewer($manager, '/url/to/vendor'))
->setTitle('Documentation')
->display();
// The viewer needs to know the URL to the vendor/ folder, relative
// to the script. This is needed to load the clientside dependencies,
// like jQuery and Bootstrap.
(new DocsViewer($manager, '/url/to/vendor'))
->setTitle('Documentation')
->display();
```

## Adding files
Expand Down Expand Up @@ -94,6 +94,24 @@ $manager = new DocsManager();
$manager->addFolder('/path/to/files', false, 'txt');
```

## Dark mode

To turn on dark mode, simply use `makeDarkMode()`:

```php
use Mistralys\MarkdownViewer\DocsViewer;
use Mistralys\MarkdownViewer\DocsManager;

$manager = new DocsManager();

// Configure the files

(new DocsViewer($manager, '/url/to/vendor'))
->setTitle('Documentation')
->makeDarkMode()
->display();
```

## Viewing the example

The bundled example is built exactly like the example above, and will display
Expand Down

0 comments on commit d4281f3

Please sign in to comment.