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 (發布於 )
用户参与
星數840
關注者數31
派生數101
提交數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.