Couscous

Couscous从您的markdown文档生成一个GitHub页面的网站。(Couscous generates a GitHub pages website from your markdown documentation.)

Github stars Tracking Chart

Couscous从您的markdown文档生成一个GitHub页面的网站。她把Markdown文档变成漂亮的网站。 它是更强大有力的GitHub Pages。Couscous支持Markdown中的GitHub fenced代码块。Couscous在您的机器上需要PHP 5.4或更高版本。

Couscous不同于其他静态网站生成器如Sculpin或Jekyll。 这些是通用的静态网站生成器,有时是为博客,使用他们把文档放到网上是有些繁杂的。他们也都需要一个特定的目录布局,这与我们通常在我们的代码旁边存储文档不兼容。

Couscous是为简单而建。

它不需要你的目录布局,它只需要一个命令来预览网站和一个命令部署到GitHub页面。

Couscous特性:

对于喜欢功能列表的用户:

  • Markdown额外支持
  • 受防护的代码块
  • Bower支持
  • 响应式的默认模板
  • Twig模板
  • YAML配置
  • 自定义before/after脚本
  • 语法高亮

Main metrics

Overview
Name With OwnerCouscousPHP/Couscous
Primary LanguagePHP
Program languagePHP (Language Count: 7)
Platform
License:Other
所有者活动
Created At2014-01-17 00:06:26
Pushed At2024-08-01 22:05:46
Last Commit At2023-02-21 11:54:36
Release Count40
Last Release Name1.10.0 (Posted on )
First Release Name0.1.0 (Posted on )
用户参与
Stargazers Count836
Watchers Count31
Fork Count103
Commits Count548
Has Issues Enabled
Issues Count146
Issue Open Count43
Pull Requests Count101
Pull Requests Open Count6
Pull Requests Close Count17
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

layout: home

Couscous generates a GitHub pages website from your markdown documentation.

Build Status
Average time to resolve an issue
Percentage of issues still open

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: loads the couscous.yml config file
  • RunBowerInstall
  • LoadMarkdownFiles: load the content of all the *.md files 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.