Giter Site home page Giter Site logo

textinsert's People

Contributors

alexbelchior avatar alexgearbox avatar crystal-rainslide avatar dokuwiki-translate avatar splitbrain avatar turnermm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

textinsert's Issues

Entities within HTML macros

I'm trying to make a macro to explain the use of commands and the common syntax for required parameters is <parameter>. But if I include <parameter> or &lt;parameter&gt; in the macro replacement, it is converted to regular <parameter> on insert and hidden as an unknown HTML tag.

Buttons don't work

When I click on add or delete the information Text gets invisible and nothing happens
I'm using DokuWiki Release 2018-04-22a "Greebo"

Macro does not work inside link

For example a macro "ProjectDocUrl" inside this dokuwiki text "[[#@ProjectDocUrl@#|text]]" is not replaced causing broken links.

Context of macro variables

If I use a macro with a variable (i.e. #@ID@# ) in the sidebar, the value is always taken from the sidebar.
Is it wanted like that? For me a dynamic value from the current page would be more useful.

Textinsert with comma

Hi,

is there a possibility to use the comma inside a parameter for the expanded functionality of the textinsert plugin?
Example:

@MSG_ACHTUNG_HTMLVorsicht, Gefahr fehlerhafter Datenverarbeitung@

The text "Vorsicht, Gefahr fehlerhafter Datenverarbeitung" should be transformed only to one parameter "%1"

Regards Juergen

textinsert with wrap-plugin

Hi,

my idea is to insert the syntax for boxes of the wrap plugin because this syntax is a little complicated for most of the wiki-users. So I defined a macro called
"MSG_INFO" with the syntax "< WRAP round info 60% > Testtext < / WRAP >"
When using the macro in a site by the syntax "#@MSG_INFO@#" the result is the macro definition string "< WRAP round info 60% > Testtext < / WRAP >", but not the box of the wrap plugin.
Now my question: Is there a way of doing this?

Regards Juergen

Error parsing HTML macros

Hi,

I'm trying to create a macro which is a link (html label "a"), and I want to see the same CSS than if it is created as normal.

The macro I've created is something like:
< a href="http://domain/blablabla?parameter=%1" class="urlextern" title="My title" rel="nofollow">The text< /a>
(I've writen the spaces in the label in order to see properly the macro)

The macro is stored in the file macros.ser with the HTML entities (""" instead of ", etc)
When parsing the macro it seems that it doesn't do anything with those entities and the result is an strange HTML source, which is not properly parsed by the server

I notice that the "<" and ">" are changed properly, so I though that only those entities are processed

I've taking a look on this and I've found that in the file syntax.php of the plugin, in the function "handle", at the end, is this code:

    if($html) {
      $match =  str_replace('&lt;','<',$match);
      $match =  str_replace('&gt;','>',$match);
    }

Here I added the 2 problematic entities I've had, leaving that part of code as:

    if($html) {
      $match =  str_replace('&lt;','<',$match);
      $match =  str_replace('&gt;','>',$match);
      $match =  str_replace('&quot;','"',$match);
      $match =  str_replace('&amp;','&',$match);
    }

And for me it's working now properly

Maybe it could be a good idea to manage all the HTML entities for nexts versions

If I did something wrong, please, let me know

Thanks,
regards.

Macros inside the File or Code tag

I want to use a macros inside the file or code tag, but it does not work.
Here is my macros DC:

dc(){ bash... }; dc "%1"

If i just write #@DC~data~@# it will work, but if i wrap it with code tag like this:

<code bash>
#@DC~data~@#
</code>

i see #@DC~data~@# as is.

And i tried already put html tags to DC_HTML to simulate the code tag (<pre></pre>). But i think this is a bad idea and syntax highlighting is not working with this.

So, how can i achieve this?

macro not substituted in http link

Hi,
I created a macro srvdoc which is correcly substituted using #@srvdoc@#
I hoped to store in this macro the base name of a server address because it can change depending where the wiki is located.
But I cannot get the macro to be substituted inside the https link, it shows up like this :
https://#@srvdoc@#/gems/mco-k6/n4/xpOpenDocAgent.xsp?ref=121759/DID.238&get=file
Is it there a way around this ?
Thank you for your answer
PS : I am using 2014-09-29b "Hrun" and the oldest compatible declared on your wiki page is 2014-05-05a "Ponder Stibbons", could this be the problem ?

Location of macro file hardcoded instead of configurable

The location of "macros.ser" is hardcoded in this plugin. This bites me in a Farm setup, so I patched the Issue. Instead of relying on "doku_inc" and hardcoding "data/meta/macros" I now use $conf['metadir']/macros:

diff -urNb /root/dokuwiki/TextInsert-master/admin.php ./admin.php
--- /root/dokuwiki/TextInsert-master/admin.php  2013-05-05 16:52:38.000000000 +0200
+++ ./admin.php 2013-05-07 16:28:39.000000000 +0200
@@ -7,7 +7,9 @@
  */
 if(!defined('DOKU_INC')) die();

-define('REPLACE_DIR', DOKU_INC . 'data/meta/macros/');
+
+global $conf;
+define('REPLACE_DIR', $conf[metadir]. '/macros/');
 define('MACROS_FILE', REPLACE_DIR . 'macros.ser');
 /**
  * All DokuWiki plugins to extend the admin function
diff -urNb /root/dokuwiki/TextInsert-master/syntax.php ./syntax.php
--- /root/dokuwiki/TextInsert-master/syntax.php 2013-05-05 16:52:38.000000000 +0200
+++ ./syntax.php        2013-05-07 16:38:26.000000000 +0200
@@ -11,7 +11,8 @@

 if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
 require_once(DOKU_PLUGIN.'syntax.php');
-define('REPLACE_DIR', DOKU_INC . 'data/meta/macros/');
+global $conf;
+define('REPLACE_DIR', $conf[metadir]. '/macros/');
 define('MACROS_FILE', REPLACE_DIR . 'macros.ser');

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

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: #25 (comment)

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.