Documentation ¶
Overview ¶
Package page contains code to render pages that can be used from backend and frontend.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ImportPathElementsHTML ¶
ImportPathElementsHTML renders the HTML of the import path with linkified elements.
Example ¶
package main import ( "fmt" "github.com/shurcooL/gtdo/page" ) func main() { inputs := []struct { repoImportPath string importPath string }{ {"github.com/shurcooL/go", "github.com/shurcooL/go/u/u10"}, {"rsc.io/pd&f", "rsc.io/pd&f"}, {"rsc.io/pdf", "rsc.io/pdf"}, {"rsc.io/pdf", "rsc.io/pdf/pdfpasswd"}, {"io", "io"}, {"io", "io/ioutil"}, } for _, i := range inputs { html := page.ImportPathElementsHTML(i.repoImportPath, i.importPath, "") fmt.Println(html) } }
Output: <a href="/github.com/shurcooL/go">github.com/shurcooL/go</a>/<a href="/github.com/shurcooL/go/u">u</a>/u10 rsc.io/pd&f rsc.io/pdf <a href="/rsc.io/pdf">rsc.io/pdf</a>/pdfpasswd io <a href="/io">io</a>/ioutil
Types ¶
Click to show internal directories.
Click to hide internal directories.