Skip to content

Commit e96880f

Browse files
authored
README: make a definitive decision on v2 import path
This change makes it clear that the v2 import path is github.com/russross/blackfriday/v2, and updates various links accordingly. See #587 (comment) for details. This change also converges the README for v1 and v2 to be consistent, as they've started to drift apart. (See PR #675 for the equivalent change to the README on v2 branch.) For #587. GitHub-Pull-Request: #674
1 parent abb995c commit e96880f

File tree

1 file changed

+37
-46
lines changed

1 file changed

+37
-46
lines changed

README.md

+37-46
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Blackfriday
2-
[![Build Status][BuildSVG]][BuildURL]
3-
[![Godoc][GodocV2SVG]][GodocV2URL]
2+
[![Build Status][BuildV2SVG]][BuildV2URL]
3+
[![PkgGoDev][PkgGoDevV2SVG]][PkgGoDevV2URL]
44
===========
55

66
Blackfriday is a [Markdown][1] processor implemented in [Go][2]. It
@@ -18,12 +18,21 @@ It started as a translation from C of [Sundown][3].
1818
Installation
1919
------------
2020

21-
Blackfriday is compatible with any modern Go release. With Go and git installed:
21+
Blackfriday is compatible with modern Go releases in module mode.
22+
With Go installed:
2223

23-
go get -u gopkg.in/russross/blackfriday.v2
24+
go get github.com/russross/blackfriday
2425

25-
will download, compile, and install the package into your `$GOPATH` directory
26-
hierarchy.
26+
will resolve and add the package to the current development module,
27+
then build and install it. Alternatively, you can achieve the same
28+
if you import it in a package:
29+
30+
import "github.com/russross/blackfriday"
31+
32+
and `go get` without parameters.
33+
34+
Old versions of Go and legacy GOPATH mode might work,
35+
but no effort is made to keep them working.
2736

2837

2938
Versions
@@ -32,13 +41,9 @@ Versions
3241
Currently maintained and recommended version of Blackfriday is `v2`. It's being
3342
developed on its own branch: https://github.com/russross/blackfriday/tree/v2 and the
3443
documentation is available at
35-
https://godoc.org/gopkg.in/russross/blackfriday.v2.
44+
https://pkg.go.dev/github.com/russross/blackfriday/v2.
3645

37-
It is `go get`-able via [gopkg.in][6] at `gopkg.in/russross/blackfriday.v2`,
38-
but we highly recommend using package management tool like [dep][7] or
39-
[Glide][8] and make use of semantic versioning. With package management you
40-
should import `github.com/russross/blackfriday` and specify that you're using
41-
version 2.0.0.
46+
It is `go get`-able in module mode at `github.com/russross/blackfriday/v2`.
4247

4348
Version 2 offers a number of improvements over v1:
4449

@@ -60,22 +65,7 @@ Potential drawbacks:
6065

6166
If you are still interested in the legacy `v1`, you can import it from
6267
`github.com/russross/blackfriday`. Documentation for the legacy v1 can be found
63-
here: https://godoc.org/github.com/russross/blackfriday
64-
65-
### Known issue with `dep`
66-
67-
There is a known problem with using Blackfriday v1 _transitively_ and `dep`.
68-
Currently `dep` prioritizes semver versions over anything else, and picks the
69-
latest one, plus it does not apply a `[[constraint]]` specifier to transitively
70-
pulled in packages. So if you're using something that uses Blackfriday v1, but
71-
that something does not use `dep` yet, you will get Blackfriday v2 pulled in and
72-
your first dependency will fail to build.
73-
74-
There are couple of fixes for it, documented here:
75-
https://github.com/golang/dep/blob/master/docs/FAQ.md#how-do-i-constrain-a-transitive-dependencys-version
76-
77-
Meanwhile, `dep` team is working on a more general solution to the constraints
78-
on transitive dependencies problem: https://github.com/golang/dep/issues/1124.
68+
here: https://pkg.go.dev/github.com/russross/blackfriday.
7969

8070

8171
Usage
@@ -125,7 +115,7 @@ Here's an example of simple usage of Blackfriday together with Bluemonday:
125115
```go
126116
import (
127117
"github.com/microcosm-cc/bluemonday"
128-
"gopkg.in/russross/blackfriday.v2"
118+
"github.com/russross/blackfriday"
129119
)
130120

131121
// ...
@@ -175,12 +165,12 @@ anchors for headings when `EXTENSION_AUTO_HEADER_IDS` is enabled. The
175165
algorithm has a specification, so that other packages can create
176166
compatible anchor names and links to those anchors.
177167

178-
The specification is located at https://godoc.org/github.com/russross/blackfriday#hdr-Sanitized_Anchor_Names.
168+
The specification is located at https://pkg.go.dev/github.com/russross/blackfriday#hdr-Sanitized_Anchor_Names.
179169

180-
[`SanitizedAnchorName`](https://godoc.org/github.com/russross/blackfriday#SanitizedAnchorName) exposes this functionality, and can be used to
170+
[`SanitizedAnchorName`](https://pkg.go.dev/github.com/russross/blackfriday#SanitizedAnchorName) exposes this functionality, and can be used to
181171
create compatible links to the anchor names generated by blackfriday.
182172
This algorithm is also implemented in a small standalone package at
183-
[`github.com/shurcooL/sanitized_anchor_name`](https://godoc.org/github.com/shurcooL/sanitized_anchor_name). It can be useful for clients
173+
[`github.com/shurcooL/sanitized_anchor_name`](https://pkg.go.dev/github.com/shurcooL/sanitized_anchor_name). It can be useful for clients
184174
that want a small package and don't need full functionality of blackfriday.
185175

186176

@@ -250,7 +240,7 @@ implements the following extensions:
250240
and supply a language (to make syntax highlighting simple). Just
251241
mark it like this:
252242
253-
``` go
243+
```go
254244
func getTrue() bool {
255245
return true
256246
}
@@ -262,7 +252,7 @@ implements the following extensions:
262252
To preserve classes of fenced code blocks while using the bluemonday
263253
HTML sanitizer, use the following policy:
264254
265-
``` go
255+
```go
266256
p := bluemonday.UGCPolicy()
267257
p.AllowAttrs("class").Matching(regexp.MustCompile("^language-[a-zA-Z0-9]+$")).OnElements("code")
268258
html := p.SanitizeBytes(unsafe)
@@ -273,7 +263,7 @@ implements the following extensions:
273263
274264
Cat
275265
: Fluffy animal everyone likes
276-
266+
277267
Internet
278268
: Vector of transmission for pictures of cats
279269
@@ -284,7 +274,7 @@ implements the following extensions:
284274
end of the document. A footnote looks like this:
285275
286276
This is a footnote.[^1]
287-
277+
288278
[^1]: the footnote text.
289279
290280
* **Autolinking**. Blackfriday can find URLs that have not been
@@ -321,7 +311,7 @@ Other renderers
321311
Blackfriday is structured to allow alternative rendering engines. Here
322312
are a few of note:
323313
324-
* [github_flavored_markdown](https://godoc.org/github.com/shurcooL/github_flavored_markdown):
314+
* [github_flavored_markdown](https://pkg.go.dev/github.com/shurcooL/github_flavored_markdown):
325315
provides a GitHub Flavored Markdown renderer with fenced code block
326316
highlighting, clickable heading anchor links.
327317
@@ -341,6 +331,10 @@ are a few of note:
341331
provides a drop-in renderer ready to use with Blackfriday, as well as
342332
options and means for further customization.
343333
334+
* [Blackfriday-Confluence](https://github.com/kentaro-m/blackfriday-confluence): provides a [Confluence Wiki Markup](https://confluence.atlassian.com/doc/confluence-wiki-markup-251003035.html) renderer.
335+
336+
* [Blackfriday-Slack](https://github.com/karriereat/blackfriday-slack): converts markdown to slack message style
337+
344338
345339
TODO
346340
----
@@ -361,13 +355,10 @@ License
361355
[1]: https://daringfireball.net/projects/markdown/ "Markdown"
362356
[2]: https://golang.org/ "Go Language"
363357
[3]: https://github.com/vmg/sundown "Sundown"
364-
[4]: https://godoc.org/gopkg.in/russross/blackfriday.v2#Parse "Parse func"
358+
[4]: https://pkg.go.dev/github.com/russross/blackfriday/v2#Parse "Parse func"
365359
[5]: https://github.com/microcosm-cc/bluemonday "Bluemonday"
366-
[6]: https://labix.org/gopkg.in "gopkg.in"
367-
[7]: https://github.com/golang/dep/ "dep"
368-
[8]: https://github.com/Masterminds/glide "Glide"
369-
370-
[BuildSVG]: https://travis-ci.org/russross/blackfriday.svg?branch=master
371-
[BuildURL]: https://travis-ci.org/russross/blackfriday
372-
[GodocV2SVG]: https://godoc.org/gopkg.in/russross/blackfriday.v2?status.svg
373-
[GodocV2URL]: https://godoc.org/gopkg.in/russross/blackfriday.v2
360+
361+
[BuildV2SVG]: https://travis-ci.org/russross/blackfriday.svg?branch=v2
362+
[BuildV2URL]: https://travis-ci.org/russross/blackfriday
363+
[PkgGoDevV2SVG]: https://pkg.go.dev/badge/github.com/russross/blackfriday/v2
364+
[PkgGoDevV2URL]: https://pkg.go.dev/github.com/russross/blackfriday/v2

0 commit comments

Comments
 (0)