https://github.com/dantleech/docbot
Documentation as Code
https://github.com/dantleech/docbot
Last synced: about 1 year ago
JSON representation
Documentation as Code
- Host: GitHub
- URL: https://github.com/dantleech/docbot
- Owner: dantleech
- Created: 2024-07-21T10:00:59.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-04T19:14:21.000Z (almost 2 years ago)
- Last Synced: 2025-04-14T01:12:53.841Z (about 1 year ago)
- Language: PHP
- Homepage:
- Size: 198 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
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'),
),
]),
]);
``````