HtmlForgeX

API Reference

Class

Head

Namespace HtmlForgeX
Assembly HtmlForgeX
Base Element

Core definition for the Head element.

Inheritance

Usage

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Constructors

public Head(Document document) #

Initializes a new instance of the Head class.

Parameters

document HtmlForgeX.Document requiredposition: 0
Owning document.

Methods

public Boolean AddAnalytics(AnalyticsProvider provider, String identifier) #
Returns: Boolean

Adds analytics tracking code based on the specified provider.

Parameters

provider HtmlForgeX.AnalyticsProvider requiredposition: 0
identifier System.String requiredposition: 1
public Head AddAuthorMeta(String author) #
Returns: Head

Adds an author meta tag.

Parameters

author System.String requiredposition: 0
public Head AddCharsetMeta(String charset) #
Returns: Head

Adds or replaces the charset meta tag.

Parameters

charset System.String requiredposition: 0
public Void AddCssInline(String css) #
Returns: Void

Adds inline CSS content to the document head.

Parameters

css System.String requiredposition: 0
public Void AddCssStyle(Style style) #
Returns: Void

Adds a Style object to the list of styles.

Parameters

style HtmlForgeX.Style requiredposition: 0
public Head AddDefaultStyles() #
Returns: Head

Adds a set of minimal default styles used by many generated documents.

public Head AddHttpEquivMeta(String httpEquiv, String content) #
Returns: Head

Adds an HTTP-equiv meta tag.

Parameters

httpEquiv System.String requiredposition: 0
content System.String requiredposition: 1
public Void AddJsImportMapEntries(IReadOnlyDictionary<String, String> imports) #
Returns: Void

Registers JavaScript import-map entries for later rendering.

Parameters

imports System.Collections.Generic.IReadOnlyDictionary{System.String,System.String} requiredposition: 0
public Void AddJsInline(String js) #
Returns: Void

Adds inline JavaScript to the document head.

Parameters

js System.String requiredposition: 0
public Void AddJsModuleEntryImport(String specifier) #
Returns: Void

Registers a module entry import that will be rendered as a bootstrap module script.

Parameters

specifier System.String requiredposition: 0
public Void AddJsModuleInline(String js) #
Returns: Void

Adds inline JavaScript module content to the document head.

Parameters

js System.String requiredposition: 0
public Head AddMeta(String name, String content) #
Returns: Head

Adds a meta tag with automatic property mapping.

Parameters

name System.String requiredposition: 0
content System.String requiredposition: 1
public Head AddRevisedMeta(DateTime date) #
Returns: Head

Adds a revised date meta tag.

Parameters

date System.DateTime requiredposition: 0
AddStyle 2 overloads
public Head AddStyle(Style style) #
Returns: Head

Adds a strongly typed style element.

Parameters

style HtmlForgeX.Style requiredposition: 0
public Head AddStyle(String style) #
Returns: Head
EditorBrowsable(2)

Adds a raw CSS style string.

Parameters

style System.String requiredposition: 0
public Head AddTitle(String title) #
Returns: Head

Adds a title to the document.

Parameters

title System.String requiredposition: 0
public Head AddViewportMeta(String content) #
Returns: Head

Adds a viewport meta tag.

Parameters

content System.String requiredposition: 0
public Head Canonical(String href) #
Returns: Head

Adds or replaces the canonical link tag.

Parameters

href System.String requiredposition: 0
public Head CsrfMeta(String token) #
Returns: Head

Adds a CSRF token meta tag (name="csrf-token" content="…"). Useful for front-ends that read the token from meta for X-CSRF-Token headers.

Parameters

token System.String requiredposition: 0
public Head Favicon(String href, String type = "image/x-icon") #
Returns: Head

Adds or replaces the favicon link tag.

Parameters

href System.String requiredposition: 0
type System.String = "image/x-icon" optionalposition: 1
public Head FaviconSvg(String svgContent) #
Returns: Head

Adds or replaces the favicon using an inline SVG data URI.

Parameters

svgContent System.String requiredposition: 0
public String GenerateBodyScripts() #
Returns: String

Generates body scripts from library Body sections with optional deferred execution setup.

public String GenerateFooterScripts() #
Returns: String

Generates footer scripts from library Footer sections with optional deferred execution.

public Void SetBodyFontFamily(params String[] fonts) #
Returns: Void

Sets the font-family for the document body.

Parameters

fonts System.String[] requiredposition: 0
public Void SetFontFamily(String selector, params String[] fonts) #
Returns: Void

Sets the font-family for the specified selector.

Parameters

selector System.String requiredposition: 0
fonts System.String[] requiredposition: 1
public override String ToString() #
Returns: String

Properties

public String Title { get; set; } #

Gets or sets the title of the HTML document.

public String Charset { get; set; } #

Gets or sets the charset.

public String HttpEquiv { get; set; } #

Gets or sets the HTTP equiv.

public String Content { get; set; } #

Gets or sets the content.

public String Viewport { get; set; } #

Gets or sets the viewport.

public String Author { get; set; } #

Gets or sets the author.

public Nullable<DateTime> Revised { get; set; } #

Gets or sets the revised date.

public String Description { get; set; } #

Gets or sets the page description meta tag.

public String Keywords { get; set; } #

Gets or sets the keywords meta tag.

public List<HtmlTag> MetaTags { get; } #

Collection of additional meta tags.

public List<HtmlTag> LinkTags { get; } #

Collection of additional link tags (e.g., canonical).

public Nullable<Int32> AutoRefresh { get; set; } #

Represents the auto refresh time in seconds.

public List<Object> Styles { get; } #

Collection of inline <style> definitions or CSS strings.

public List<String> Scripts { get; } #

Collection of inline scripts.