add rich output support for slide notes
Docker server image / build-and-push (push) Successful in 3m2s
Docker server image / build-and-push (push) Successful in 3m2s
This commit is contained in:
@@ -21,10 +21,28 @@ type RasterTierOptions struct {
|
||||
JPEGQuality int32
|
||||
}
|
||||
|
||||
// HtmlFormattingPolicy configures which formatting features are ignored in HTML notes mode.
|
||||
type HtmlFormattingPolicy struct {
|
||||
IgnoreBold bool
|
||||
IgnoreItalic bool
|
||||
IgnoreUnderline bool
|
||||
IgnoreStrikethrough bool
|
||||
IgnoreFontSize bool
|
||||
IgnoreColor bool
|
||||
}
|
||||
|
||||
// NotesOptions controls speaker-notes extraction/output.
|
||||
type NotesOptions struct {
|
||||
Format officeconvertapiv1.NotesFormat
|
||||
HTMLUseParagraphTags *bool
|
||||
HTMLPolicy *HtmlFormattingPolicy
|
||||
}
|
||||
|
||||
// CreateConversionOptions configures optional full and thumbnail raster tiers.
|
||||
type CreateConversionOptions struct {
|
||||
Full *RasterTierOptions
|
||||
Thumbnail *RasterTierOptions
|
||||
Notes *NotesOptions
|
||||
}
|
||||
|
||||
// Client wraps the generated Connect client with orchestration-focused helpers.
|
||||
@@ -67,6 +85,7 @@ func (c *Client) CreateConversion(
|
||||
if options != nil {
|
||||
message.Full = toProtoSlideRasterOptions(options.Full)
|
||||
message.Thumbnail = toProtoSlideRasterOptions(options.Thumbnail)
|
||||
message.Notes = toProtoNotesOptions(options.Notes)
|
||||
}
|
||||
req := connect.NewRequest(message)
|
||||
res, err := c.rpc.CreateConversion(ctx, req)
|
||||
@@ -95,6 +114,29 @@ func toProtoSlideRasterOptions(
|
||||
return proto
|
||||
}
|
||||
|
||||
func toProtoNotesOptions(options *NotesOptions) *officeconvertapiv1.NotesOptions {
|
||||
if options == nil {
|
||||
return nil
|
||||
}
|
||||
proto := &officeconvertapiv1.NotesOptions{
|
||||
Format: options.Format,
|
||||
}
|
||||
if options.HTMLUseParagraphTags != nil {
|
||||
proto.HtmlUseParagraphTags = options.HTMLUseParagraphTags
|
||||
}
|
||||
if options.HTMLPolicy != nil {
|
||||
proto.HtmlPolicy = &officeconvertapiv1.HtmlFormattingPolicy{
|
||||
IgnoreBold: options.HTMLPolicy.IgnoreBold,
|
||||
IgnoreItalic: options.HTMLPolicy.IgnoreItalic,
|
||||
IgnoreUnderline: options.HTMLPolicy.IgnoreUnderline,
|
||||
IgnoreStrikethrough: options.HTMLPolicy.IgnoreStrikethrough,
|
||||
IgnoreFontSize: options.HTMLPolicy.IgnoreFontSize,
|
||||
IgnoreColor: options.HTMLPolicy.IgnoreColor,
|
||||
}
|
||||
}
|
||||
return proto
|
||||
}
|
||||
|
||||
// StartConversion signals that upload is complete and conversion can begin.
|
||||
func (c *Client) StartConversion(
|
||||
ctx context.Context,
|
||||
|
||||
Reference in New Issue
Block a user