Created
October 22, 2013 15:36
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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