JNIsolutions.Net.HTMLlib
1.3.0
.NET 6.0
This package targets .NET 6.0. The package is compatible with this framework or higher.
.NET Framework 4.8
This package targets .NET Framework 4.8. The package is compatible with this framework or higher.
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package JNIsolutions.Net.HTMLlib --version 1.3.0
NuGet\Install-Package JNIsolutions.Net.HTMLlib -Version 1.3.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="JNIsolutions.Net.HTMLlib" Version="1.3.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="JNIsolutions.Net.HTMLlib" Version="1.3.0" />
<PackageReference Include="JNIsolutions.Net.HTMLlib" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add JNIsolutions.Net.HTMLlib --version 1.3.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: JNIsolutions.Net.HTMLlib, 1.3.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package JNIsolutions.Net.HTMLlib@1.3.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=JNIsolutions.Net.HTMLlib&version=1.3.0
#tool nuget:?package=JNIsolutions.Net.HTMLlib&version=1.3.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
HTML Document Generator
This is a .NET Core project written in C# that generates an HTML formatted document. The project allows users to create HTML documents programmatically.
Features
- Create HTML documents with custom content
- Add HTML elements such as headings, paragraphs, lists, and more
- Easy to extend and customize
Getting Started
Prerequisites
- .NET Core SDK 6.0 or later
Example
Here is an example of how to use the HtmlDocumentGenerator class to create an HTML document:
using HtmlDocumentGenerator;
class Program
{
static void Main(string[] args)
{
var document = new HtmlDocument();
Meta meta = new Meta
{
Name = "viewport",
Content = "width=device-width, initial-scale=1"
};
htmlDocument.Head.Tags.Add(meta);
htmlDocument.Head.Tags.Add(new Title("HTML Test Page"));
Link link1 = new Link
{
Rel = "stylesheet",
Href = "https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css"
};
link1.Elements.Add("Integrity", "sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN");
link1.Elements.Add("CrossOrigin", "anonymous");
htmlDocument.Head.Tags.Add(link1);
Hgroup hgroup = new Hgroup();
hgroup.Keywords.Add(new Heading("Welcome to this Test Page", 1));
hgroup.Keywords.Add(new Para("I like developing web pages"));
htmlDocument.Body.Tags.Add(hgroup);
OL oL = new OL();
oL.Keywords.Add(new LI("This is the first item on an ordered list."));
oL.Keywords.Add(new LI("This is the second item on an ordered list."));
htmlDocument1.Body.Tags.Add(oL);
UL uL = new UL();
uL.Keywords.Add(new LI("This is the first item on an unordered list."));
uL.Keywords.Add(new LI("This is the second item on an unordered list."));
htmlDocument1.Body.Tags.Add(uL);
Table table = new Table();
Caption caption = new Caption("Test Table");
Thead thead = new Thead();
TableRow tableRow1 = new TableRow();
HeaderCell header1 = new HeaderCell("Name");
HeaderCell header2 = new HeaderCell("Age");
tableRow1.Keywords.Add(header1);
tableRow1.Keywords.Add(header2);
thead.Keywords.Add(tableRow1);
Tbody tbody = new Tbody();
TableRow tableRow2 = new TableRow();
DataCell dataCell1 = new DataCell("John");
DataCell dataCell2 = new DataCell("17");
tableRow2.Keywords.Add(dataCell1);
tableRow2.Keywords.Add(dataCell2);
tbody.Keywords.Add(tableRow2);
TableRow tableRow3 = new TableRow();
DataCell dataCell3 = new DataCell("Wendy");
DataCell dataCell4 = new DataCell("16");
tableRow3.Keywords.Add(dataCell3);
tableRow3.Keywords.Add(dataCell4);
tbody.Keywords.Add(tableRow3);
Tfoot tfoot = new Tfoot();
TableRow tableRow4 = new TableRow();
DataCell dataCell5 = new DataCell("Average");
DataCell dataCell6 = new DataCell("16.5");
tableRow4.Keywords.Add(dataCell5);
tableRow4.Keywords.Add(dataCell6);
tfoot.Keywords.Add(tableRow4);
table.Keywords.Add(caption);
table.Keywords.Add(thead);
table.Keywords.Add(tbody);
table.Keywords.Add(tfoot);
htmlDocument1.Body.Tags.Add(table);
// Now that we have done all of the work, save the results to a file...
Console.WriteLine(htmlDocument.ToString());
string htmlFilePath = @"C:\Temp\TestHTML.html";
File.WriteAllText(htmlFilePath, htmlDocument.ToString());
}
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Framework | net48 is compatible. net481 was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETFramework 4.8
- No dependencies.
-
net10.0
- No dependencies.
-
net6.0
- No dependencies.
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
At this stage not all HTML tags are implemented, but the commonly used ones are available. Future versions will progressively implement more tags.