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

https://github.com/dantleech/docbot

Documentation as Code
https://github.com/dantleech/docbot

Last synced: about 1 year ago
JSON representation

Documentation as Code

Awesome Lists containing this project

README

          

DTL Docbot
==========

Docbot **generates** up-to-date and accurate documentation by **executing** the
documentation.

Status
------

I've hacked this together in 8 hours.

How it works
------------

Essentially:

- You provide an article containing a set of delarative blocks.
- The blocks are executed output is captured.
- The documentation is rendered to a format of your choice (e.g. markdown).

Features
--------

- Create and update files.
- Execute shell commands and capture the output.
- Apply assertions on the result of an executed block.
- Add your own extensions to provide custom blocks.
- Easily customise the output format to suit your project (e.g. Markdown,
Hugo, RsT, HTML, whatever).
- Depend on other documents (pre-requisites).
- Interact with web pages and capture screenshots (_planned_).
- Lots of other stuff that I haven\'t done yet.

Usage
-----

Create the following file at `docs/example.php`:

```php
getenv('PATH', true).':'.__DIR__.'/../bin',
]),
'We can view the output...',
new TextBlock(
'Now we can view the generated document in `%path%`:',
context: new ShowFileBlock('docs/hello_world.md', 'text'),
),
]),
new SectionBlock('Inception', [
new TextBlock(
'Oh no! It\'s a trap 😱! You\'re in code inception, the source for this file is in `%path%`:',
context: new ShowFileBlock('../docs/README.php', 'php'),
),
]),
]);

``````