482a46b568
Updated project files for `Beam.Dynamic`, `Beam.Exports`, `Beam.Temporary.Cli`, and `Beam` to include additional metadata and specific package versions. Refactored `DataBindings` and `ResolvedBindings` to records, added a new `Text` property in `Binding.cs`, and introduced `ParseNumbers` in `OnlineCleaner`. New classes `PuppetContext` and `PuppetUnitDownloader` added for Playwright integration. Introduced `ImmutableState` struct and `UnitDownloaderBinary` class for improved download management. Updated tests in `UnitTest1.cs` for number localization. Added `Beam.Puppeteer` project to the solution.
33 lines
1.2 KiB
C#
33 lines
1.2 KiB
C#
using HtmlAgilityPack;
|
|
|
|
namespace Beam.Dynamic {
|
|
public record class DataBindings {
|
|
public Binding? Title { get; set; }
|
|
public Binding? Authors { get; set; }
|
|
public Binding? Description { get; set; }
|
|
public Binding? Content { get; set; }
|
|
public Binding? Language { get; set; }
|
|
public Binding? Tags { get; set; }
|
|
|
|
public virtual ResolvedBindings Resolve(HtmlDocument doc) {
|
|
return new ResolvedBindings() {
|
|
Title = Title?.Resolve(doc),
|
|
Authors = Authors?.Resolve(doc) ?? Array.Empty<string>(),
|
|
Language = Language?.Resolve(doc) ?? Array.Empty<string>(),
|
|
Content = Content?.Resolve(doc),
|
|
Description = Description?.Resolve(doc),
|
|
Tags = Tags?.Resolve(doc) ?? Array.Empty<string>()
|
|
};
|
|
}
|
|
}
|
|
|
|
public record class ResolvedBindings {
|
|
public string? Title { get; set; }
|
|
public string[]? Authors { get; set; }
|
|
public string? Description { get; set; }
|
|
public string? Content { get; set; }
|
|
public string[]? Language { get; set; }
|
|
public string[]? Tags { get; set; }
|
|
}
|
|
}
|