trejjam / texy-fshl
Nette texy! fshl 扩展
v0.5
2015-08-24 21:20 UTC
Requires
- php: >=5.4
- kukulich/fshl: ~2.1
- nette/di: ~2.2
- nette/utils: ~2.2
Requires (Dev)
- nette/tester: @dev
Suggests
This package is auto-updated.
Last update: 2024-09-05 18:00:38 UTC
README
基于
需求
安装
安装 Trejjam/Texy-fshl 的最佳方式是使用 Composer
$ composer require trejjam/texy-fshl:0.5
配置
.neon
extensions: texyFshl: Trejjam\TexyFshl\DI\TexyFshlExtension texyFshl:
用法
展示者
function renderDefault() { $template = $this->template; $template->texy = ''; $template->texy .= 'Colored block of code'; //all possible blocks: code, cpp, python, php, neon, config, sh, texy, java, javascript, js, css, sql, html, htmlcb $template->texy .= '/--php'; $template->texy .= 'function foo() {'; $template->texy .= ' $hello=\'\';'; $template->texy .= ' echo $helo;'; $template->texy .= '}'; $template->texy .= '\--'; $template->texy .= 'Base block of code'; $template->texy .= '/--code'; $template->texy .= 'function foo() {'; $template->texy .= ' $hello=\'\';'; $template->texy .= ' echo $helo;'; $template->texy .= '}'; $template->texy .= '\--'; }
default.latte
<div class="texy"> {$texy|texy} </div>
LESS
.texy { @import "bootstrap/reset.less"; @import "bootstrap/code.less"; .prettyprint { padding: 8px; background-color: #f7f7f9; border: 1px solid #e1e1e8; //line-height: 0 !important; } .prettyprint.linenums { -webkit-box-shadow: inset 45px 0 0 #fbfbfc, inset 46px 0 0 #ececf0; -moz-box-shadow: inset 45px 0 0 #fbfbfc, inset 46px 0 0 #ececf0; box-shadow: inset 45px 0 0 #fbfbfc, inset 46px 0 0 #ececf0; } ol.linenums { margin: 0 0 0 43px; /* IE indents via margin-left */ padding-left: 0px; } ol.linenums li { padding-left: 6px; color: #bebec5; line-height: 20px; text-shadow: 0 1px 0 #fff; } ol.linenums li > span { color: black; } a { .font(Arial, 16px, @base); &:hover { text-decoration: underline; } } p { .font(Arial, 16px, #000); } li { .font(Arial, 16px, #000); } @import (less) "/vendor/kukulich/fshl/style.css"; }