Documentation
¶
Index ¶
- func Build(ctx context.Context, t itinerary.Trip, id, inputDir, outDir string, ...) error
- func DistanceInUnits(meters float64, units string) float64
- func StampIndexFromTripJSON(raw, tripJSON []byte) ([]byte, error)
- func StampIndexHTML(raw []byte, pageTitle, desc string) ([]byte, error)
- func ViewerShell(rel string) ([]byte, string, bool)
- type DayJSON
- type StopJSON
- type TripJSON
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Build ¶
func Build(ctx context.Context, t itinerary.Trip, id, inputDir, outDir string, opts routebuild.RouteOptions) error
Build writes a PWA bundle for trip id into outDir. inputDir is used to resolve relative photo paths (may be empty).
func DistanceInUnits ¶
DistanceInUnits converts meters to km or mi (one decimal).
func StampIndexFromTripJSON ¶
StampIndexFromTripJSON stamps index.html using trip.json title fields.
func StampIndexHTML ¶
StampIndexHTML injects per-trip <title> and Open Graph tags.
Types ¶
type DayJSON ¶
type DayJSON struct {
Day int `json:"day"`
Date string `json:"date,omitempty"`
Title string `json:"title"`
Notes string `json:"notes,omitempty"`
Hike bool `json:"hike,omitempty"`
Ferry bool `json:"ferry,omitempty"`
Photo string `json:"photo,omitempty"`
PhotoCaption string `json:"photo_caption,omitempty"`
Stops []StopJSON `json:"stops"`
Geo string `json:"geo"`
Kind string `json:"kind"`
DriveDist float64 `json:"drive_dist,omitempty"`
DriveMin int `json:"drive_min,omitempty"`
}
DayJSON is one day in trip.json.
type StopJSON ¶
type StopJSON struct {
Place string `json:"place,omitempty"`
Name string `json:"name"`
Type string `json:"type,omitempty"`
Lat float64 `json:"lat"`
Lon float64 `json:"lon"`
Notes string `json:"notes,omitempty"`
Photo string `json:"photo,omitempty"`
PhotoCaption string `json:"photo_caption,omitempty"`
MapsURL string `json:"maps_url,omitempty"`
Info *itinerary.PlaceInfo `json:"info,omitempty"`
}
StopJSON is a stop in trip.json.