turnermm / TextInsert

A macro utility for Dokuwki
http://www.dokuwiki.org/plugin:textinsert
8 stars 4 forks source link

In using a TextInsert macro as a reference variable, it takes the literal term and not the reference. #26

Open Anonymous215025 opened 4 years ago

Anonymous215025 commented 4 years ago

I will be using the struct plugin as an example, it uses a syntax like so to pull up a table of information:

Page ID = food:chocolate_cake

======Chocolate Cake======
=====Chocolate Cake Recipe=====
---- struct table ----
schema   : recipe
cols     : recipe_ingredients
filter   : food = food:chocolate_cake
----

Where I want to use TextInsert and replace food = #@ID@# however it does not work as it takes in the literal string:

filter : food = #@ID@#

I have tried using parameter interpolation from reading this example: https://github.com/turnermm/TextInsert/issues/25#issuecomment-604537718

Macro Name: current_page_id Macro Definition: %1 Macro Reference: filter : food = #@current_page_id~#@ID@#~@#

Does not seem to work either as my expected tables to appear does not appear. What are your suggestions?

turnermm commented 4 years ago

It's my recollection that the struct plugin does not accept textinsert macros. But you might try either this: #@current_page_id~#@_ID_@#~@# Or this: #@current_page_id~_ID_~@# The _ID_ is a special textinset macro representing the current page.

PSilverQ commented 2 years ago

I used like this {{@HOME_BASE@#/video/a.mp4}}, and macro doesn't work

turnermm commented 2 years ago

Macros are not parsed inside links. Also, your syntax is incorrect. It should be #@HOME_@#