HtmlForgeX

API Reference

Class

LibraryDownloader

Namespace HtmlForgeX
Assembly HtmlForgeX

Support class to help building HtmlForgeX without the manual effort of maintaining CSS and JS files locally. It downloads the external resources referenced by available libraries.

Inheritance

  • Object
  • LibraryDownloader

Constructors

LibraryDownloader 3 overloads
public LibraryDownloader() #

Initializes a new instance of the LibraryDownloader class using the default HTTP fetch behavior.

LibraryDownloader(System.Net.Http.HttpClient arg1) #

Internal constructor for injecting custom HTTP clients.

Parameters

arg1 System.Net.Http.HttpClient required
LibraryDownloader(System.Func{System.String,System.String,System.String,System.Threading.Tasks.Task} arg1) #

Internal for tests: inject a custom fetch delegate (url, mappedPath, root).

Parameters

arg1 System.Func{System.String,System.String,System.String,System.Threading.Tasks.Task} required

Methods

DefaultFetchAsync(System.String arg1, System.String arg2, System.String arg3) #

Default HTTP fetcher: downloads URL and saves either to a mapped relative path or to the file name derived from the URL.

Parameters

arg1 System.String required
arg2 System.String required
arg3 System.String required
DownloadFileAsync(System.String rootPath, System.String url) #

Downloads the file from the URL.

Parameters

rootPath System.String required
The root path.
url System.String required
The URL.

Exceptions

  • ArgumentException – Unsupported file type: {fileName}
DownloadFileMappedAsync(System.String arg1, System.String arg2, System.String arg3) #

Downloads a file from URL but saves it using an explicit local relative path (e.g., "Scripts/my.js").

Parameters

arg1 System.String required
arg2 System.String required
arg3 System.String required
DownloadLibraryAsync 2 overloads
public async Task DownloadLibraryAsync(String rootPath) #
Returns: Task

Downloads all CSS and JS files for all libraries into given folder for easy inclusion in project

Parameters

rootPath System.String requiredposition: 0
The root path.
public async Task DownloadLibraryAsync(String path, Libraries libraryEnum) #
Returns: Task

Downloads specific library CSS and JS files into given folder for easy inclusion in project

Parameters

path System.String requiredposition: 0
The path.
libraryEnum HtmlForgeX.Libraries requiredposition: 1
The library enum.
public async Task<List<String>> GenerateTablerIconCodeAsync(String cssFilePath) #
Returns: Task<List<String>>

Generates the tabler icon code so it can be easily copied to the TablerIconLibrary class.

Parameters

cssFilePath System.String requiredposition: 0
The CSS file path.
NumberToWord(System.String input) #

Numbers to word to help with pascal case conversion.

Parameters

input System.String required
The input.
ToPascalCase(System.String input) #

Converts to pascalcase so icon names can be used as properties.

Parameters

input System.String required
The input.

Properties

public Boolean StripSourceMapComments { get; set; } #

When true, removes sourceMappingURL comments from downloaded JS/CSS files. Useful for CDN mirrors that should not reference upstream source maps.