wdbo/webdocbook 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

wdbo/webdocbook

最新稳定版本:1.0.0-alpha

Composer 安装命令:

composer create-project wdbo/webdocbook

包简介

A web book builds from a Markdown contents file system

README 文档

README

WebDocBook is a simple PHP app to build rich HTML5 views from Markdown files following a filesystem architecture. It embeds some classic CMS' website features like a search in contents, some RSS feeds generation or translations switching.

WebDocBook builds a "like-a-book" interactive website from simple Markdown files.

To begin, watch the http://webdocbook.com/ website.

Key features

  • WebDocBook is a simple application organized beyond a filesystem architecture of Markdown files. Each file is a "page" and each sub-directory is a "section" of pages. The title of the files or directories is used to be the title of the page or section;
  • WebDocBook views' are HTML5 valid with the help of Bootstrap;
  • WebDocBook is highly configurable and customizable;
  • WebDocBook uses the Markdown Extended advanced syntax;
  • WebDocBook generates sitemaps and RSS feeds easily;
  • WebDocBook DOES NOT use a database.

Quick install

  1. To install WebDocBook, you will first need Composer which is required to install all dependencies.

  2. Once Composer is installed, you just have to run:

    $ composer create-project wdbo/webdocbook your/path/to/webdocbook 1.* --no-dev
    
  3. Configure a virtual-host on your web-server to point to the www/ directory of your installation.

  4. Browse to your new virtual-host and fix the boot errors if there are any.

That's it! Your WebDocBook is ready!

To begin, you can copy or link some of your contents in the www/ directory of your installation.

To get help, you can have a look at the documentation in docs/.

Organization overview

All the Markdown files, the real pages of the website, have to be stored in the www/ directory or its sub-directories.

Any file named INDEX.md in a directory will be considered as its index and be delivered if no other file is requested in the URL.

Any file named README.md in a directory will be displayed at the bottom of the directory contents indexing, just like the default behavior of Apache.

Any asset, image or other media file, that you want to include or use in a Markdown content must be stored in an assets/ sub-directory in the current directory. If you do not follow this rule, your file will not be accessible by the web-server.

By default, any file contained in a directory named wip/ will not be displayed publicly and will not be referenced in the sitemap neither in the index ; to view it, you will have to manually write its URL.

Knowing that, a classic WebDocBook directory organization should be:

| chapter-name/
| ------------- README.md           // the first file shown loading the directory
| ------------- assets/             // a directory containing your medias
| ------------- wip/                // a directory containing your work-in-progress contents
| ------------- PAGE.md             // a Markdown content file (page 1)
| ------------- OTHER-PAGE.md       // another Markdown content file (page 2)
| ------------- OTHER-PAGE.fr.md    // the french translation of page 2
| ------------- sub-chapter1/       // a sub-directory containing a sub-chapter
| ------------- sub-chapter2/       // a sub-directory containing another sub-chapter

All your first depth directories (directories contained directly in your WebDocBook www/ root) are considered as your chapters and are listed in the header navigation bar of each page for quick access.

Docker container

A Dockerfile is designed to build a container with the full sources of WebDocBook. The file will create a local docker image with your local sources, install the application in the container and expose your WebDocBook app with both HTTP and HTTPS protocols. You can configure some special ports mapping at runtime and mount in your container some local volumes of Markdown files to use.

Below are the steps to build your container:

  1. prepare a Docker image with an installed application

    docker build -t wdbo_server .
    

    when building the image, you can customize environment variables using the --build-arg <var>=<val> argument ; a full list of available variables is present at the top of the Dockerfile

  2. create a new container based on that image (in the example below, the default 80 and 443 ports of the container are mapped to custom ones on the host and a special local volume is mounted instead of default WebDocBook data):

    docker run -d \
        --name wdbo_server_c \
        -p 8080:80 \
        -p 8443:443 \
        -v /path/to/your/md/files:/var/www/webdocbook/www \
            wdbo_server
    
  3. optionnaly, you can connect into your container with the "www-data" user:

    docker exec -ti -u www-data wdbo_server_c bash
    
  4. optionnaly, you can view the Apache and PHP logs with:

    docker logs -f wdbo_server_c
    

For development, you can mount the whole local sources as a volume of the container to keep your work on it:

docker run -d \
    --name wdbo_server_c \
    -p 8080:80 \
    -p 8443:443 \
    -v $(pwd):/var/www/webdocbook \
        wdbo_server

In this case, you will probably need to change the owner of the file-system to match the server user of the container ("www-data" with UID/GID 1000).

License

WebDocBook is an open-source software released under a GNU General Public License version 3. You can freely download it, use it or distribute it as long as you stay in the license conditions. See the LICENSE file for more info.

wdbo/webdocbook 适用场景与选型建议

wdbo/webdocbook 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 53 次下载、GitHub Stars 达 3, 最近一次更新时间为 2015 年 01 月 25 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「cms」 「markdown」 「wiki」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 wdbo/webdocbook 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 wdbo/webdocbook 我们能提供哪些服务?
定制开发 / 二次开发

基于 wdbo/webdocbook 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 53
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 19
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 3
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0
  • 更新时间: 2015-01-25