Skip to content

Instantly share code, notes, and snippets.

@angelbladex
Created October 22, 2013 15:36
Show Gist options
  • Save angelbladex/7102907 to your computer and use it in GitHub Desktop.
Save angelbladex/7102907 to your computer and use it in GitHub Desktop.
Script para convertir algún código en html con resaltado de colores, usando el paquete highlight
#!/bin/bash
if [[ ! -n "$1" ]];
then
echo "Nombre de archivo no ingresado"
exit
fi
if [[ ! -f "$1" ]];
then
echo "Ese archivo no existe o se perdió"
exit
fi
highlight -f --inline-css -i $1 > temp
sed '{:q;N;s/\n/<br \/>/g;t q}' temp
rm temp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment