Skip to content

Commit

Permalink
fix(lang): only print url for auto links (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
princjef authored Jun 16, 2023
1 parent 0124a63 commit f8aab49
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import "github.com/princjef/gomarkdoc"
```

Package gomarkdoc formats documentation for one or more packages as markdown for usage outside of the main https://pkg.go.dev[https://pkg.go.dev](<https://pkg.go.dev>) site. It supports custom templates for tweaking representation of documentation at fine\-grained levels, exporting both exported and unexported symbols, and custom formatters for different backends.
Package gomarkdoc formats documentation for one or more packages as markdown for usage outside of the main https://pkg.go.dev site. It supports custom templates for tweaking representation of documentation at fine\-grained levels, exporting both exported and unexported symbols, and custom formatters for different backends.

### Command Line Usage

Expand Down Expand Up @@ -100,7 +100,7 @@ The documentation information that is output is formatted using a series of text

- index: generates an index of symbols within a package, similar to what is seen for godoc.org. The index links to types, funcs, variables, and constants generated by other templates, so it may need to be overridden as well if any of those templates are changed in a material way.

- example: generates documentation for a single example for a package or one of its symbols. The example is generated alongside whichever symbol it represents, based on the standard naming conventions outlined in https://blog.golang.org/examples#TOC_4[https://blog.golang.org/examples#TOC_4](<https://blog.golang.org/examples#TOC_4>).
- example: generates documentation for a single example for a package or one of its symbols. The example is generated alongside whichever symbol it represents, based on the standard naming conventions outlined in https://blog.golang.org/examples#TOC_4.

- doc: generates the freeform documentation block for any of the above structures that can contain a documentation section.

Expand Down
2 changes: 1 addition & 1 deletion cmd/gomarkdoc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import "github.com/princjef/gomarkdoc/cmd/gomarkdoc"

Package gomarkdoc provides a command line interface for writing golang documentation in markdown format.

See https://github.com/princjef/gomarkdoc[https://github.com/princjef/gomarkdoc](<https://github.com/princjef/gomarkdoc>) for full documentation of this tool.
See https://github.com/princjef/gomarkdoc for full documentation of this tool.

## Index

Expand Down
6 changes: 3 additions & 3 deletions format/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Each of the formats in this package contains the same set of formatting function
<a name="AzureDevOpsMarkdown"></a>
## type [AzureDevOpsMarkdown](<https://github.com/princjef/gomarkdoc/blob/master/format/devops.go#L18>)

AzureDevOpsMarkdown provides a Format which is compatible with Azure DevOps's syntax and semantics. See the Azure DevOps documentation for more details about their markdown format: https://docs.microsoft.com/en-us/azure/devops/project/wiki/markdown-guidance?view=azure-devops[https://docs.microsoft.com/en-us/azure/devops/project/wiki/markdown-guidance?view=azure-devops](<https://docs.microsoft.com/en-us/azure/devops/project/wiki/markdown-guidance?view=azure-devops>)
AzureDevOpsMarkdown provides a Format which is compatible with Azure DevOps's syntax and semantics. See the Azure DevOps documentation for more details about their markdown format: https://docs.microsoft.com/en-us/azure/devops/project/wiki/markdown-guidance?view=azure-devops

```go
type AzureDevOpsMarkdown struct{}
Expand Down Expand Up @@ -196,7 +196,7 @@ ListEntry generates an unordered list entry with the provided text at the provid
func (f *AzureDevOpsMarkdown) LocalHref(headerText string) (string, error)
```

LocalHref generates an href for navigating to a header with the given headerText located within the same document as the href itself. Link generation follows the guidelines here: https://docs.microsoft.com/en-us/azure/devops/project/wiki/markdown-guidance?view=azure-devops#anchor-links[https://docs.microsoft.com/en-us/azure/devops/project/wiki/markdown-guidance?view=azure-devops#anchor-links](<https://docs.microsoft.com/en-us/azure/devops/project/wiki/markdown-guidance?view=azure-devops#anchor-links>)
LocalHref generates an href for navigating to a header with the given headerText located within the same document as the href itself. Link generation follows the guidelines here: https://docs.microsoft.com/en-us/azure/devops/project/wiki/markdown-guidance?view=azure-devops#anchor-links

<a name="AzureDevOpsMarkdown.RawAnchorHeader"></a>
### func \(\*AzureDevOpsMarkdown\) [RawAnchorHeader](<https://github.com/princjef/gomarkdoc/blob/master/format/devops.go#L51>)
Expand Down Expand Up @@ -307,7 +307,7 @@ type Format interface {
<a name="GitHubFlavoredMarkdown"></a>
## type [GitHubFlavoredMarkdown](<https://github.com/princjef/gomarkdoc/blob/master/format/github.go#L17>)

GitHubFlavoredMarkdown provides a Format which is compatible with GitHub Flavored Markdown's syntax and semantics. See GitHub's documentation for more details about their markdown format: https://guides.github.com/features/mastering-markdown/[https://guides.github.com/features/mastering-markdown/](<https://guides.github.com/features/mastering-markdown/>)
GitHubFlavoredMarkdown provides a Format which is compatible with GitHub Flavored Markdown's syntax and semantics. See GitHub's documentation for more details about their markdown format: https://guides.github.com/features/mastering-markdown/

```go
type GitHubFlavoredMarkdown struct{}
Expand Down
1 change: 1 addition & 0 deletions lang/span.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ func ParseSpans(cfg *Config, texts []comment.Text) []*Span {

if v.Auto {
s = append(s, NewSpan(cfg.Inc(0), AutolinkSpan, str, str))
break
}

s = append(s, NewSpan(cfg.Inc(0), LinkSpan, str, v.URL))
Expand Down

0 comments on commit f8aab49

Please sign in to comment.