fix url, fix macro code

This commit is contained in:
Evgenii Alekseev 2016-07-20 14:59:39 +03:00
parent 552d7084fb
commit 3196df0303
3 changed files with 10 additions and 6 deletions

View File

@ -127,12 +127,13 @@ The code will be expanded to:
# <a href="#macros" class="anchor" id="macros"><span class="octicon octicon-link"></span></a>Macros # <a href="#macros" class="anchor" id="macros"><span class="octicon octicon-link"></span></a>Macros
Another new feature is macros. User may define any own function by using the following Another new feature is macros. User may define any own function by using the following
construction `$aw_macro<my_macro_name,some_arg,another_arg>{{macro body here with $some_arg}}`. construction
`$aw_macro<my_macro_name,some_arg,another_arg>{% raw %}{{{% endraw %}macro body here with $some_arg{% raw %}}}{% endraw %}`.
The first argument is macros name, which is required. Another ones describe arguments The first argument is macros name, which is required. Another ones describe arguments
which will be passed to the macro call. Macro body may have any text (including templates, which will be passed to the macro call. Macro body may have any text (including templates,
lambdas, etc) and arguments which are defined by using `$`. lambdas, etc) and arguments which are defined by using `$`.
To put defined macro to your code use the following construction: To put defined macro to your code use the following construction:
`$aw_macro_my_macro_name<$cpu,$cpucl>{{}}` (body will be ignored here). In this `$aw_macro_my_macro_name<$cpu,$cpucl>{% raw %}{{}}{% endraw %}` (body will be ignored here). In this
example macro will be expanded to `macro body here with $cpu`. example macro will be expanded to `macro body here with $cpu`.

View File

@ -129,11 +129,14 @@ X-AW-HasReturn=false
# <a href="#macros" class="anchor" id="macros"><span class="octicon octicon-link"></span></a>Макросы # <a href="#macros" class="anchor" id="macros"><span class="octicon octicon-link"></span></a>Макросы
Другая особенность - макросы. Пользователь может определить свою функцию, используя Другая особенность - макросы. Пользователь может определить свою функцию, используя
следующую конструкцию `$aw_macro<my_macro_name,some_arg,another_arg>{{macro body here with $some_arg}}`. следующую конструкцию
`$aw_macro<my_macro_name,some_arg,another_arg>{% raw %}{{{% endraw %}macro body here with $some_arg{% raw %}}}{% endraw %}`.
Первый аргумент - имя макроса - обязателен. Другие описывают аргументы, которые Первый аргумент - имя макроса - обязателен. Другие описывают аргументы, которые
будут переданы при вызове макроса. Тело макроса может иметь любой текст (включая будут переданы при вызове макроса. Тело макроса может иметь любой текст (включая
шаблоны, лямбды и прочее) и аргументы, определенные используя `$`. шаблоны, лямбды и прочее) и аргументы, определенные используя `$`.
Чтобы вызвать макрос в коде нужно использовать следующую конструкцию: `$aw_macro_my_macro_name<$cpu,$cpucl>{{}}` (тело функции будет проигнорировано Чтобы вызвать макрос в коде нужно использовать следующую конструкцию:
здесь). В данном примере, макрос будет развернут в `macro body here with $cpu`. `$aw_macro_my_macro_name<$cpu,$cpucl>{% raw %}{{}}{% endraw %}` (тело функции
будет проигнорировано здесь). В данном примере, макрос будет развернут в
`macro body here with $cpu`.

View File

@ -26,7 +26,7 @@ links:
- Пакеты для <a href="//github.com/arcan1s/awesome-widgets/releases" title="Ubuntu">Ubuntu</a> - Пакеты для <a href="//github.com/arcan1s/awesome-widgets/releases" title="Ubuntu">Ubuntu</a>
- <a href="/ru/2014/09/04/migration-to-v2/" title="Миграция">Миграция на версию 2.0</a> - <a href="/ru/2014/09/04/migration-to-v2/" title="Миграция">Миграция на версию 2.0</a>
- <a href="/ru/2014/12/19/aw-v21-bells-and-whistles/" title="Расширения">Расширения</a> - <a href="/ru/2014/12/19/aw-v21-bells-and-whistles/" title="Расширения">Расширения</a>
- <a href="/en/2016/06/05/aw-formatters-and-macros/" title="Форматеры и макросы">Форматеры и макросы</a> - <a href="/ru/2016/06/05/aw-formatters-and-macros/" title="Форматеры и макросы">Форматеры и макросы</a>
--- ---
<!-- info block --> <!-- info block -->