Skip to content

Commit

Permalink
SeeCompatTable
Browse files Browse the repository at this point in the history
  • Loading branch information
viperehonchuk committed Jan 10, 2024
1 parent 4778ce9 commit dca6eab
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ endif
.PHONY: build clean deploy install rebuild serve
.SHELLFLAGS += -e

book: book/uk interactive-examples/docs
book: book/live-samples book/uk interactive-examples/docs

book/uk: book.toml content content/files/uk/index.md content/files/uk/SUMMARY.md original-content revamp/exe/move-media revamp/exe/format-links revamp/exe/inject-authors revamp/exe/revamp-html revamp/exe/rewire-paths revamp/exe/run-macros revamp/exe/strip-frontmatter revamp/exe/writer src
mdbook build
Expand Down
10 changes: 6 additions & 4 deletions revamp/preprocessors/src/format-links/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
var UKRAINIAN_MARKERS = []string{"//uk.", ".ua", "hl=uk"}

var MARKDOWN_LINK_REGEX = regexp.MustCompile(`([^!])\[([^\[\]]+)]\(([^\s\(\)\[\]]+)\)`)
var HTML_LINK_REGEX = regexp.MustCompile(`<a[^>]*\shref="([^>"]+)"[^>]*>`)
var HTML_LINK_REGEX = regexp.MustCompile(`<a[^>]*\shref="([^>"\s]+)"[^>]*>`)

func checkLinkForMissing(href string) {
if strings.HasPrefix(href, "http") {
Expand Down Expand Up @@ -62,9 +62,11 @@ func getClassForLink(href string) string {
}
} else {
classes = append(classes, "internal-link")
if !strings.HasPrefix(href, "#") && !bookHasPath(href+"/index.md") {
log.Println("Missing link: " + href)
classes = append(classes, "missing-link")
if href != "" {
if !bookHasPath(href + "/index.md") {
log.Println("Missing link: " + href)
classes = append(classes, "missing-link")
}
}
}
return strings.Join(classes, " ")
Expand Down
1 change: 1 addition & 0 deletions revamp/preprocessors/src/run-macros/macros/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@ var MacrosIndex = map[string]func(*environment.Environment, *registry.Registry,
"listsubpages": listsubpages,
"non-standard_header": non_standard_header,
"rfc": rfc,
"seecompattable": seecompattable,
"svgelement": svgelement.Svgelement,
}
10 changes: 10 additions & 0 deletions revamp/preprocessors/src/run-macros/macros/seecompattable.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package macros

import (
"webdoky3/revamp/preprocessors/src/run-macros/environment"
"webdoky3/revamp/preprocessors/src/run-macros/registry"
)

func seecompattable(env *environment.Environment, reg *registry.Registry, _ string) (string, error) {
return "<div class=\"notecard experimental\" id=\"sect1\"><p><strong>Експериментальне:</strong> <strong>Це <a href=\"/uk/docs/MDN/Writing_guidelines/Experimental_deprecated_obsolete#eksperymentalne\">експериментальна технологія</a></strong><br>Уважно звіртеся з <a href=\"#sumisnist-iz-brauzeramy\">таблицею Сумісності з браузерами</a>, перш ніж використовувати це в роботі.</p></div>", nil
}

0 comments on commit dca6eab

Please sign in to comment.