PHPackages                             lts/php-book-markdown-tools - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. lts/php-book-markdown-tools

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

lts/php-book-markdown-tools
===========================

Tools for processing markdown, especially targeted towards book authorship

501PHP

Since Oct 27Pushed 4y ago1 watchersCompare

[ Source](https://github.com/LongTermSupport/php-book-markdown-tools)[ Packagist](https://packagist.org/packages/lts/php-book-markdown-tools)[ RSS](/packages/lts-php-book-markdown-tools/feed)WikiDiscussions main Synced 5d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Markdown Tools
==============

[](#markdown-tools)

A set of tools to assist with writing markdown and embedding code etc

Built specifically to assist with writing the PHP Book I have been working on

Currently this library provides the following functionality:

Markdown Processing
-------------------

[](#markdown-processing)

This process is designed to update markdown files in place

### Code Snippets

[](#code-snippets)

Code snippets can be automatically included by specifying the path to the relevant PHP file

The code snippet can also be run, and the output captured and presented in another code block.

To enable this, you must write your markdown in this specific style - whitespace sensitive:

#### Standard Code Snippet

[](#standard-code-snippet)

The following will copy/paste the contents of the file into the code fence area. You must pre create the empty code fence area. Each time you run the process, the code fence area will be updated with the code in the specified file.

The path is taken from the directory that the markdown file is located in.

```
[Code Snippet](./../../../path/to/src/file.php)

```php

```
```

#### Executable Code Snippet

[](#executable-code-snippet)

The executable snippet works in exactly the same way as the standard snippet, however it will also create an output block

```
[Code Executable Snippet](./../../../path/to/src/file.php)

```php

```
```

For example, the full code and output snippet will look like

```
[Code Executable Snippet](./itCanGetAndRunCodeSnippets.php)

```php
