Daux.io

Daux.io 是一款文档生成器,它使用简单的文件夹结构和 Markdown 文件来快速创建自定义文档。它可以帮助你以一种对开发者友好的方式创建好看的文档。「Daux.io is an documentation generator that uses a simple folder structure and Markdown files to create custom documentation on the fly. It helps you create great looking documentation in a developer friendly way.」

Github stars Tracking Chart

Daux.io

Daux.io 是一款文档生成器,它使用简单的文件夹结构和Markdown文件来快速创建自定义文档。它可以帮助你以一种对开发者友好的方式创建好看的文档。

功能介绍

  • 100% 移动响应式
  • 符合 CommonMark(一种 Markdown 规范)
  • 支持 Markdown 表格
  • 自动创建主页/登陆页
  • 自动语法高亮
  • 自动生成导航
  • 4个内置主题或自行设计主题
  • 功能性、扁平化设计风格
  • 可分享/可链接的 SEO 友好 URL
  • 建立在 Bootstrap 上
  • 无建设步骤
  • Git/SVN 友好
  • 支持谷歌分析和 Piwik 分析
  • 可选代码浮动布局
  • 静态输出生成

演示

这是一个使用 Daux.io 的网站列表:

你使用 Daux.io 吗?向我发送一个拉取请求或打开一个问题,我将把你添加到列表中。

安装

PHP 和 Composer

如果你已经安装了 PHP 和 Composer,你可以安装依赖关系,即

composer global require daux/daux.io
# Next to your `docs` folder, run
daux generate

然后你可以使用 daux 命令行来生成你的文档。

如果没有找到该命令,请确保你的$PATH包含~/.composer/vendor/bin。

Docker

或者,如果你想使用Docker,命令的开头将是:

docker run --rm -it -w /build -v "$PWD":/build -u "$(id -u):$(id -g)" daux/daux.io daux

在服务器上运行

把这个资源库下载成 zip 文件,解压后,把你的文档放在 docs 文件夹里,然后你就可以用 Apache 或者 Nginx 服务了。

daux

命令行工具有两个命令:generate 和 service,在没有参数的情况下运行 Daux.io 会自动运行 generate 命令。

你可以运行 daux --help 来获得每个命令的更多细节。

文件夹

默认情况下,生成器会在 docs 文件夹中查找文件夹。在 docs 文件夹中添加你的文件夹。这个项目包含了一些文件夹和文件的例子,可以让你入门。

你可以将文件夹嵌套任意数量的层次,以获得你想要的确切结构。文件夹结构将被转换为嵌套导航。

如果您希望将您的文档保存在其他地方(比如 daux.io 根目录之外),您可以在 global.json 文件中指定您的文档路径。

文件

生成器将在 docs 文件夹和 docs 内的任何子文件夹中查找 Markdown 文件(*.md 和 *.markdown)。

你必须用下划线代替空格。下面是一些文件名的例子,以及它们将被转换为什么。

好的

  • 01_Getting_Started.md = Getting Started
  • API_Calls.md = API Calls
  • 200_Something_Else-Cool.md = Something Else-Cool
  • _5_Ways_to_Be_Happy.md = 5 Ways To Be Happy

坏的

  • File Name With Space.md = FAIL

排序

要以特定的方式对文件和文件夹进行排序,您可以在文件和文件夹前加上数字和下划线,例如 /docs/01_Hello_World.md 和 /docs/05_Features.md,这将把 Hello World 列在 Features 之前,覆盖默认的字母-数字排序。导航和 URL 中的数字将被删除。对于文件 "6 Ways to Get Rich",您可以使用 /docs/_6_Ways_to_Get_Rich.md。

登陆页

如果你想为你的项目创建一个漂亮的登陆页,只需在 /docs 文件夹的根目录下创建一个 index.md 文件。这个文件就会被用来创建一个登陆页。你也可以使用配置文件为这个页面添加标语和图片,比如这样:

{
    "title": "Daux.io",
    "tagline": "The Easiest Way To Document Your Project",
    "image": "app.png"
}

注意:图像可以是本地或远程图像。使用约定的 <base_url> 来表示 Daux 实例的根目录。

栏目登陆页

如果你有兴趣为你的文档中的一个小节建立登陆页,你需要做的就是在文件夹中添加一个 index.md 文件。例如,/docs/01_Examples 就有一个登陆页,因为有一个 /docs/01_Examples/index.md 文件。如果您希望为一个没有登陆页格式的章节设置索引页,请使用 _index.md 这个名字。

配置

要自定义文档的外观和感觉,你可以在 /docs 文件夹中创建一个 config.json 文件。config.json 文件是一个简单的 JSON 对象,你可以用它来改变文档的一些基本设置。

文档标题

更改文档中的标题栏

{
    "title": "Daux.io"
}

主题

我们有 4 个内置的 Bootstrap 主题。要使用其中一个主题,只需将主题选项设置为以下之一。

  • daux-blue
  • daux-green
  • daux-navy
  • daux-red

更多选项

还有许多其他选项可供选择。

远程运行

将 repo 中的文件复制到可以运行 PHP 7.2.0 或更新版本的 web 服务器上。

本地运行

有几种方法可以在本地运行文档。推荐的方法是运行 daux serve,它将执行 PHP 的嵌入式服务器。

默认情况下,服务器将运行在:http://localhost:8085

这其实只是在你编写/更新大量文档并想在本地预览更改时才会用到。

生成一组静态文件

这些可以上传到静态网站托管服务,如 pages.github.com。

生成一套完整的页面,并带有导航功能。

daux --source=docs --destination=static

在 IIS 上运行

如果你已经建立了一个本地或远程 IIS 网站,你可能需要一个 web.config与。

一个重写配置,用于处理干净的URL

一个 MIME 类型处理程序,用于处理较少的文件,如果使用自定义主题。

清洁的 URL

web.config 需要在<system.webserver> 下设置 <rewrite> 条目。

<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Main Rule" stopProcessing="true">
                    <match url=".*" />
                    <conditions logicalGrouping="MatchAll">
                        <add
                            input="{REQUEST_FILENAME}"
                            matchType="IsFile"
                            negate="true"
                        />
                        <add
                            input="{REQUEST_FILENAME}"
                            matchType="IsDirectory"
                            negate="true"
                        />
                    </conditions>
                    <action
                        type="Rewrite"
                        url="index.php"
                        appendQueryString="false"
                    />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

要在 IIS 6 上使用干净的 URL,你需要使用一个自定义的 URL 重写模块,比如 URL Rewriter

PHP要求

Daux.io 兼容官方支持的 PHP 版本;7.2.0 及以上。

扩展功能

Daux.io 需要以下 PHP 扩展才能工作:php-mbstring 和 php-xml。

如果您遇到类似 utf8_decode() 找不到的错误,说明您缺少 php-xml 包。

技术支持

如果您在使用 Daux.io 时需要帮助,或者发现了一个 bug,请在 GitHub repo 上创建一个问题。


(vz Revised on 2020.12.20)

Main metrics

Overview
Name With Ownerdauxio/daux.io
Primary LanguageJavaScript
Program languagePHP (Language Count: 6)
PlatformDocker, Linux, Mac, Windows
License:MIT License
所有者活动
Created At2017-09-13 19:17:15
Pushed At2025-06-10 19:51:58
Last Commit At2025-03-01 17:21:47
Release Count55
Last Release Name0.22.3 (Posted on )
First Release Name0.1.0 (Posted on )
用户参与
Stargazers Count813
Watchers Count21
Fork Count194
Commits Count1.2k
Has Issues Enabled
Issues Count154
Issue Open Count8
Pull Requests Count250
Pull Requests Open Count6
Pull Requests Close Count46
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

Daux.io

Latest Version
Software License
GitHub Workflow Status
Coverage Status
Quality Score
Total Downloads

Daux.io is a documentation generator that uses a simple folder structure and Markdown files to create custom documentation on the fly. It helps you create great looking documentation in a developer friendly way.

Features

  • 100% Mobile Responsive
  • CommonMark compliant (a Markdown specification)
  • Supports Markdown tables
  • Auto created homepage/landing page
  • Auto Syntax Highlighting
  • Auto Generated Navigation
  • 4 Built-In Themes or roll your own
  • Functional, Flat Design Style
  • Shareable/Linkable SEO Friendly URLs
  • Built On Bootstrap
  • No Build Step
  • Git/SVN Friendly
  • Supports Google Analytics and Piwik Analytics
  • Optional code float layout
  • Static Output Generation

Demos

This is a list of sites using Daux.io:

Do you use Daux.io? Send me a pull request or open an issue and I will add you to the list.

Install

PHP and Composer

If you have PHP and Composer installed, you can install the dependency

composer global require daux/daux.io

# Next to your `docs` folder, run
daux generate

You can then use the daux command line to generate your documentation.

If the command isn't found, ensure your $PATH contains ~/.composer/vendor/bin

Docker

Or if you wish to use Docker, the start of the command will be :

docker run --rm -it -w /build -v "$PWD":/build -u "$(id -u):$(id -g)" daux/daux.io daux

Run on a server

Download this repository as a zip, unpack, and put your documentation in the docs folder, you can then serve it with Apache or Nginx.

daux

The command line tool has two commands: generate and serve, running Daux.io without an argument will automatically run the generate command.

You can run daux --help to get more details about each command.

Folders

By default, the generator will look for folders in the docs folder. Add your folders inside the docs folder. This project contains some example folders and files to get you started.

You can nest folders any number of levels to get the exact structure you want. The folder structure will be converted to the nested navigation.

If you'd prefer to keep your docs somewhere else (like outside of the daux.io root directory) you can specify your docs path in the global.json file.

Files

The generator will look for Markdown files (*.md and *.markdown) inside the docs folder and any of the subfolders within docs.

You must use underscores instead of spaces. Here are some example file names and what they will be converted to:

Good:

  • 01_Getting_Started.md = Getting Started
  • API_Calls.md = API Calls
  • 200_Something_Else-Cool.md = Something Else-Cool
  • _5_Ways_to_Be_Happy.md = 5 Ways To Be Happy

Bad:

  • File Name With Space.md = FAIL

Sorting

To sort your files and folders in a specific way, you can prefix them with a number and underscore, e.g. /docs/01_Hello_World.md and /docs/05_Features.md This will list Hello World before Features, overriding the default alpha-numeric sorting. The numbers will be stripped out of the navigation and urls. For the file 6 Ways to Get Rich, you can use /docs/_6_Ways_to_Get_Rich.md

Landing page

If you want to create a beautiful landing page for your project, simply create a index.md file in the root of the /docs folder. This file will then be used to create a landing page. You can also add a tagline and image to this page using the config file like this:

{
    "title": "Daux.io",
    "tagline": "The Easiest Way To Document Your Project",
    "image": "app.png"
}

Note: The image can be a local or remote image. Use the convention <base_url> to refer to the root directory of the Daux instance.

Section landing page

If you are interested in having a landing page for a subsection of your docs, all you need to do is add an index.md file to the folder. For example, /docs/01_Examples has a landing page for that section since there exists a /docs/01_Examples/index.md file. If you wish to have an index page for a section without a landing page format, use the name _index.md

Configuration

To customize the look and feel of your documentation, you can create a config.json file in the of the /docs folder.
The config.json file is a simple JSON object that you can use to change some of the basic settings of the documentation.

Title

Change the title bar in the docs

{
    "title": "Daux.io"
}

Themes

We have 4 built-in Bootstrap themes. To use one of the themes, just set the theme option to one of the following:

  • daux-blue
  • daux-green
  • daux-navy
  • daux-red
{
    "html": { "theme": "daux-green" }
}

More options

Many other options are available:

Running Remotely

Copy the files from the repo to a web server that can run PHP 7.2.0 or newer.

Running Locally

There are several ways to run the docs locally.
The recommended way is to run daux serve which will execute PHP's embedded server.

By default the server will run at: http://localhost:8085

This is really only intended be used when you are writing/updating a ton of docs and want to preview the changes locally.

Generating a set of static files

These can be uploaded to a static site hosting service such as pages.github.com

Generating a complete set of pages, with navigation

daux --source=docs --destination=static

Running on IIS

If you have set up a local or remote IIS web site, you may need a web.config with:

  • A rewrite configuration, for handling clean urls.
  • A mime type handler for less files, if using a custom theme.

Clean URLs

The web.config needs an entry for <rewrite> under <system.webServer>:

<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Main Rule" stopProcessing="true">
                    <match url=".*" />
                    <conditions logicalGrouping="MatchAll">
                        <add
                            input="{REQUEST_FILENAME}"
                            matchType="IsFile"
                            negate="true"
                        />
                        <add
                            input="{REQUEST_FILENAME}"
                            matchType="IsDirectory"
                            negate="true"
                        />
                    </conditions>
                    <action
                        type="Rewrite"
                        url="index.php"
                        appendQueryString="false"
                    />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

To use clean URLs on IIS 6, you will need to use a custom URL rewrite module, such as URL Rewriter.

PHP Requirements

Daux.io is compatible with the officially supported PHP versions; 7.2.0 and up.

Extensions

Daux.io needs the following PHP extensions to work : php-mbstring and php-xml.

If you encounter an error similar to utf8_decode() not found this means that you're missing the php-xml package.

Support

If you need help using Daux.io, or have found a bug, please create an issue on the GitHub repo.