mirror of
https://github.com/arcan1s/arcanis.me.git
synced 2025-04-24 23:37:19 +00:00
fix url, fix macro code
This commit is contained in:
parent
552d7084fb
commit
3196df0303
@ -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
|
||||
|
||||
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
|
||||
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 `$`.
|
||||
|
||||
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`.
|
||||
|
@ -129,11 +129,14 @@ X-AW-HasReturn=false
|
||||
# <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`.
|
||||
|
@ -26,7 +26,7 @@ links:
|
||||
- Пакеты для <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/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 -->
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user