Couscous

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

Github星跟踪图

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脚本
  • 语法高亮

主要指标

概览
名称与所有者CouscousPHP/Couscous
主编程语言PHP
编程语言PHP (语言数: 7)
平台
许可证Other
所有者活动
创建于2014-01-17 00:06:26
推送于2024-08-01 22:05:46
最后一次提交2023-02-21 11:54:36
发布数40
最新版本名称1.10.0 (发布于 )
第一版名称0.1.0 (发布于 )
用户参与
星数836
关注者数31
派生数103
提交数548
已启用问题?
问题数146
打开的问题数43
拉请求数101
打开的拉请求数6
关闭的拉请求数17
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?

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.