diff --git a/README.md b/README.md index db782692..19accb96 100644 --- a/README.md +++ b/README.md @@ -401,6 +401,16 @@ Available Options: +#### Embedded Templates + +```ruby + get '/' do + haml '%div.title Hello World' + end +``` + +Renders the embedded template string. + ### Available Template Languages Some languages have multiple implementations. To specify what implementation @@ -864,16 +874,6 @@ The `:callback` and `:variable` options can be used to decorate the rendered obj Since calling ruby methods is not idiomatic in wlang, you almost always want to pass locals to it. Layouts written in wlang and `yield` are supported, though. -#### Embedded Templates - -```ruby - get '/' do - haml '%div.title Hello World' - end -``` - -Renders the embedded template string. - ### Accessing Variables in Templates Templates are evaluated within the same context as route handlers. Instance diff --git a/README.ru.md b/README.ru.md index 498a729c..89ddbc63 100644 --- a/README.ru.md +++ b/README.ru.md @@ -416,6 +416,16 @@ set :views, settings.root + '/templates' `:'subdir/template'`). Вы должны использовать символы, потому что иначе шаблонизаторы попросту отображают любые строки, переданные им. +#### Встроенные шаблоны + +```ruby +get '/' do + haml '%div.title Hello World' +end +``` + +Отобразит встроенный шаблон, переданный строкой. + ### Доступные шаблонизаторы Некоторые языки шаблонов имеют несколько реализаций. Чтобы указать, какую @@ -886,16 +896,6 @@ var resource = {"foo":"bar","baz":"qux"}; present(resource); исключением `yield`), то вы почти всегда будете передавать в шаблон локальные переменные. -### Встроенные шаблоны - -```ruby -get '/' do - haml '%div.title Hello World' -end -``` - -Отобразит встроенный шаблон, переданный строкой. - ### Доступ к переменным в шаблонах Шаблоны интерпретируются в том же контексте, что и обработчики маршрутов.