phile/inline-image

一个插件,接受一个图片名称并生成一个包装的图片标签。

安装: 107

依赖: 0

建议: 0

安全: 0

星标: 3

关注者: 4

分支: 2

公开问题: 1

类型:phile-plugin

1.0.0 2014-06-19 13:28 UTC

This package is auto-updated.

Last update: 2024-08-29 03:26:07 UTC


README

这是一个用于Phile的插件,用于接收一个图片名称并生成一个包装的图片标签。

1.1 安装(Composer)

php composer.phar require phile/inline-image:*

1.2 安装(下载)

  • 安装Phile的最新版本
  • 将此仓库克隆到plugins/phile/inlineImage

2. 激活

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

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

使用方法

一些示例Markdown输入

## This is a Sub Page

This is page.md in the "sub" folder.

icon.png

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

这将输出什么。您可以看到icon.png被一些HTML包装了

<h2>This is a Sub Page</h2>
<p>This is page.md in the "sub" folder.</p>
<p class="content-image">
  <img src="http://localhost:8888/phile/content/images/icon.png">
</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>

配置

这是默认的config.php文件。它解释了每个键 => 值的作用。

return array(
  'images_dir' => 'content/images/', // the folder where your images exist
  'wrap_element' => 'p', // the element to wrap the img tag in
  'wrap_class' => 'content-image' // the class to apply to the wrap element
  );

您可以看到插件如何将配置数据应用于HTML输出。

images_dir应该相对于Phile安装的根目录(常量ROOT_DIR将包含您的根路径)。