phile/textile

在 Phile 中用 PHP-Textile (https://github.com/textile/php-textile) 解析器替换默认解析器(Markdown)。

dev-master 2014-12-27 12:42 UTC

This package is auto-updated.

Last update: 2024-08-29 03:52:47 UTC


README

Phile 中的默认解析器(Markdown)替换为 PHP-Textile 解析器。

1. 安装

1.1 安装(composer)

php composer.phar require phile/textile:*

1.2 安装(下载)

  • 将此仓库克隆到 plugins/phile/textile

2. 激活

安装插件后,您需要将以下行添加到您的 config.php 文件中

$config['plugins']['phile\\textile'] = array('active' => true);

然后将 Textile 依赖项添加到您的 composer.json 文件中

{
  "require": {
    "twig/twig": "1.14.*",
    "michelf/php-markdown": "1.3",
    "netcarver/textile": "3.5.*" // the textile parser
  }
}

现在,像平常一样运行 composer install 命令。

安装插件后,您需要将以下行添加到您的 config.php 文件中

$config['plugins'] = array(
  'phile\\parserMarkdown' => array('active' => false),
  'phile\\textile' => array('active' => true) // use textile
);

您还需要使用 .textile 文件扩展名来处理内容。要更改默认设置,打开根目录中的 index.php 文件,并更改以下行

define('CONTENT_EXT', '.textile'); // default is '.md'

不是 Markdown 的直接替代品

Textile 不是 Markdown。它们非常相似,但也有一些差异。请参阅 此 Textile 技巧表 了解基本语法。

我已包括一个 index.textile 文件,以展示如何从默认主题中重新创建索引内容页面。

为什么选择 Textile 而不是 Markdown

  • 个人喜好