TextToHtml.bat - Easily create World Wide Web pages!
Posted: 21 Oct 2013 00:44
When I wanted to create some web pages I first tried a couple of the "easy way" sites with disappointing results, because my main interest is to display technical data, informative tables and program code, not text in multiple fonts and colors with background images. Also, I hate that the result of any mouse-driven design depends on my skills to achieve precise mouse movements with my hand! I prefer to write code with certain parameters, test it and modify the values until I am pleased with the result. Yes, I know that I am an old-style text-oriented guy, not a modern GUI-oriented one, but in my humble opinion the write-code method produce more precise results in less time than the mouse & visual one!
Then, I passed to study HTML. After multiple jumps from innumerable HTML-related sites, I decided to create a quick reference guide that include just the most common HTML constructs. However, the "reference guide" quickly evolved into a Batch program that allows me to write just the main parts of a web page using a format similar to the one used on this forum to post topics (BBCode), and the program complete the rest. The results were so amazing that I went crazy and added more and more options until the Batch program becomes a large Text-to-HTML conversion application with a rich set of features. I also wrote an extensive documentation about the capabilities of the conversion program that is by itself a large web page with many detailed examples; I prepared several images, tables, etc. in order to complete the examples.
====================================================================================================
EDIT 2022/03/04: I modified the way to get this program. All the files are now in a single TextToHtml.zip file. Download the .zip file and extract all files in it. Then, open a cmd.exe window on the folder that contains the TextToHtml files and make a duplicate of "1-RenameMeBatAndRunMe1st.TXT" file named "1-RenameMeBatAndRunMe1st.bat" via this command:
Do NOT use REName nor COPY commands, neither the copy-file keys (Ctrl-C + Ctrl-V) of the explorer. The purpose of this trick is fool the OS and create a .BAT file that can be executed. If you rename or copy the original .TXT file, Windows "remembers" that such a file was downloaded from the web and prevents the execution of the .BAT version. Then, execute such file just one time.
EDIT 2023/05/30: I added to TextToHtml.bat program the conversion of Spanish characters áéíóúÁÉÍÓÚüÜñÑ¿¡ into HTML entities. The new code is in the .zip file below, so just download it, delete your TextToHtml.bat file and extract the new TextToHtml.bat code from the .zip file.
Disregard next descriptions below the line about the former method to download this program:
====================================================================================================
Finally, I used my BinToBat.bat program to pack the conversion program, the documentation and all auxiliary data in several encoded files called InstallFiles00.bat to InstallFiles10.bat that I posted here in separated replies because limitations in the size of the posted text. If you want to test my TextToHtml conversion program, download the 11 files and execute InstallFiles00.bat; you should do that in an empty folder.
EDIT: I have modified the way to download my program; it seems that the former method was too complex to follow. The TextToHtml.bat conversion program and its documentation is in the 4 .zip files placed at end of this post; download and extract them, and drag&drop "Creation of World Wide Web pages.txt" file over TextToHtml.bat just once. After that, double click on "Creation of World Wide Web pages.html" to open the documentation.
As an example of what the conversion program does, this is the first part of the text file that contain the TextToHtml.bat program documentation.
Creation of World Wide Web pages.txt:
When this text file is converted by TextToHtml.bat program, it produces this page:
I hope this program be useful to you.
Antonio
Then, I passed to study HTML. After multiple jumps from innumerable HTML-related sites, I decided to create a quick reference guide that include just the most common HTML constructs. However, the "reference guide" quickly evolved into a Batch program that allows me to write just the main parts of a web page using a format similar to the one used on this forum to post topics (BBCode), and the program complete the rest. The results were so amazing that I went crazy and added more and more options until the Batch program becomes a large Text-to-HTML conversion application with a rich set of features. I also wrote an extensive documentation about the capabilities of the conversion program that is by itself a large web page with many detailed examples; I prepared several images, tables, etc. in order to complete the examples.
====================================================================================================
EDIT 2022/03/04: I modified the way to get this program. All the files are now in a single TextToHtml.zip file. Download the .zip file and extract all files in it. Then, open a cmd.exe window on the folder that contains the TextToHtml files and make a duplicate of "1-RenameMeBatAndRunMe1st.TXT" file named "1-RenameMeBatAndRunMe1st.bat" via this command:
Code: Select all
type 1-RenameMeBatAndRunMe1st.TXT > 1-RenameMeBatAndRunMe1st.bat
EDIT 2023/05/30: I added to TextToHtml.bat program the conversion of Spanish characters áéíóúÁÉÍÓÚüÜñÑ¿¡ into HTML entities. The new code is in the .zip file below, so just download it, delete your TextToHtml.bat file and extract the new TextToHtml.bat code from the .zip file.
Disregard next descriptions below the line about the former method to download this program:
====================================================================================================
Finally, I used my BinToBat.bat program to pack the conversion program, the documentation and all auxiliary data in several encoded files called InstallFiles00.bat to InstallFiles10.bat that I posted here in separated replies because limitations in the size of the posted text. If you want to test my TextToHtml conversion program, download the 11 files and execute InstallFiles00.bat; you should do that in an empty folder.
EDIT: I have modified the way to download my program; it seems that the former method was too complex to follow. The TextToHtml.bat conversion program and its documentation is in the 4 .zip files placed at end of this post; download and extract them, and drag&drop "Creation of World Wide Web pages.txt" file over TextToHtml.bat just once. After that, double click on "Creation of World Wide Web pages.html" to open the documentation.
As an example of what the conversion program does, this is the first part of the text file that contain the TextToHtml.bat program documentation.
Creation of World Wide Web pages.txt:
Code: Select all
A World Wide Web page (or "internet document") is a text file written in accordance to the HyperText Markup Language (HTML) specification. When this file is placed in an internet server, it defines an "internet site" that may be reviewed by anyone that have internet access, although you do not need such access to review your own local web pages. Anyone can create a file with .html extension using a text editor like Windows Notepad, but the HTML specification is extensive and requires a certain domain knowledge in order to successfully create a web page.
[b]TextToHtml.bat[/b] is a conversion program that process a text file and translate it to a HTML file, so it allows the creation of completely functional web pages (like [i]this[/i] one) in a very simple way. The display parameters used in the created file have carefully selected default values, so the general aspect of the resulting page is very pleasant. The web elements are defined via a very simple method that allows the creation of a page in minutes, even with complex elements like lists, tables, animated images, etc. A series of optional values may be used to enrich the default appearance of any element, so the final look may be professional and complete. The only aspect that can not be changed is the general layout of the document, that resembles the [url=new:http://en.wikipedia.org/wiki/Wikipedia:Manual_of_Style/Layout]article layout of Wikipedia[/url] including a table of contents.
The elements of the web page are defined enclosing segments in the text file between special markers, called [i]tags[/i], that gives specific format to the segment; the tags are groups of equal-sign characters (like ===) or short words enclosed in square brackets (like [tag]) with the ending tag preceded by a slash (like [/tag]). For example, the contents of a file may be this one: "Normal text [tag]formatted text[/tag] more normal text"; when this file is converted and displayed in a web page, it looks this way: "Normal text [code]formatted text[/ code] more normal text".
There are four types of tags that achieve different formatting operations: 1-Document subdivisions, 2-Text attributes, 3-Hypertext links and 4-Multi-line sections. These tags are explained in this document using concise descriptions and simple examples, but the descriptions will become larger and the examples numerous as the complexity of the described tag increases. If the description of a given tag suddenly becomes too complex for you, just pass to the next tag and return to that one later; the advanced features of any tag will be comprehended in an easier way after using the basic ones.
I hope this program be useful to you.
Antonio