References

Additional reference documentation when working on the Jenkins X site

The following sections contains other information that’s helpful when working with Hugo and the Jenkins X site; you don’t necessary need to go through this if this is your first time.

Search by Algolia/DocSearch

We’re using DocSearch by Algolia to power the internal search.

  • The script and local config are declared in /layouts/partials/scripts.html
  • Styling is included via /layouts/partials/head-css.html
  • The configuration is managed in the Algolia console.

Markdown Syntax Reference

Code examples

Hugo uses goldmark parser to handle markdown and markdown related configuration and chroma to handle syntax highlighting. Chroma supports the following languages. All pages on the Jenkins X docs use the typical triple-back-tick markdown syntax.

```go
// CommandInterface defines the interface for a Command
//go:generate pegomock generate github.com/jenkins-x/jx/pkg/util CommandInterface -o mocks/command_interface.go
type CommandInterface interface {
    DidError() bool
    DidFail() bool
    Error() error
    Run() (string, error)
    RunWithoutRetry() (string, error)
    SetName(string)
    SetDir(string)
    SetArgs(\[]string)
    SetTimeout(time.Duration)
    SetExponentialBackOff(\*backoff.ExponentialBackOff)
}
```

becomes

// CommandInterface defines the interface for a Command
//go:generate pegomock generate github.com/jenkins-x/jx/pkg/util CommandInterface -o mocks/command_interface.go
type CommandInterface interface {
    DidError() bool
    DidFail() bool
    Error() error
    Run() (string, error)
    RunWithoutRetry() (string, error)
    SetName(string)
    SetDir(string)
    SetArgs(\[]string)
    SetTimeout(time.Duration)
    SetExponentialBackOff(\*backoff.ExponentialBackOff)
}

Blockquotes

Blockquotes can be added to the Jenkins X documentation using typical Markdown blockquote syntax:

> Without the threat of punishment, there is no joy in flight.

The preceding blockquote will render as follows in the Jenkins X docs:

Without the threat of punishment, there is no joy in flight.

However, you can add a quick and easy <cite> element (added on the client via JavaScript) by separating your main blockquote and the citation with a hyphen with a single space on each side:

> Without the threat of punishment, there is no joy in flight. - [Kobo Abe](https://en.wikipedia.org/wiki/Kobo_Abe)

Which will render as follows in the Jenkins X docs:

Without the threat of punishment, there is no joy in flight. - Kobo Abe


Last modified February 19, 2022: fix: upgrade algolia docsearch to v3 (4fe78cee93)