mirror of
https://github.com/danielmiessler/Fabric.git
synced 2026-04-24 03:00:15 -04:00
Merge pull request #1007 from hallelujah-shih/feature/html-readability
support turn any web page into clean view content
This commit is contained in:
@@ -193,6 +193,14 @@ func Cli(version string) (message string, err error) {
|
||||
}
|
||||
}
|
||||
|
||||
if currentFlags.HtmlReadability {
|
||||
if msg, err := core.HtmlReadability(currentFlags.Message); err != nil {
|
||||
fmt.Println("use readability parser msg err:", err)
|
||||
} else {
|
||||
currentFlags.Message = msg
|
||||
}
|
||||
}
|
||||
|
||||
var chatter *core.Chatter
|
||||
if chatter, err = fabric.GetChatter(currentFlags.Model, currentFlags.Stream, currentFlags.DryRun); err != nil {
|
||||
return
|
||||
|
||||
@@ -47,6 +47,7 @@ type Flags struct {
|
||||
WipeContext string `short:"w" long:"wipecontext" description:"Wipe context"`
|
||||
WipeSession string `short:"W" long:"wipesession" description:"Wipe session"`
|
||||
DryRun bool `long:"dry-run" description:"Show what would be sent to the model without actually sending it"`
|
||||
HtmlReadability bool `long:"readability" description:"Turn web page into a clean view"`
|
||||
Version bool `long:"version" description:"Print current version"`
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user