Skip to content

Commit

Permalink
Try include symbols, add new custom operations for Calendar and Panel
Browse files Browse the repository at this point in the history
  • Loading branch information
galassie committed Feb 3, 2023
1 parent 3f5a461 commit f73036d
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ nuget:
build_script:
- dotnet build -c Release
- dotnet test -c Release --no-build
- dotnet pack -c Release --no-build -o ./deploy ./src/FsSpectre/FsSpectre.fsproj
- dotnet pack -c Release --no-build --include-symbols -o ./deploy ./src/FsSpectre/FsSpectre.fsproj

artifacts:
- path: 'deploy/*.nupkg'
Expand Down
2 changes: 1 addition & 1 deletion src/FsSpectre/FsSpectre.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<!-- NuGet config -->
<PackageId>FsSpectre</PackageId>
<Version>0.3.4</Version>
<Version>0.3.5</Version>
<Authors>Enrico Galassi</Authors>
<PackageTags>fsharp;cli;dotnet;console-application;fsharp-console;</PackageTags>
<PackageProjectUrl>https://github.com/galassie/fs-spectre</PackageProjectUrl>
Expand Down
6 changes: 6 additions & 0 deletions src/FsSpectre/Widgets/CalendarBuilder.fs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ module CalendarBuilder =
type CalendarBuilder() =
member __.Yield _ = Calendar(DateTime.Now)

[<CustomOperation "default">]
member __.Default(calendar: Calendar) = calendar

[<CustomOperation "year">]
member __.Year(calendar: Calendar, year: int) =
calendar.Year <- year
Expand All @@ -25,6 +28,9 @@ module CalendarBuilder =
calendar.Day <- day
calendar

[<CustomOperation "date_time">]
member __.DateTime(_, dateTime: DateTime) = Calendar(dateTime)

[<CustomOperation "culture">]
member __.Culture(calendar: Calendar, cultureInfo: CultureInfo) =
calendar.Culture <- cultureInfo
Expand Down
15 changes: 15 additions & 0 deletions src/FsSpectre/Widgets/PanelBuilder.fs
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,19 @@ module PanelBuilder =
panel.Header <- header
panel

[<CustomOperation "header_text">]
member __.HeaderText(panel: Panel, text: string) =
panel.Header <- PanelHeader(text)
panel

[<CustomOperation "width">]
member __.Width(panel: Panel, width: int) =
panel.Width <- width
panel

[<CustomOperation "height">]
member __.Height(panel: Panel, height: int) =
panel.Height <- height
panel

let panel = PanelBuilder()

0 comments on commit f73036d

Please sign in to comment.