couscous / couscous
Documentation website generator
                                    Fund package maintenance!
                                                                            
                                                                                                                                        mnapoli
                                                                                    
                                                                
Installs: 66 060
Dependents: 35
Suggesters: 0
Security: 0
Stars: 841
Watchers: 31
Forks: 101
Open Issues: 49
pkg:composer/couscous/couscous
Requires
- php: >=7.4
- erusev/parsedown: ^1.7.4
- erusev/parsedown-extra: ^0.8.1
- mnapoli/front-yaml: ^1.5
- padraic/phar-updater: ^1.0
- phine/phar: ^1.0
- php-di/php-di: ^6.0
- psr/log: ^1.0
- symfony/console: ~4.0|~5.0|~6.0
- symfony/filesystem: ~4.0|~5.0|~6.0
- symfony/finder: ~4.0|~5.0|~6.0
- symfony/process: ~4.0|~5.0|~6.0
- symfony/yaml: ~4.0|~5.0|~6.0
- twig/twig: ^1.44
Requires (Dev)
- phpunit/phpunit: ^8.5
- squizlabs/php_codesniffer: ^3.3
- vimeo/psalm: ^3.16
- dev-master
- 1.10.0
- 1.9.5
- 1.9.4
- 1.9.3
- 1.9.2
- 1.9.1
- 1.9.0
- 1.8.0
- 1.7.3
- 1.7.2
- 1.7.1
- 1.7.0
- 1.6.3
- 1.6.2
- 1.6.1
- 1.6.0
- 1.5.2
- 1.5.1
- 1.5.0
- 1.4.1
- 1.4.0
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.0
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.0
- 1.0.0-rc1
- 1.0.0-beta1
- 0.3.3
- 0.3.2
- 0.3.1
- 0.3.0
- 0.2.0
- 0.1.1
- 0.1.0
- dev-dependabot/npm_and_yarn/website/bootstrap-5.0.0
- dev-feature/markdown-model
This package is auto-updated.
Last update: 2025-10-29 01:50:41 UTC
README
| layout | 
|---|
| home | 
Couscous generates a GitHub pages website from your markdown documentation.
Everything is documented on couscous.io.
What follows is the documentation for contributors.
How Couscous works?
Couscous was designed to be as simple as possible. By embracing simplicity, it becomes extremely simple to extend.
Website generation
The website generation is composed of a list of steps to process the Project model object:
interface Step { /** * Process the given project. * * @param Project $project */ public function __invoke(Project $project); }
Steps are very granular, thus extremely easy to write and test. For example:
- LoadConfig: load the- couscous.ymlconfig file
- InstallDependencies: install the dependencies (using yarn, npm or bower)
- LoadMarkdownFiles: load the content of all the- *.mdfiles in memory
- RenderMarkdown: render the markdown content
- WriteFiles: write the in-memory processed files to the target directory
- …
For example, here is a step that would preprocess Markdown files to put the word "Couscous" in bold:
class PutCouscousInBold implements \Couscous\Step { public function __invoke(Project $project) { /** @var MarkdownFile[] $markdownFiles */ $markdownFiles = $project->findFilesByType('Couscous\Model\MarkdownFile'); foreach ($markdownFiles as $file) { $file->content = str_replace('Couscous', '**Couscous**', $file->content); } } }
Couscous uses PHP-DI for wiring everything together with dependency injection.
The full list of steps is configured in src/Application/config.php.
Website deployment
Couscous deploys by cloning (in a temp directory) the current repository, checking out the gh-pages branch, generating the website inside it, committing and pushing.
In the future, Couscous will support several deployment strategies.
Contributing
See the CONTRIBUTING file.
License
Couscous is released under the MIT License.