💾 Archived View for gemini.susa.net › xtract_lua_api.awk captured on 2020-09-24 at 01:28:57.

View Raw

More Information

➡️ Next capture (2023-09-08)

-=-=-=-=-=-=-

#!/usr/bin/awk -f

BEGIN {
    idx = 0;
}

/^===/ {
    print "```"
    for(i=0; i < (idx - 1); i++)
        print ar[i]
    print "```"
    delete ar
    idx = 0

    print("#",prev);
    next;
}

/^---/ { 
    print "```"
    for(i=0; i < (idx - 1); i++)
        print ar[i]
    print "```"
    delete ar
    idx = 0

    print("##", prev);
    next;
}

/^### / { 
    print "```"
    for(i=0; i < (idx); i++)
        print ar[i]
    print "```"
    print $0
    delete ar
    idx = 0

    next;
}

{
    prev = $0 
    ar[idx++] = $0
}