aboutsummaryrefslogtreecommitdiffstats
path: root/gem2gem.awk
blob: e289f353b785b52b5921cd233e883ae5ab373412 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

# imprime líneas normamlmente

{ 
	print $0
}

# si tienen sintaxis de wikilink, y no son líneas de enlace, agrega el link
/^[^=].+{.+}/{
	i = match( $0, /{.+}/)
	ifinal = index($0, "}") # índice del } final

	link = substr($0, i, ifinal-i+1) # {link}
	nombre = substr($0, i+1, ifinal-i-1) # link	

	print ""
	print "=> " nombre ".gmi " link 
}

# agrega footer 

END{
	print ""
	print "página actualizada en: "
	fecha = system( "date -r " FILENAME " --rfc-3339=date" )
}
Un proyecto texto-plano.xyz