 Okay, today we're going to be looking at taking the code, the scripts or the code before we compile, and making it viewable in an HTML format so you can post it online. If you enjoy my tutorials and would like to see more, please think about contributing to my Patreon account at patreon.com forward slash metalx1000. Something similar to what websites like Pastebin does. So here's two very simple examples. The program has lots of features in it. The program is called Code2HTML and should be in your repositories, at least it is on Debian. So just use your package manager to install it, Code2HTML. And so here we have two scripts or a script and some C codes. So I'll cat out my code and this is a little bash script I wrote for a credit card swiper to actually swipe. I think this is my version for driver's licenses. Or it might be the credit card one. It doesn't really matter. Yeah, this is the credit card one. Anyway, there's the code. That's what it looks like in plain text. If we were to just take this, and actually let's just take this and put it into, I always call it temp.html. And then I'll open it up with my default web browser, which is IceWeasel. You can see not only is it not color coded, but HTML browsers don't recognize new line characters. They use tags for new lines which don't exist in this script. So we could very easily replace all new lines with a new line tag, but still wouldn't be color coding it and indentations would be lost as well. So that's where Code2HTML comes in. So let me just quickly show you another example, my main C, which is just a C program here. So, you know, we want some color coding. We want the new lines. We want indentations where I have indentations because, again, HTML doesn't really recognize most white space. So let's go ahead and use Code2HTML. We'll give it the name of our script. So we'll start off with our code.sh. And at this point, if I just did enter, it just gives the standard output of what the HTML code would look like. You can see that it puts in some color codes here for the fonts. And this is great. It doesn't really help us, though. We want to output it to a file. You can always, you know, redirect it to a file, but we'll just say Code.html. So we got Code.html. Let's clear the screen here. Code.html, the input code, and then the output file we want to go to. I'll hit Enter. I did not tell it what language it is, so it guess it. It says here, Language Mode, not given. Guessing, it's going to guess and use a shell script, which it is a shell script. So it does do some thinking on its own, although you could tell it specifically this is a shell script. So at this point, I'm going to open it up with my default browser again, Code.html. And there we go. Now, I'll admit the default settings on this, the color coding isn't that great. I mean, I would like to see it highlight the commands like clear and echo and while, but most important things here is it puts everything on new lines like they're supposed to be. It does the indentations like it's supposed to, and there is some color coding. Let's go back here and let's run it with our other code here. So I'll say MainC, and I want the output to be MainC.html. And again, I did not give it the language, so it's going to guess and it's going to guess that it is a C program. And so it guessed properly because it was a C program. So again, I'll do my default web browser, which is Ice Weasel, and I output it that as Main.html. Here's what the code looks like. So we had some color coding here, the indentations, and all the new lines as they should be. So this is great if you want to create some HTML files to share your scripts with and keep the formatting and display it in a web browser. That's great. Let's have a quick look here at the man file for code to HTML. It actually has some fairly written man files here, the manuals, and it tells you right here that use it, give it the options, input file, and output file. So far we haven't really given any options, but let's look at some of them. Excuse me. So we have our language options here, verbose, and this one's neat, the line numbers. So let's quit out of this. Let's run the same code again. I'll do dash n now though. So you can see by default it overridden the last file, so keep that in mind. It's not going to ask you, are you sure you want to override? And let's just view that in our web browser. So what the dash ended was it numbered the lines. So we actually have line numbers here if you wanted those, which is good for troubleshooting if you're sharing the code and someone's trying to help you. Oh, I think the problem's on line 19. So without the numbers, with the numbers. So again, lots of options for this program. And if we come down here in the man file, you can also see that section three CGI. So you can use this on a web server, even if it didn't have these options, you could write some code out. But it actually has an interface that can work with Apache and other stuff. So if you wanted to set up your own web server similar to Pastebin, and there's a lot out there for this, you could actually write a server side code using this and have it generate the code on the fly and output it as HTML. So if that's something you want to do, you may want to look into this program. Anyway, I found it useful. It's just a little tip. There's other options in here, of course, as far as like setting the title of the HTML page. Looks like there's, and I haven't gotten into it. I've only used it for the basic features I've shown you so far. You can, I guess, create template files, whether you want headers, you know, line widths, line breaks. So you can tell it a lot and make it more customized to what you need. So anyway, as always, I thank you for watching. I hope you visit my website, Filmsitechris.com. I hope you'll think about supporting my site on my Patreon site. That's patreon.com forward slash metal x1000. It should be a link to both those sites in the description of the video. And as always, I hope that you have a great day.