mirror of
https://github.com/freeCodeCamp/devdocs
synced 2024-11-16 19:48:10 +01:00
Merge pull request #2096 from sharpevo/develop
Fix the regexp for Golang generic functions
This commit is contained in:
commit
0074c411b6
2 changed files with 6 additions and 6 deletions
|
@ -28,7 +28,7 @@ module Docs
|
||||||
case node.content
|
case node.content
|
||||||
when /type\ (\w+)/
|
when /type\ (\w+)/
|
||||||
name = "#{package}.#{$1}"
|
name = "#{package}.#{$1}"
|
||||||
when /func\ (?:\(.+\)\ )?(\w+)\(/
|
when /func\ (?:\(.+\)\ )?(\w+)[\(\[]/
|
||||||
name = "#{$1}()"
|
name = "#{$1}()"
|
||||||
name.prepend "#{$1}." if node['href'] =~ /#(\w+)\.#{$1}/
|
name.prepend "#{$1}." if node['href'] =~ /#(\w+)\.#{$1}/
|
||||||
name.prepend "#{package}."
|
name.prepend "#{package}."
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
module Docs
|
module Docs
|
||||||
class Go < UrlScraper
|
class Go < UrlScraper
|
||||||
self.type = 'go'
|
self.type = 'go'
|
||||||
self.release = '1.21.0'
|
self.release = '1.21.5'
|
||||||
self.base_url = 'https://golang.org/pkg/'
|
self.base_url = 'https://golang.org/pkg/'
|
||||||
self.links = {
|
self.links = {
|
||||||
home: 'https://golang.org/',
|
home: 'https://golang.org/',
|
||||||
|
@ -10,10 +10,10 @@ module Docs
|
||||||
|
|
||||||
# Run godoc locally, since https://golang.org/pkg/ redirects to https://pkg.go.dev/std with rate limiting / scraping protection.
|
# Run godoc locally, since https://golang.org/pkg/ redirects to https://pkg.go.dev/std with rate limiting / scraping protection.
|
||||||
|
|
||||||
# docker run --expose=6060 --rm -it docker.io/golang:1.18.0
|
# podman run --net host --rm -it docker.io/golang:1.21.5
|
||||||
#docker# go install golang.org/x/tools/cmd/godoc@latest
|
#podman# go install golang.org/x/tools/cmd/godoc@latest
|
||||||
#docker# rm -r /usr/local/go/test/
|
#podman# rm -r /usr/local/go/test/
|
||||||
#docker# godoc -http 0.0.0.0:6060 -v
|
#podman# godoc -http 0.0.0.0:6060 -v
|
||||||
self.base_url = 'http://localhost:6060/pkg/'
|
self.base_url = 'http://localhost:6060/pkg/'
|
||||||
|
|
||||||
html_filters.push 'clean_local_urls'
|
html_filters.push 'clean_local_urls'
|
||||||
|
|
Loading…
Reference in a new issue