package gallery import ( "errors" "fmt" "regexp" "strings" "amadan.net/rastrillo/fiesta/example" ) // The frame document: one example document made a page the gallery // can frame, with the gallery's own assets, the page's theme and // locale, kept out of search, padded unless it is a whole page, the // sign-in card on its stage, a layout's links live where the interface // says and dead everywhere else, and the scheme store on so a // document opened in a tab of its own remembers the reader's choice. var ( headTag = regexp.MustCompile(`]*>`) firstLink = regexp.MustCompile(`<(link|script)\b`) bodyTag = regexp.MustCompile(`]*>`) viewportMeta = regexp.MustCompile(`]*>`) assetLink = regexp.MustCompile(`(href|src)="\.\./\.\./(css|js)/([^"]+)"`) picture = regexp.MustCompile(`src="\.\./assets/([^"]+)"`) sampleRef = regexp.MustCompile(`\b(href|action)="([^"]*)"`) anyTag = regexp.MustCompile(`<[a-zA-Z][^>]*>`) anchorTag = regexp.MustCompile(`]*>`) tagEnd = regexp.MustCompile(`\s*/?>$`) ltrHTML = `.*?`) // A body whose first element is the sign-in card. signinFirst = regexp.MustCompile(`^\s*<[a-zA-Z][^>]*\srst-signin[\s>=]`) // A layout's own regions, matched on the shipped shells' markup. shellBack = regexp.MustCompile(`(?s)
\s*]*>`) shellNav = regexp.MustCompile(`(?s)`) shellBrand = regexp.MustCompile(`]*>`) localeMenu = regexp.MustCompile(`(?s)
`) firstNavID = regexp.MustCompile(`