Update READMEs
This commit is contained in:
parent
d6f1b412a1
commit
9b2851901b
47
README.de.md
47
README.de.md
|
@ -57,7 +57,6 @@ diesen Server verwenden.
|
||||||
- [SCSS Templates](#scss-templates)
|
- [SCSS Templates](#scss-templates)
|
||||||
- [Liquid Templates](#liquid-templates)
|
- [Liquid Templates](#liquid-templates)
|
||||||
- [Markdown Templates](#markdown-templates)
|
- [Markdown Templates](#markdown-templates)
|
||||||
- [Textile Templates](#textile-templates)
|
|
||||||
- [RDoc Templates](#rdoc-templates)
|
- [RDoc Templates](#rdoc-templates)
|
||||||
- [AsciiDoc Templates](#asciidoc-templates)
|
- [AsciiDoc Templates](#asciidoc-templates)
|
||||||
- [Radius Templates](#radius-templates)
|
- [Radius Templates](#radius-templates)
|
||||||
|
@ -765,44 +764,6 @@ in Markdown geschrieben werden. Es ist aber möglich, einen Renderer für die
|
||||||
Templates zu verwenden und einen anderen für das Layout, indem die
|
Templates zu verwenden und einen anderen für das Layout, indem die
|
||||||
`:layout_engine`-Option verwendet wird.
|
`:layout_engine`-Option verwendet wird.
|
||||||
|
|
||||||
#### Textile Templates
|
|
||||||
|
|
||||||
<table>
|
|
||||||
<tr>
|
|
||||||
<td>Abhängigkeit</td>
|
|
||||||
<td><a href="http://redcloth.org/">RedCloth</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Dateierweiterung</td>
|
|
||||||
<td><tt>.textile</tt></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Beispiel</td>
|
|
||||||
<td><tt>textile :index, :layout_engine => :erb</tt></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
Da man aus dem Textile-Template heraus keine Ruby-Methoden aufrufen und auch
|
|
||||||
keine locals verwenden kann, wird man Textile üblicherweise in Kombination mit
|
|
||||||
anderen Renderern verwenden wollen:
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
erb :overview, :locals => { :text => textile(:einfuehrung) }
|
|
||||||
```
|
|
||||||
|
|
||||||
Beachte, dass man die `textile`-Methode auch aus anderen Templates heraus
|
|
||||||
aufrufen kann:
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
%h1 Gruß von Haml!
|
|
||||||
%p= textile(:Grüße)
|
|
||||||
```
|
|
||||||
|
|
||||||
Da man Ruby nicht von Textile heraus aufrufen kann, können auch Layouts nicht
|
|
||||||
in Textile geschrieben werden. Es ist aber möglich, einen Renderer für die
|
|
||||||
Templates zu verwenden und einen anderen für das Layout, indem die
|
|
||||||
`:layout_engine`-Option verwendet wird.
|
|
||||||
|
|
||||||
#### RDoc Templates
|
#### RDoc Templates
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
|
@ -814,10 +775,6 @@ Templates zu verwenden und einen anderen für das Layout, indem die
|
||||||
<td>Dateierweiterung</td>
|
<td>Dateierweiterung</td>
|
||||||
<td><tt>.rdoc</tt></td>
|
<td><tt>.rdoc</tt></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<td>Beispiel</td>
|
|
||||||
<td><tt>textile :README, :layout_engine => :erb</tt></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
Da man aus dem RDoc-Template heraus keine Ruby-Methoden aufrufen und auch
|
Da man aus dem RDoc-Template heraus keine Ruby-Methoden aufrufen und auch
|
||||||
|
@ -1214,11 +1171,11 @@ end
|
||||||
### Dateiendungen zuordnen
|
### Dateiendungen zuordnen
|
||||||
|
|
||||||
Um eine Dateiendung einer Template-Engine zuzuordnen, kann `Tilt.register`
|
Um eine Dateiendung einer Template-Engine zuzuordnen, kann `Tilt.register`
|
||||||
genutzt werden. Wenn etwa die Dateiendung `tt` für Textile-Templates genutzt
|
genutzt werden. Wenn etwa die Dateiendung `tt` für Haml-Templates genutzt
|
||||||
werden soll, lässt sich dies wie folgt bewerkstelligen:
|
werden soll, lässt sich dies wie folgt bewerkstelligen:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
Tilt.register :tt, Tilt[:textile]
|
Tilt.register :tt, Tilt[:haml]
|
||||||
```
|
```
|
||||||
|
|
||||||
### Eine eigene Template-Engine hinzufügen
|
### Eine eigene Template-Engine hinzufügen
|
||||||
|
|
41
README.es.md
41
README.es.md
|
@ -56,7 +56,6 @@ Se recomienda ejecutar `gem install puma`, porque Sinatra lo utilizará si está
|
||||||
* [Plantillas SCSS](#plantillas-scss)
|
* [Plantillas SCSS](#plantillas-scss)
|
||||||
* [Plantillas Liquid](#plantillas-liquid)
|
* [Plantillas Liquid](#plantillas-liquid)
|
||||||
* [Plantillas Markdown](#plantillas-markdown)
|
* [Plantillas Markdown](#plantillas-markdown)
|
||||||
* [Plantillas Textile](#plantillas-textile)
|
|
||||||
* [Plantillas RDoc](#plantillas-rdoc)
|
* [Plantillas RDoc](#plantillas-rdoc)
|
||||||
* [Plantillas AsciiDoc](#plantillas-asciidoc)
|
* [Plantillas AsciiDoc](#plantillas-asciidoc)
|
||||||
* [Plantillas Radius](#plantillas-radius)
|
* [Plantillas Radius](#plantillas-radius)
|
||||||
|
@ -768,42 +767,6 @@ Como no puede utilizar Ruby desde Markdown, no puede usar layouts escritos en
|
||||||
Markdown. De todos modos, es posible usar un motor de renderizado para el
|
Markdown. De todos modos, es posible usar un motor de renderizado para el
|
||||||
layout distinto al de la plantilla pasando la opción `:layout_engine`.
|
layout distinto al de la plantilla pasando la opción `:layout_engine`.
|
||||||
|
|
||||||
#### Plantillas Textile
|
|
||||||
|
|
||||||
<table>
|
|
||||||
<tr>
|
|
||||||
<td>Dependencias</td>
|
|
||||||
<td><a href="http://redcloth.org/" title="RedCloth">RedCloth</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Extensiones de Archivo</td>
|
|
||||||
<td><tt>.textile</tt></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Ejemplo</td>
|
|
||||||
<td><tt>textile :index, :layout_engine => :erb</tt></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
No es posible llamar métodos desde textile, ni pasarle locales. Por lo tanto,
|
|
||||||
generalmente vas a usarlo en combinación con otro motor de renderizado:
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
erb :resumen, :locals => { :texto => textile(:introduccion) }
|
|
||||||
```
|
|
||||||
|
|
||||||
Ten en cuenta que también puedes llamar al método `textile` desde otras
|
|
||||||
plantillas:
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
%h1 Hola Desde Haml!
|
|
||||||
%p= textile(:saludos)
|
|
||||||
```
|
|
||||||
|
|
||||||
Como no puedes utilizar Ruby desde Textile, no puedes usar layouts escritos en
|
|
||||||
Textile. De todos modos, es posible usar un motor de renderizado para el
|
|
||||||
layout distinto al de la plantilla pasando la opción `:layout_engine`.
|
|
||||||
|
|
||||||
#### Plantillas RDoc
|
#### Plantillas RDoc
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
|
@ -1205,10 +1168,10 @@ end
|
||||||
|
|
||||||
Para asociar una extensión de archivo con un motor de renderizado, usa
|
Para asociar una extensión de archivo con un motor de renderizado, usa
|
||||||
`Tilt.register`. Por ejemplo, si quieres usar la extensión `tt` para
|
`Tilt.register`. Por ejemplo, si quieres usar la extensión `tt` para
|
||||||
las plantillas Textile, puedes hacer lo siguiente:
|
las plantillas Haml, puedes hacer lo siguiente:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
Tilt.register :tt, Tilt[:textile]
|
Tilt.register :tt, Tilt[:haml]
|
||||||
```
|
```
|
||||||
|
|
||||||
### Añadiendo Tu Propio Motor de Plantillas
|
### Añadiendo Tu Propio Motor de Plantillas
|
||||||
|
|
42
README.fr.md
42
README.fr.md
|
@ -57,7 +57,6 @@ Sinatra utilise le server Thin quand il est disponible.
|
||||||
* [Templates SCSS](#templates-scss)
|
* [Templates SCSS](#templates-scss)
|
||||||
* [Templates Liquid](#templates-liquid)
|
* [Templates Liquid](#templates-liquid)
|
||||||
* [Templates Markdown](#templates-markdown)
|
* [Templates Markdown](#templates-markdown)
|
||||||
* [Templates Textile](#templates-textile)
|
|
||||||
* [Templates RDoc](#templates-rdoc)
|
* [Templates RDoc](#templates-rdoc)
|
||||||
* [Templates Asciidoc](#templates-asciidoc)
|
* [Templates Asciidoc](#templates-asciidoc)
|
||||||
* [Templates Radius](#templates-radius)
|
* [Templates Radius](#templates-radius)
|
||||||
|
@ -770,43 +769,6 @@ pouvez pas utiliser de layouts écrits en Markdown. Toutefois, il
|
||||||
est possible d’utiliser un moteur de rendu différent pour le template et
|
est possible d’utiliser un moteur de rendu différent pour le template et
|
||||||
pour le layout en utilisant l’option `:layout_engine`.
|
pour le layout en utilisant l’option `:layout_engine`.
|
||||||
|
|
||||||
#### Templates Textile
|
|
||||||
|
|
||||||
<table>
|
|
||||||
<tr>
|
|
||||||
<td>Dépendances</td>
|
|
||||||
<td><a href="http://redcloth.org/" title="RedCloth">RedCloth</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Extensions de fichier</td>
|
|
||||||
<td><tt>.textile</tt></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Exemple</td>
|
|
||||||
<td><tt>textile :index, :layout_engine => :erb</tt></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
Il n’est pas possible d’appeler de méthodes depuis textile, ni de lui
|
|
||||||
passer de variables locales. Par conséquent, il sera souvent utilisé en
|
|
||||||
combinaison avec un autre moteur de rendu :
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
erb :accueil, :locals => { :text => textile(:introduction) }
|
|
||||||
```
|
|
||||||
|
|
||||||
Notez que vous pouvez également appeler la méthode `textile` depuis un autre template :
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
%h1 Bonjour depuis Haml !
|
|
||||||
%p= textile(:bienvenue)
|
|
||||||
```
|
|
||||||
|
|
||||||
Comme vous ne pouvez pas appeler de méthode Ruby depuis Textile, vous ne pouvez
|
|
||||||
pas utiliser de layouts écrits en Textile. Toutefois, il est
|
|
||||||
possible d’utiliser un moteur de rendu différent pour le template et
|
|
||||||
pour le layout en utilisant l’option `:layout_engine`.
|
|
||||||
|
|
||||||
#### Templates RDoc
|
#### Templates RDoc
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
|
@ -1217,10 +1179,10 @@ end
|
||||||
|
|
||||||
Pour associer une extension de fichier avec un moteur de rendu, utilisez
|
Pour associer une extension de fichier avec un moteur de rendu, utilisez
|
||||||
`Tilt.register`. Par exemple, si vous désirez utiliser l'extension
|
`Tilt.register`. Par exemple, si vous désirez utiliser l'extension
|
||||||
de fichier `tt` pour les templates Textile, vous pouvez faire comme suit :
|
de fichier `tt` pour les templates Haml, vous pouvez faire comme suit :
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
Tilt.register :tt, Tilt[:textile]
|
Tilt.register :tt, Tilt[:haml]
|
||||||
```
|
```
|
||||||
|
|
||||||
### Ajouter son propre moteur de rendu
|
### Ajouter son propre moteur de rendu
|
||||||
|
|
38
README.ja.md
38
README.ja.md
|
@ -54,7 +54,6 @@ PumaがあればSinatraはこれを利用するので、`gem install puma`する
|
||||||
* [SCSS テンプレート](#scss-テンプレート)
|
* [SCSS テンプレート](#scss-テンプレート)
|
||||||
* [Liquid テンプレート](#liquid-テンプレート)
|
* [Liquid テンプレート](#liquid-テンプレート)
|
||||||
* [Markdown テンプレート](#markdown-テンプレート)
|
* [Markdown テンプレート](#markdown-テンプレート)
|
||||||
* [Textile テンプレート](#textile-テンプレート)
|
|
||||||
* [RDoc テンプレート](#rdoc-テンプレート)
|
* [RDoc テンプレート](#rdoc-テンプレート)
|
||||||
* [AsciiDoc テンプレート](#asciidoc-テンプレート)
|
* [AsciiDoc テンプレート](#asciidoc-テンプレート)
|
||||||
* [Radius テンプレート](#radius-テンプレート)
|
* [Radius テンプレート](#radius-テンプレート)
|
||||||
|
@ -700,39 +699,6 @@ erb :overview, :locals => { :text => markdown(:introduction) }
|
||||||
|
|
||||||
MarkdownからはRubyを呼ぶことができないので、Markdownで書かれたレイアウトを使うことはできません。しかしながら、`:layout_engine`オプションを渡すことでテンプレートのものとは異なるレンダリングエンジンをレイアウトのために使うことができます。
|
MarkdownからはRubyを呼ぶことができないので、Markdownで書かれたレイアウトを使うことはできません。しかしながら、`:layout_engine`オプションを渡すことでテンプレートのものとは異なるレンダリングエンジンをレイアウトのために使うことができます。
|
||||||
|
|
||||||
#### Textile テンプレート
|
|
||||||
|
|
||||||
<table>
|
|
||||||
<tr>
|
|
||||||
<td>依存</td>
|
|
||||||
<td><a href="http://redcloth.org/" title="RedCloth">RedCloth</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>ファイル拡張子</td>
|
|
||||||
<td><tt>.textile</tt></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>例</td>
|
|
||||||
<td><tt>textile :index, :layout_engine => :erb</tt></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
Textileからメソッドを呼び出すことも、localsに変数を渡すこともできません。
|
|
||||||
それゆえ、他のレンダリングエンジンとの組み合わせで使うのが普通です。
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
erb :overview, :locals => { :text => textile(:introduction) }
|
|
||||||
```
|
|
||||||
|
|
||||||
ノート: 他のテンプレート内で`textile`メソッドを呼び出せます。
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
%h1 Hello From Haml!
|
|
||||||
%p= textile(:greetings)
|
|
||||||
```
|
|
||||||
|
|
||||||
TextileからはRubyを呼ぶことができないので、Textileで書かれたレイアウトを使うことはできません。しかしながら、`:layout_engine`オプションを渡すことでテンプレートのものとは異なるレンダリングエンジンをレイアウトのために使うことができます。
|
|
||||||
|
|
||||||
#### RDoc テンプレート
|
#### RDoc テンプレート
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
|
@ -1103,10 +1069,10 @@ end
|
||||||
|
|
||||||
### ファイル拡張子の関連付け
|
### ファイル拡張子の関連付け
|
||||||
|
|
||||||
任意のテンプレートエンジンにファイル拡張子を関連付ける場合は、`Tilt.register`を使います。例えば、Textileテンプレートに`tt`というファイル拡張子を使いたい場合は、以下のようにします。
|
任意のテンプレートエンジンにファイル拡張子を関連付ける場合は、`Tilt.register`を使います。例えば、Hamlテンプレートに`tt`というファイル拡張子を使いたい場合は、以下のようにします。
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
Tilt.register :tt, Tilt[:textile]
|
Tilt.register :tt, Tilt[:haml]
|
||||||
```
|
```
|
||||||
|
|
||||||
### オリジナルテンプレートエンジンの追加
|
### オリジナルテンプレートエンジンの追加
|
||||||
|
|
40
README.ko.md
40
README.ko.md
|
@ -52,7 +52,6 @@ thin이 설치되어 있을 경우 Sinatra는 thin을 통해 실행합니다.
|
||||||
* [SCSS 템플릿](#scss-템플릿)
|
* [SCSS 템플릿](#scss-템플릿)
|
||||||
* [Liquid 템플릿](#liquid-템플릿)
|
* [Liquid 템플릿](#liquid-템플릿)
|
||||||
* [Markdown 템플릿](#markdown-템플릿)
|
* [Markdown 템플릿](#markdown-템플릿)
|
||||||
* [Textile 템플릿](#textile-템플릿)
|
|
||||||
* [RDoc 템플릿](#rdoc-템플릿)
|
* [RDoc 템플릿](#rdoc-템플릿)
|
||||||
* [AsciiDoc 템플릿](#asciidoc-템플릿)
|
* [AsciiDoc 템플릿](#asciidoc-템플릿)
|
||||||
* [Radius 템플릿](#radius-템플릿)
|
* [Radius 템플릿](#radius-템플릿)
|
||||||
|
@ -690,41 +689,6 @@ Markdown에서 루비를 호출할 수 없기 때문에, Markdown으로 작성
|
||||||
사용할 수 없습니다. 하지만, `:layout_engine` 옵션으로 레이아웃의 템플릿을
|
사용할 수 없습니다. 하지만, `:layout_engine` 옵션으로 레이아웃의 템플릿을
|
||||||
다른 렌더링 엔진으로 렌더링 할 수는 있습니다.
|
다른 렌더링 엔진으로 렌더링 할 수는 있습니다.
|
||||||
|
|
||||||
#### Textile 템플릿
|
|
||||||
|
|
||||||
<table>
|
|
||||||
<tr>
|
|
||||||
<td>의존성</td>
|
|
||||||
<td><a href="http://redcloth.org/">RedCloth</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>파일 확장자</td>
|
|
||||||
<td><tt>.textile</tt></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>예제</td>
|
|
||||||
<td><tt>textile :index, :layout_engine => :erb</tt></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
Textile에서는 메서드 호출 뿐 아니라 locals 전달도 안됩니다.
|
|
||||||
따라서 일반적으로는 다른 렌더링 엔진과 함께 사용하게 됩니다.
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
erb :overview, :locals => { :text => textile(:introduction) }
|
|
||||||
```
|
|
||||||
|
|
||||||
다른 템플릿 속에서 `textile` 메서드를 호출할 수도 있습니다.
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
%h1 안녕 Haml!
|
|
||||||
%p= textile(:greetings)
|
|
||||||
```
|
|
||||||
|
|
||||||
Textile에서 루비를 호출할 수 없기 때문에, Textile으로 작성된 레이아웃은
|
|
||||||
사용할 수 없습니다. 하지만, `:layout_engine` 옵션으로 레이아웃의 템플릿을
|
|
||||||
다른 렌더링 엔진으로 렌더링 할 수는 있습니다.
|
|
||||||
|
|
||||||
#### RDoc 템플릿
|
#### RDoc 템플릿
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
|
@ -1122,11 +1086,11 @@ end
|
||||||
### 파일 확장자 연결하기
|
### 파일 확장자 연결하기
|
||||||
|
|
||||||
어떤 파일 확장자를 특정 템플릿 엔진과 연결하려면, `Tilt.register`를 사용하면
|
어떤 파일 확장자를 특정 템플릿 엔진과 연결하려면, `Tilt.register`를 사용하면
|
||||||
됩니다. 예를 들어, `tt`라는 파일 확장자를 Textile 템플릿과 연결하고 싶다면,
|
됩니다. 예를 들어, `tt`라는 파일 확장자를 Haml 템플릿과 연결하고 싶다면,
|
||||||
다음과 같이 하면 됩니다.
|
다음과 같이 하면 됩니다.
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
Tilt.register :tt, Tilt[:textile]
|
Tilt.register :tt, Tilt[:haml]
|
||||||
```
|
```
|
||||||
|
|
||||||
### 나만의 고유한 템플릿 엔진 추가하기
|
### 나만의 고유한 템플릿 엔진 추가하기
|
||||||
|
|
|
@ -56,7 +56,6 @@ View at: [http://localhost:4567](http://localhost:4567)
|
||||||
* [SCSS ടെംപ്ലേറ്റ്സ്](#scss-templates)
|
* [SCSS ടെംപ്ലേറ്റ്സ്](#scss-templates)
|
||||||
* [Liquid ടെംപ്ലേറ്റ്സ്](#liquid-templates)
|
* [Liquid ടെംപ്ലേറ്റ്സ്](#liquid-templates)
|
||||||
* [Markdown ടെംപ്ലേറ്റ്സ്](#markdown-templates)
|
* [Markdown ടെംപ്ലേറ്റ്സ്](#markdown-templates)
|
||||||
* [Textile ടെംപ്ലേറ്റ്സ്](#textile-templates)
|
|
||||||
* [RDoc ടെംപ്ലേറ്റ്സ്](#rdoc-templates)
|
* [RDoc ടെംപ്ലേറ്റ്സ്](#rdoc-templates)
|
||||||
* [AsciiDoc ടെംപ്ലേറ്റ്സ്](#asciidoc-templates)
|
* [AsciiDoc ടെംപ്ലേറ്റ്സ്](#asciidoc-templates)
|
||||||
* [Radius ടെംപ്ലേറ്റ്സ്](#radius-templates)
|
* [Radius ടെംപ്ലേറ്റ്സ്](#radius-templates)
|
||||||
|
@ -735,42 +734,6 @@ Since you cannot call Ruby from Markdown, you cannot use layouts written in
|
||||||
Markdown. However, it is possible to use another rendering engine for the
|
Markdown. However, it is possible to use another rendering engine for the
|
||||||
template than for the layout by passing the `:layout_engine` option.
|
template than for the layout by passing the `:layout_engine` option.
|
||||||
|
|
||||||
#### Textile Templates
|
|
||||||
|
|
||||||
<table>
|
|
||||||
<tr>
|
|
||||||
<td>Dependency</td>
|
|
||||||
<td><a href="http://redcloth.org/" title="RedCloth">RedCloth</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>File Extension</td>
|
|
||||||
<td><tt>.textile</tt></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Example</td>
|
|
||||||
<td><tt>textile :index, :layout_engine => :erb</tt></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
It is not possible to call methods from Textile, nor to pass locals to
|
|
||||||
it. You therefore will usually use it in combination with another
|
|
||||||
rendering engine:
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
erb :overview, :locals => { :text => textile(:introduction) }
|
|
||||||
```
|
|
||||||
|
|
||||||
Note that you may also call the `textile` method from within other templates:
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
%h1 Hello From Haml!
|
|
||||||
%p= textile(:greetings)
|
|
||||||
```
|
|
||||||
|
|
||||||
Since you cannot call Ruby from Textile, you cannot use layouts written in
|
|
||||||
Textile. However, it is possible to use another rendering engine for the
|
|
||||||
template than for the layout by passing the `:layout_engine` option.
|
|
||||||
|
|
||||||
#### RDoc Templates
|
#### RDoc Templates
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
|
@ -1175,10 +1138,10 @@ end
|
||||||
|
|
||||||
To associate a file extension with a template engine, use
|
To associate a file extension with a template engine, use
|
||||||
`Tilt.register`. For instance, if you like to use the file extension
|
`Tilt.register`. For instance, if you like to use the file extension
|
||||||
`tt` for Textile templates, you can do the following:
|
`tt` for Haml templates, you can do the following:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
Tilt.register :tt, Tilt[:textile]
|
Tilt.register :tt, Tilt[:haml]
|
||||||
```
|
```
|
||||||
|
|
||||||
### Adding Your Own Template Engine
|
### Adding Your Own Template Engine
|
||||||
|
|
41
README.md
41
README.md
|
@ -58,7 +58,6 @@ pick up if available.
|
||||||
* [SCSS Templates](#scss-templates)
|
* [SCSS Templates](#scss-templates)
|
||||||
* [Liquid Templates](#liquid-templates)
|
* [Liquid Templates](#liquid-templates)
|
||||||
* [Markdown Templates](#markdown-templates)
|
* [Markdown Templates](#markdown-templates)
|
||||||
* [Textile Templates](#textile-templates)
|
|
||||||
* [RDoc Templates](#rdoc-templates)
|
* [RDoc Templates](#rdoc-templates)
|
||||||
* [AsciiDoc Templates](#asciidoc-templates)
|
* [AsciiDoc Templates](#asciidoc-templates)
|
||||||
* [Radius Templates](#radius-templates)
|
* [Radius Templates](#radius-templates)
|
||||||
|
@ -762,42 +761,6 @@ Since you cannot call Ruby from Markdown, you cannot use layouts written in
|
||||||
Markdown. However, it is possible to use another rendering engine for the
|
Markdown. However, it is possible to use another rendering engine for the
|
||||||
template than for the layout by passing the `:layout_engine` option.
|
template than for the layout by passing the `:layout_engine` option.
|
||||||
|
|
||||||
#### Textile Templates
|
|
||||||
|
|
||||||
<table>
|
|
||||||
<tr>
|
|
||||||
<td>Dependency</td>
|
|
||||||
<td><a href="http://redcloth.org/" title="RedCloth">RedCloth</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>File Extension</td>
|
|
||||||
<td><tt>.textile</tt></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Example</td>
|
|
||||||
<td><tt>textile :index, :layout_engine => :erb</tt></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
It is not possible to call methods from Textile, nor to pass locals to
|
|
||||||
it. You therefore will usually use it in combination with another
|
|
||||||
rendering engine:
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
erb :overview, :locals => { :text => textile(:introduction) }
|
|
||||||
```
|
|
||||||
|
|
||||||
Note that you may also call the `textile` method from within other templates:
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
%h1 Hello From Haml!
|
|
||||||
%p= textile(:greetings)
|
|
||||||
```
|
|
||||||
|
|
||||||
Since you cannot call Ruby from Textile, you cannot use layouts written in
|
|
||||||
Textile. However, it is possible to use another rendering engine for the
|
|
||||||
template than for the layout by passing the `:layout_engine` option.
|
|
||||||
|
|
||||||
#### RDoc Templates
|
#### RDoc Templates
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
|
@ -1202,10 +1165,10 @@ end
|
||||||
|
|
||||||
To associate a file extension with a template engine, use
|
To associate a file extension with a template engine, use
|
||||||
`Tilt.register`. For instance, if you like to use the file extension
|
`Tilt.register`. For instance, if you like to use the file extension
|
||||||
`tt` for Textile templates, you can do the following:
|
`tt` for Haml templates, you can do the following:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
Tilt.register :tt, Tilt[:textile]
|
Tilt.register :tt, Tilt[:haml]
|
||||||
```
|
```
|
||||||
|
|
||||||
### Adding Your Own Template Engine
|
### Adding Your Own Template Engine
|
||||||
|
|
41
README.pl.md
41
README.pl.md
|
@ -55,7 +55,6 @@ którego Sinatra użyje jeżeli będzie dostępny.
|
||||||
* [Szablony Less](#less-templates)
|
* [Szablony Less](#less-templates)
|
||||||
* [Szablony Liquid](#liquid-templates)
|
* [Szablony Liquid](#liquid-templates)
|
||||||
* [Szablony Markdown](#markdown-templates)
|
* [Szablony Markdown](#markdown-templates)
|
||||||
* [Szablony Textile](#textile-templates)
|
|
||||||
* [Szablony RDoc](#rdoc-templates)
|
* [Szablony RDoc](#rdoc-templates)
|
||||||
* [Szablony AsciiDoc](#asciidoc-templates)
|
* [Szablony AsciiDoc](#asciidoc-templates)
|
||||||
* [Szablony Radius](#radius-templates)
|
* [Szablony Radius](#radius-templates)
|
||||||
|
@ -778,42 +777,6 @@ Since you cannot call Ruby from Markdown, you cannot use layouts written in
|
||||||
Markdown. However, it is possible to use another rendering engine for the
|
Markdown. However, it is possible to use another rendering engine for the
|
||||||
template than for the layout by passing the `:layout_engine` option.
|
template than for the layout by passing the `:layout_engine` option.
|
||||||
|
|
||||||
#### Textile Templates
|
|
||||||
|
|
||||||
<table>
|
|
||||||
<tr>
|
|
||||||
<td>Dependency</td>
|
|
||||||
<td><a href="http://redcloth.org/" title="RedCloth">RedCloth</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>File Extension</td>
|
|
||||||
<td><tt>.textile</tt></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Example</td>
|
|
||||||
<td><tt>textile :index, :layout_engine => :erb</tt></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
It is not possible to call methods from Textile, nor to pass locals to
|
|
||||||
it. You therefore will usually use it in combination with another
|
|
||||||
rendering engine:
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
erb :overview, :locals => { :text => textile(:introduction) }
|
|
||||||
```
|
|
||||||
|
|
||||||
Note that you may also call the `textile` method from within other templates:
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
%h1 Hello From Haml!
|
|
||||||
%p= textile(:greetings)
|
|
||||||
```
|
|
||||||
|
|
||||||
Since you cannot call Ruby from Textile, you cannot use layouts written in
|
|
||||||
Textile. However, it is possible to use another rendering engine for the
|
|
||||||
template than for the layout by passing the `:layout_engine` option.
|
|
||||||
|
|
||||||
#### RDoc Templates
|
#### RDoc Templates
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
|
@ -1255,10 +1218,10 @@ end
|
||||||
|
|
||||||
To associate a file extension with a template engine, use
|
To associate a file extension with a template engine, use
|
||||||
`Tilt.register`. For instance, if you like to use the file extension
|
`Tilt.register`. For instance, if you like to use the file extension
|
||||||
`tt` for Textile templates, you can do the following:
|
`tt` for Haml templates, you can do the following:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
Tilt.register :tt, Tilt[:textile]
|
Tilt.register :tt, Tilt[:haml]
|
||||||
```
|
```
|
||||||
|
|
||||||
### Adding Your Own Template Engine
|
### Adding Your Own Template Engine
|
||||||
|
|
|
@ -66,7 +66,6 @@ disponível, o Sinatra irá utilizá-la.
|
||||||
* [SCSS Templates](#scss-templates)
|
* [SCSS Templates](#scss-templates)
|
||||||
* [Liquid Templates](#liquid-templates)
|
* [Liquid Templates](#liquid-templates)
|
||||||
* [Markdown Templates](#markdown-templates)
|
* [Markdown Templates](#markdown-templates)
|
||||||
* [Textile Templates](#textile-templates)
|
|
||||||
* [RDoc Templates](#rdoc-templates)
|
* [RDoc Templates](#rdoc-templates)
|
||||||
* [AsciiDoc Templates](#asciidoc-templates)
|
* [AsciiDoc Templates](#asciidoc-templates)
|
||||||
* [Radius Templates](#radius-templates)
|
* [Radius Templates](#radius-templates)
|
||||||
|
@ -794,40 +793,6 @@ pode utilizar um layout escrito em Markdown. Contudo é
|
||||||
possível utilizar outra engine de renderização como template,
|
possível utilizar outra engine de renderização como template,
|
||||||
deve-se passar a `:layout_engine` como opção.
|
deve-se passar a `:layout_engine` como opção.
|
||||||
|
|
||||||
<table>
|
|
||||||
<tr>
|
|
||||||
<td>Dependência</td>
|
|
||||||
<td><a href="http://redcloth.org/" title="RedCloth">RedCloth</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Extensão do Arquivo</td>
|
|
||||||
<td><tt>.textile</tt></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Exemplo</td>
|
|
||||||
<td><tt>textile :index, :layout_engine => :erb</tt></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
Não é possível chamar métodos por este template, nem passar *locals* para o
|
|
||||||
mesmo. Portanto normalmente é utilizado junto a outra engine de renderização:
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
erb :overview, :locals => { :text => textile(:introducao) }
|
|
||||||
```
|
|
||||||
|
|
||||||
Note que você também pode chamar o método `textile` dentro de outros templates:
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
%h1 Olá do Haml!
|
|
||||||
%p= textile(:saudacoes)
|
|
||||||
```
|
|
||||||
|
|
||||||
Já que você não pode chamar o Ruby pelo Textile, você não
|
|
||||||
pode utilizar um layout escrito em Textile. Contudo é
|
|
||||||
possível utilizar outra engine de renderização como template,
|
|
||||||
deve-se passar a `:layout_engine` como opção.
|
|
||||||
|
|
||||||
#### RDoc Templates
|
#### RDoc Templates
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
|
@ -1247,10 +1212,10 @@ end
|
||||||
|
|
||||||
Para associar uma extensão de arquivo com um engine de template use o método
|
Para associar uma extensão de arquivo com um engine de template use o método
|
||||||
`Tilt.register`. Por exemplo, se você quiser usar a extensão `tt` para os
|
`Tilt.register`. Por exemplo, se você quiser usar a extensão `tt` para os
|
||||||
templates Textile você pode fazer o seguinte:
|
templates Haml você pode fazer o seguinte:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
Tilt.register :tt, Tilt[:textile]
|
Tilt.register :tt, Tilt[:haml]
|
||||||
```
|
```
|
||||||
|
|
||||||
### Adicionando seu Próprio Engine de Template
|
### Adicionando seu Próprio Engine de Template
|
||||||
|
|
42
README.ru.md
42
README.ru.md
|
@ -58,7 +58,6 @@ ruby myapp.rb
|
||||||
- [SCSS шаблоны](#scss-шаблоны)
|
- [SCSS шаблоны](#scss-шаблоны)
|
||||||
- [Liquid шаблоны](#liquid-шаблоны)
|
- [Liquid шаблоны](#liquid-шаблоны)
|
||||||
- [Markdown шаблоны](#markdown-шаблоны)
|
- [Markdown шаблоны](#markdown-шаблоны)
|
||||||
- [Textile шаблоны](#textile-шаблоны)
|
|
||||||
- [RDoc шаблоны](#rdoc-шаблоны)
|
- [RDoc шаблоны](#rdoc-шаблоны)
|
||||||
- [AsciiDoc шаблоны](#asciidoc-шаблоны)
|
- [AsciiDoc шаблоны](#asciidoc-шаблоны)
|
||||||
- [Radius шаблоны](#radius-шаблоны)
|
- [Radius шаблоны](#radius-шаблоны)
|
||||||
|
@ -764,43 +763,6 @@ erb :overview, :locals => { :text => markdown(:introduction) }
|
||||||
один шаблонизатор для отображения шаблона, а другой для лэйаута при помощи
|
один шаблонизатор для отображения шаблона, а другой для лэйаута при помощи
|
||||||
опции `:layout_engine`.
|
опции `:layout_engine`.
|
||||||
|
|
||||||
#### Textile шаблоны
|
|
||||||
|
|
||||||
<table>
|
|
||||||
<tr>
|
|
||||||
<td>Зависимости</td>
|
|
||||||
<td><a href="http://redcloth.org/" title="RedCloth">RedCloth</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Расширения файлов</td>
|
|
||||||
<td><tt>.textile</tt></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Пример</td>
|
|
||||||
<td><tt>textile :index, :layout_engine => :erb</tt></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
В Textile невозможно вызывать методы или передавать локальные переменные.
|
|
||||||
Следовательно, вам, скорее всего, придётся использовать данный шаблон
|
|
||||||
совместно с другим шаблонизатором:
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
erb :overview, :locals => { :text => textile(:introduction) }
|
|
||||||
```
|
|
||||||
|
|
||||||
Обратите внимание на то, что вы можете вызывать метод `textile` из других шаблонов:
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
%h1 Hello From Haml!
|
|
||||||
%p= textile(:greetings)
|
|
||||||
```
|
|
||||||
|
|
||||||
Вы не можете вызывать Ruby код код из Textile, соответственно вы не можете
|
|
||||||
использовать лэйауты на Textile. Тем не менее, существует возможность использовать
|
|
||||||
один шаблонизатор для отображения шаблона, а другой для лэйаута при помощи
|
|
||||||
опции `:layout_engine`.
|
|
||||||
|
|
||||||
#### RDoc шаблоны
|
#### RDoc шаблоны
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
|
@ -1209,10 +1171,10 @@ end
|
||||||
|
|
||||||
Для того, чтобы связать расширение файла с движком рендеринга, используйте
|
Для того, чтобы связать расширение файла с движком рендеринга, используйте
|
||||||
`Tilt.register`. Так, например, вызовите следующий код в том случае, если вы
|
`Tilt.register`. Так, например, вызовите следующий код в том случае, если вы
|
||||||
хотите использовать расширение `tt` для шаблонов Textile:
|
хотите использовать расширение `tt` для шаблонов Haml:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
Tilt.register :tt, Tilt[:textile]
|
Tilt.register :tt, Tilt[:haml]
|
||||||
```
|
```
|
||||||
|
|
||||||
### Добавление собственного движка рендеринга
|
### Добавление собственного движка рендеринга
|
||||||
|
|
39
README.zh.md
39
README.zh.md
|
@ -51,7 +51,6 @@ ruby myapp.rb
|
||||||
* [SCSS 模板](#scss-模板)
|
* [SCSS 模板](#scss-模板)
|
||||||
* [Liquid 模板](#liquid-模板)
|
* [Liquid 模板](#liquid-模板)
|
||||||
* [Markdown 模板](#markdown-模板)
|
* [Markdown 模板](#markdown-模板)
|
||||||
* [Textile 模板](#textile-模板)
|
|
||||||
* [RDoc 模板](#rdoc-模板)
|
* [RDoc 模板](#rdoc-模板)
|
||||||
* [AsciiDoc 模板](#asciidoc-模板)
|
* [AsciiDoc 模板](#asciidoc-模板)
|
||||||
* [Radius 模板](#radius-模板)
|
* [Radius 模板](#radius-模板)
|
||||||
|
@ -695,40 +694,6 @@ erb :overview, :locals => { :text => markdown(:introduction) }
|
||||||
因为不能在 Markdown 中使用 Ruby 语言,你不能使用 Markdown 书写的布局。
|
因为不能在 Markdown 中使用 Ruby 语言,你不能使用 Markdown 书写的布局。
|
||||||
不过,使用其它渲染引擎作为模板的布局是可能的,这需要通过传入 `:layout_engine` 选项。
|
不过,使用其它渲染引擎作为模板的布局是可能的,这需要通过传入 `:layout_engine` 选项。
|
||||||
|
|
||||||
#### Textile 模板
|
|
||||||
|
|
||||||
<table>
|
|
||||||
<tr>
|
|
||||||
<td>依赖项</td>
|
|
||||||
<td><a href="http://redcloth.org/" title="RedCloth">RedCloth</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>文件扩展名</td>
|
|
||||||
<td><tt>.textile</tt></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>例子</td>
|
|
||||||
<td><tt>textile :index, :layout_engine => :erb</tt></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
不能在 textile 中调用 Ruby 方法,也不能传递 locals 给它。
|
|
||||||
因此,你一般会结合其它的渲染引擎来使用它:
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
erb :overview, :locals => { :text => textile(:introduction) }
|
|
||||||
```
|
|
||||||
|
|
||||||
请注意你也可以在其他模板中调用 `textile` 方法:
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
%h1 Hello From Haml!
|
|
||||||
%p= textile(:greetings)
|
|
||||||
```
|
|
||||||
|
|
||||||
因为不能在 Textile 中调用 Ruby 方法,你不能用 Textile 书写布局。
|
|
||||||
不过,使用其它渲染引擎作为模版的布局是可能的,这需要通过传递 `:layout_engine` 选项。
|
|
||||||
|
|
||||||
#### RDoc 模板
|
#### RDoc 模板
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
|
@ -1115,10 +1080,10 @@ end
|
||||||
### 关联文件扩展名
|
### 关联文件扩展名
|
||||||
|
|
||||||
为了将一个文件扩展名到对应的模版引擎,要使用 `Tilt.register`。
|
为了将一个文件扩展名到对应的模版引擎,要使用 `Tilt.register`。
|
||||||
比如,如果你喜欢使用 `tt` 作为 Textile 模版的扩展名,你可以这样做:
|
比如,如果你喜欢使用 `tt` 作为 Haml 模版的扩展名,你可以这样做:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
Tilt.register :tt, Tilt[:textile]
|
Tilt.register :tt, Tilt[:haml]
|
||||||
```
|
```
|
||||||
|
|
||||||
### 添加自定义模板引擎
|
### 添加自定义模板引擎
|
||||||
|
|
Loading…
Reference in New Issue