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 of the search index is managed via docsearch-configs which can be updated via a PR

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 October 20, 2020: release 0.0.1921 (5342801)