Gtk3 tag file generator

new topic     » goto parent     » topic index » view thread      » older message » newer message
-- 
--  make_gtk3_tags.ex 
-- 
--  usage: eui make_gtk3-tags.ex 
-- 
--  This program creates a tags file from the filebase names of *.html files 
--   in the current directory; therefore, you should run it from the directory  
--   in which you installed your Gtk3 html documentation. It writes the tag file 
--   to:  ~/Geany/tags/gtk3.e.tags 
-- 
 
include std/filesys.e 
include std/sort.e 
include std/sequence.e 
include std/console.e 
 
sequence GEANY_USER_CONFIG = getenv( "HOME") & SLASH & ".config" & SLASH & "geany" 
 
ifdef WINDOWS then 
    GEANY_USER_CONFIG =  getenv( "APPDATA" ) & SLASH & "geany" 
end ifdef 
 
-- create tags directory, if it does not already exist: 
if  create_directory( GEANY_USER_CONFIG & SLASH & "tags" ) then end if 
constant GEANY_TAGS = GEANY_USER_CONFIG & SLASH & "tags" & SLASH 
 
object gtk ={} 
object files = {} 
 
files = dir("*.html") 
for i = 1 to length(files) do 
    gtk = sort(append(gtk, filebase(sprintf("%s",files[i])))) 
end for 
 
if chdir(GEANY_TAGS) then 
    integer fn = open("gtk3.e.tags", "w") 
    puts(fn, "# format=pipe\n") 
    for i = 1 to length(gtk) do 
    printf(fn, "%s|||\n", {gtk[i]}) 
    end for 
    close(fn) 
else 
    puts(1, "\n\n\tFailed to create file gtk3.e.tags\n") 
    any_key() 
end if 
 
 
 
new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu