Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hollodotme/treemdown-multi

TreeMDown with multiple trees of markdown files
https://github.com/hollodotme/treemdown-multi

markdown-viewer multiple-trees php

Last synced: about 1 month ago
JSON representation

TreeMDown with multiple trees of markdown files

Awesome Lists containing this project

README

        

# TreeMDown-Multi

This is an extension of [TreeMDown](https://github.com/hollodotme/TreeMDown) to handle and display multiple trees of markdown files.

## Installation

### Via composer

Checkout the current release at [packagist.org](http://packagist.org/hollodotme/treemdown-multi).

Add to your `composer.json`:

```json
{
"require": {
"hollodotme/treemdown-multi": "~1.0"
}
}
```

## Basic usage

```php
addTree( new TreeMDown(__DIR__ . '/my_docs'), 'My documents');
$multi_view->addTree( new TreeMDown(__DIR__ . '/your_docs'), 'Your documents');

$multi_view->display();

```

## Advanced Usage

You can configure each of the TreeMDown instances to fit your needs.
Please visit the [documentation of TreeMDown](http://hollo.me/treemdown) to see all available options.

Here is a simplyfied example:

```php
hideEmptyFolders();
$tree1->setProjectName( 'Your markdown files' );
$tree1->enablePrettyNames();
$tree1->hideFilenameSuffix();

// Configure other dir
// Note: No output options set to show the difference
$tree2 = new TreeMDown( '/path/to/other/markdown/files' );
$tree2->setProjectName( 'Other markdown files' );

// Make "Yours" default (3rd parameter)
$multi_view->addTreeMDown( $tree1, 'Yours', true );
$multi_view->addTreeMDown( $tree2, 'Others' );

// Display
$multi_view->display();

```