CodeWebifier

convert source code files into stylized HTML fragments for web pages

Fig 1. CodeWebifier Output

1.0 About

CodeWebifier is a C# console utility that takes raw source code files (C#, C++, Rust, Python, etc.) and converts their content into a web page fragment - HTML with inline styling suitable for embedding in web documentation, technical blogs, or project websites. The formatted HTML is written to the console so you can copy and paste it wherever needed. This is a quick way to ensure code snippets are displayed correctly with syntax highlighting on the web.

2.0 Features

  • Converts source code files to self-contained HTML blocks
  • Generates web page fragments ready for embedding in an existing page body
  • Writes HTML output to the console for convenient copy-and-paste
  • Built as a C# console application - simple to build and run

3.0 Building

Prerequisites: .NET Framework or .NET Core and a C# compiler (Visual Studio or dotnet CLI). Clone and build:
git clone https://github.com/JimFawcett/CodeWebifier.git
cd CodeWebifier
dotnet build
Or open CodeWebifier.sln in Visual Studio and build the solution there.

4.0 Usage

Run from the command line with a path to the source file you want to convert:
CodeWebifier.exe <path_to_source_file>
The resulting HTML fragment is printed to stdout. Redirect to a file or copy from the terminal.