Sunday, 31 January 2016

EPSILON EXTENSION LANGUAGE - EEL

String replacement code in eel


  • Open Epsilon editor
  • Create a file using command Ctrl-X-Ctrl-F
  • Write the name of file “String_Replacement” and extension should be “.e” now the file name would be “String_Replacement.e” (file name can be any but extension should be .e)
  • Hit the enter
  • Now inside the file write below code 
#include "eel.h"

command rep1()
{
    string_replace("%<name>([^<>]+)%</name>", "<surname>#1</surname>", REGEX);
}
  • Now compile using ALT-F3
  • Run the command you made rep1 (command name can be any)
  • Run command, Alt-X
  • Command name, rep1
  • Hit the enter.
Please watch the video for better understanding:

Thursday, 28 January 2016

Cross Reference linking source code in epsilon extension language (eel)

Long time ago, I was working for a project based on e-book conversion. The main pain area of the project was bookmark or we can say cross reference linking. It was very time consuming and almost 30-40% time consuming out of 100% so I have tried to writing an source code in epsilon extension language "eel" and I succeed on writing this code and it reduces almost 20-30% of our production time. I did not get any thing from my company for writing this source code but and letting them use it but it makes me feel happy. Couple days ago one of my friend want me to write a source code for cross reference linking so I decided not to writing exact source code but I will share this source code which is similar to his requirement so here we go.

Dedicated to Vignesh Kumar, please use this source code for your requirement, if you don't understand anything please let me know I will write exact code you need.

command internalbib1()
{
    int a, b, c, d, e, f;
    char dest[1000], src[1000], *pet=".+<min>", linkendvalue[1000];
    while(search(1, "<link linkend=\"\">"))
    {
        search(-1, "<link linkend=\"\">");
        search(1, "<link linkend=\"\">");
        point=point-17;
        set_mark();
        search(1, "</link>");
        narrow_to_region();
        search(1, ">");
        a=point;
        search(1, ",");
        b=point-1;
        grab(a,b, src);
        strcat(src, pet);
        re_search(1, "([0-9][0-9][0-9][0-9])");
        c=point;
        d=point-4;
        grab(c,d, dest);
        strcat(src, dest);
        widen_buffer();
        next_window();
        goto_beginning();
        if(re_search(1, src)==1)
        {
            re_search(-1, src);
            search(-1, "xml:id=\"");
            e=point+8;
            search(1, "\">");
            f=point-2;
            grab(e,f, linkendvalue);
            previous_window();
            search(-1, "<link");
            search(1, "linkend=\"");
            stuff(linkendvalue);

            search(-1, "linkend=\"\"");

        }
        else
        {
            previous_window();
        }
    }
}

This source code belongs to me and everyone can use it freely, there is no issue to use this source code.