and I finally got one in Bacon
why ? so we can post some "pretty" code examples here in the forum
since the code thingy we use here in the forum chops up the formatting and doesnt have color
I will expand this to bacon2html and other formats
I was able to get an Idea working in bash
but I really wanted to take a swing at doing it in BaCon
some background info
so this is my second Bacon code attempt
I looked over some of the official examples and some here in the forum
and made very minor edits to get a feel for what is taking place
and then went for it and it works
what takes place is all the bacon keywords get coded to be seen as blue
and all the HUG keywords get coded to be seen as green
imagine all the keywords in a file are searched
and replaced automatically so any GUI could call this binary now
I will be able to make a bacon2html or other formats to follow later
Joe
' *****************************************************
' PROGRAM: bacon2bbc.bac
' PURPOSE: convert Bacon and HUG keywords to phpBB code
' AUTHOR: big_bass Joe Arose + a big thanks to rod the GatorDog
' DEPENDS: gcc, bacon, replace
' PLATFORM: linux
' DATE: Oct 17-2011
' NOTES: you must have the replace package installed http://replace.richardlloyd.org.uk/
' LICENSE: GPL version 3 or later
' *****************************************************
' a big thanks to rod the GatorDog for giving me help and code snippets
' to improve , simply and correctly format the code for BaCon
' USUAGE: ./bacon2bbc /path-and-filename"
' note the file will get a -BBcode added to the filename
Code: Select all
# ./bacon2bbc /root/bacon-highlighting/hug.bac
when you post the code in the forum place it between the quote brackets instead that
allows for color to be used [/quote]