github.com/cockroachdb/cockroachdb-parser@v0.23.3-0.20240213214944-911057d40c9a/pkg/docs/docs.go (about)

     1  // Copyright 2020 The Cockroach Authors.
     2  //
     3  // Use of this software is governed by the Business Source License
     4  // included in the file licenses/BSL.txt.
     5  //
     6  // As of the Change Date specified in that file, in accordance with
     7  // the Business Source License, use of this software will be governed
     8  // by the Apache License, Version 2.0, included in the file
     9  // licenses/APL.txt.
    10  
    11  package docs
    12  
    13  import (
    14  	"fmt"
    15  
    16  	"github.com/cockroachdb/cockroachdb-parser/pkg/build"
    17  )
    18  
    19  // URLBase is the root URL for the version of the docs associated with this
    20  // binary.
    21  var URLBase = "https://www.cockroachlabs.com/docs/" + build.BinaryVersionPrefix()
    22  
    23  // URLReleaseNotesBase is the root URL for the release notes for the .0 patch
    24  // release associated with this binary.
    25  var URLReleaseNotesBase = fmt.Sprintf("https://www.cockroachlabs.com/docs/releases/%s.0.html",
    26  	build.BinaryVersionPrefix())
    27  
    28  // URL generates the URL to pageName in the version of the docs associated
    29  // with this binary.
    30  func URL(pageName string) string { return URLBase + "/" + pageName }
    31  
    32  // ReleaseNotesURL generates the URL to pageName in the .0 patch release notes
    33  // docs associated with this binary.
    34  func ReleaseNotesURL(pageName string) string { return URLReleaseNotesBase + pageName }