bundle

package
v0.0.0-...-2adc0db Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2026 License: MIT Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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

func DistanceInUnits(meters float64, units string) float64

DistanceInUnits converts meters to km or mi (one decimal).

func StampIndexFromTripJSON

func StampIndexFromTripJSON(raw, tripJSON []byte) ([]byte, error)

StampIndexFromTripJSON stamps index.html using trip.json title fields.

func StampIndexHTML

func StampIndexHTML(raw []byte, pageTitle, desc string) ([]byte, error)

StampIndexHTML injects per-trip <title> and Open Graph tags.

func ViewerShell

func ViewerShell(rel string) ([]byte, string, bool)

ViewerShell returns an embedded viewer file (app.js, CSS, icons, …). Trip data (trip.json, geo/, images/, sw.js) is not served from embed.

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.

type TripJSON

type TripJSON struct {
	ID          string    `json:"id"`
	Title       string    `json:"title"`
	Description string    `json:"description,omitempty"`
	Units       string    `json:"units"` // km | mi
	Days        []DayJSON `json:"days"`
}

TripJSON is the viewer-facing trip metadata (no heavy geometry).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL