Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Links in comments aren't generated correctly #83

Closed
kaiiorg opened this issue Dec 30, 2022 · 1 comment
Closed

Links in comments aren't generated correctly #83

kaiiorg opened this issue Dec 30, 2022 · 1 comment

Comments

@kaiiorg
Copy link

kaiiorg commented Dec 30, 2022

Following the formatting guide for go doc links results in the angle brackets being escaped and thus links not being rendered correctly. Is there a way to format links to external resources without just pasting the link? I.E., like this, not like this: https://github.com/rs/zerolog

Example

// GetComponentLogger builds a [ZeroLog] Logger based on provided 'rootLogger' ZeroLog Logger,
// adding 'componentName' and 'levelStr' to log messages.
// Will default to 'Info' Log Level if invalid or no 'levelStr' is provided
//
// [ZeroLog]: https://github.com/rs/zerolog "ZeroLog"
func GetComponentLogger(rootLogger zerolog.Logger, componentName string, levelStr string) zerolog.Logger {
	level, err := zerolog.ParseLevel(levelStr)
	if err != nil {
		level = zerolog.InfoLevel
	}
	return rootLogger.With().Str("component", componentName).Logger().Level(level)
}

Result (raw markdown)

GetComponentLogger builds a \[ZeroLog\] Logger based on provided 'rootLogger' ZeroLog Logger, adding 'componentName' and 'levelStr' to log messages. Will default to 'Info' Log Level if invalid or no 'levelStr' is provided

\[ZeroLog\]: https://github.com/rs/zerolog "ZeroLog"

## func [GetHashicorpComponentLogger](<https://github.com/redacted>)

```go
func GetHashicorpComponentLogger(rootLogger zerolog.Logger, componentName string, levelStr string) *logutils.LevelFilter
\```

Result (as rendered by github)

GetComponentLogger builds a [ZeroLog] Logger based on provided 'rootLogger' ZeroLog Logger, adding 'componentName' and 'levelStr' to log messages. Will default to 'Info' Log Level if invalid or no 'levelStr' is provided

[ZeroLog]: https://github.com/rs/zerolog "ZeroLog"

func GetHashicorpComponentLogger

func GetHashicorpComponentLogger(rootLogger zerolog.Logger, componentName string, levelStr string) *logutils.LevelFilter
@princjef
Copy link
Owner

The library did not support go 1.19 features at the time. This is now fixed in the main branch (see this test case example: https://github.com/princjef/gomarkdoc/blob/master/testData/docs/README.md) and will be available in the next release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants