https://github.com/hollodotme/treemdown
[triː <'em> daʊn] PHP single page markdown tree browser
https://github.com/hollodotme/treemdown
markdown-viewer php tree
Last synced: 12 months ago
JSON representation
[triː <'em> daʊn] PHP single page markdown tree browser
- Host: GitHub
- URL: https://github.com/hollodotme/treemdown
- Owner: hollodotme
- License: mit
- Created: 2014-08-09T13:32:42.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2021-06-28T07:44:14.000Z (almost 5 years ago)
- Last Synced: 2025-07-07T07:47:32.290Z (12 months ago)
- Topics: markdown-viewer, php, tree
- Language: PHP
- Homepage: https://hollo.me/treemdown/
- Size: 798 KB
- Stars: 14
- Watchers: 2
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/hollodotme/TreeMDown)
[](https://coveralls.io/github/hollodotme/TreeMDown?branch=master)
[](https://packagist.org/packages/hollodotme/TreeMDown)
[](https://packagist.org/packages/hollodotme/TreeMDown)
[](https://packagist.org/packages/hollodotme/TreeMDown)
# TreeMDown `[triː <'em> daʊn]`
... is a single page PHP application for browsing markdown documents in a file structure and translating them to HTML.
> **[A full featured demo can be found here!](http://hollo.me/treemdown)**

## News
You like TreeMDown and you are interested in browsing multiple trees of markdown files?
> Check out [TreeMDown-Multi](https://github.com/hollodotme/TreeMDown-Multi)!
> [Live demo is available here.](http://hollo.me/treemdown-multi/)
### Latest updates
* Updated [highlightjs](https://highlightjs.org) to version 8.3
* Fixed syntax highlighting of markdown code
* Handling internal links between markdown files in the same tree (see the documentation)
## Requirements / Dependencies
* PHP >= 5.3
* [Parsedown-Extra](https://github.com/erusev/parsedown-extra) via composer
* Webserver (Apache, nginx, etc.)
**Note:** This application is currently tested on linux systems only.
## Installation
### Via composer
To get the latest stable release, check the versions at [Packagist](http://packagist.org) and add to your `composer.json`:
```json
{
"require": {
"hollodotme/treemdown": "~1.0"
}
}
```
To get the bleeding edge version add this to your `composer.json`:
```json
{
"repositories": [
{
"type": "vcs",
"url": "git@github.com:hollodotme/TreeMDown.git"
}
],
"require": {
"hollodotme/treemdown": "dev-master"
}
}
```
Now include the `vendor/autoload.php` and get started.
## Usage
### Basic
```php
display();
```
### With personalization and options
```php
setProjectName('Your project name');
# Set a short description
$treemdown->setShortDescription('Your short description');
# Set a company name
$treemdown->setCompanyName('Your company name');
# [Output options]
#
# Show or hide empty folders in tree
#
# Default: Empty folders will be displayed
#
#$treemdown->showEmptyFolders();
$treemdown->hideEmptyFolders();
# Set the default file that is shown if no file or path is selected (initial state)
# The file path must be __relative__ to the root directory above: '/path/to/your/markdown/files'
#
# Default: index.md
#
$treemdown->setDefaultFile('README.md');
# Show/Hide filename suffix
#
# Default: Suffix is shown
#
#$tmd->showFilenameSuffix();
$tmd->hideFilenameSuffix();
# Prettify directory and file names
# This removes all "-" and "_" from the names displayed in the tree
#
# Default: Pretty names are disabled
#
#$tmd->disablePrettyNames();
$tmd->enablePrettyNames();
# [File system options]
#
# Set the patterns for files you want to include
#
# Default: array( '*.md', '*.markdown')
#
$treemdown->setIncludePatterns( array( '*.md', '*.markdown') );
# Set the patterns for files/path you want to exclude
#
# Default: array( '.*' )
#
$treemdown->setExcludePatterns( array( '.*' ) );
$treemdown->display();
```
## Contributions
This application uses the following libraries:
* [Parsedown-Extra](https://github.com/erusev/parsedown-extra) / [ParseDown](http://parsedown.org)
* [highlight.js](https://highlightjs.org)
* [github markdown stylesheet by Chris Patuzzo](https://gist.github.com/tuzz/3331384)
* [github ribbon stylesheet by Simon Whitaker](https://github.com/simonwhitaker/github-fork-ribbon-css)
* [jQuery](http://jquery.com)