A Sami theme with inline source code
This is a theme for the Sami API documentation generator with some added features:
- The complete file source is included at the end.
- Source code highlighting with prismjs.
- Show the value / assignment of class constants.
- HTML is minified using wyrihaximus/html-compress.
If you haven't used Sami before, please read up on its installation and basic usage first.
When you're ready, require the theme in your project:
$ composer require nochso/sami-theme
In your Sami configuration file simply call
inject the theme into your Sami instance right before returning it:
<?php use Sami\Sami; use Symfony\Component\Finder\Finder; $finder = Finder::create() ->files() ->name('*.php') ->in(__DIR__.'/src'); $config = array( 'title' => 'Project documentation title', 'build_dir' => __DIR__.'/build', 'cache_dir' => __DIR__.'/cache', ); $sami = new Sami($finder, $config); $sami = \nochso\SamiTheme\Theme::prepare($sami); return $sami;
This looks for PHP files in
src/ and saves the resulting documentation in
These results are now ready for you to upload and share!
- Bump nochso/html-compress-twig to 1.0.0
First public release.
- Open an issue if it's worth discussing.
- Fork this project on Github.
- Clone your fork:
git clone firstname.lastname@example.org:yourname/sami-theme.git
- Don't forget to
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request on Github :)
This project is licensed under the ISC license which is MIT/GPL compatible and FSF/OSI approved:
Copyright (c) 2015, Marcel Voigt <email@example.com> Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.