aboutsummaryrefslogtreecommitdiffstats
path: root/gem2gem.awk
diff options
context:
space:
mode:
authorsejo <sejo@texto-plano.xyz>2021-05-19 20:24:33 -0500
committersejo <sejo@texto-plano.xyz>2021-05-19 20:24:33 -0500
commita190c3707b5e31a11890af657f96960b05d5f38e (patch)
tree0a5d214b60054d68b75795421ec910b368a6920b /gem2gem.awk
parenta0ce9d274bec7c704c3fa7fae76d28ef3a3a680e (diff)
downloadsitio-a190c3707b5e31a11890af657f96960b05d5f38e.tar.gz
no agregues enlace si ya es línea de link
Diffstat (limited to 'gem2gem.awk')
-rw-r--r--gem2gem.awk23
1 files changed, 6 insertions, 17 deletions
diff --git a/gem2gem.awk b/gem2gem.awk
index 1ede906..e289f35 100644
--- a/gem2gem.awk
+++ b/gem2gem.awk
@@ -1,25 +1,12 @@
-function wikiLink( t ){
- i = match( t, /{.+}/)
- if ( i ){
- ifinal = index(t, "}") # índice del } final
- prev = substr(t, 1, i-1) # string previa al link
- link = substr(t, i, ifinal-i+1) # {link}
- nombre = substr(t, i+1, ifinal-i-1) # link
- post = substr(t, ifinal+1) # string posterior
+# imprime líneas normamlmente
- return "=> " nombre ".gmi " link
- }
- else{
- return t
- }
-}
-
-{
+{
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
@@ -30,6 +17,8 @@ function wikiLink( t ){
print "=> " nombre ".gmi " link
}
+# agrega footer
+
END{
print ""
print "página actualizada en: "
Un proyecto texto-plano.xyz