diff --git a/Makefile b/Makefile index ebdad632..57dc20bb 100644 --- a/Makefile +++ b/Makefile @@ -12,5 +12,13 @@ crosscompile: GOOS=linux GOARCH=arm GOARM=5 go build -o bin/files/allmark_linux_arm_5 ./cli GOOS=linux GOARCH=arm GOARM=6 go build -o bin/files/allmark_linux_arm_6 ./cli GOOS=linux GOARCH=arm GOARM=7 go build -o bin/files/allmark_linux_arm_7 ./cli + GOOS=aix GOARCH=ppc64 GOARM=7 go build -o bin/files/allmark_aix_ppc64 ./cli GOOS=darwin GOARCH=amd64 go build -o bin/files/allmark_darwin_amd64 ./cli GOOS=windows GOARCH=amd64 go build -o bin/files/allmark_windows_amd64 ./cli + GOOS=windows GOARCH=386 go build -o bin/files/allmark_windows_386 ./cli + +arm7: + GOOS=linux GOARCH=arm GOARM=7 go build -o bin/files/allmark_linux_arm_7 ./cli + +linux: + GOOS=linux GOARCH=amd64 go build -o bin/files/allmark_linux_amd64 ./cli diff --git a/cli/allmark.go b/cli/allmark.go index 1da3167a..7fbce435 100644 --- a/cli/allmark.go +++ b/cli/allmark.go @@ -7,16 +7,16 @@ package main import ( "fmt" - "github.com/andreaskoch/allmark/common/config" - "github.com/andreaskoch/allmark/common/logger/console" - "github.com/andreaskoch/allmark/common/logger/loglevel" - "github.com/andreaskoch/allmark/common/shutdown" - "github.com/andreaskoch/allmark/common/util/fsutil" - "github.com/andreaskoch/allmark/dataaccess/filesystem" - "github.com/andreaskoch/allmark/services/initialization" - "github.com/andreaskoch/allmark/services/parser" - "github.com/andreaskoch/allmark/services/thumbnail" - "github.com/andreaskoch/allmark/web/server" + "github.com/elWyatt/allmark/common/config" + "github.com/elWyatt/allmark/common/logger/console" + "github.com/elWyatt/allmark/common/logger/loglevel" + "github.com/elWyatt/allmark/common/shutdown" + "github.com/elWyatt/allmark/common/util/fsutil" + "github.com/elWyatt/allmark/dataaccess/filesystem" + "github.com/elWyatt/allmark/services/initialization" + "github.com/elWyatt/allmark/services/parser" + "github.com/elWyatt/allmark/services/thumbnail" + "github.com/elWyatt/allmark/web/server" // "github.com/davecheney/profile" "flag" "os" @@ -37,7 +37,7 @@ const ( CommandNameVersion = "version" ) -var version = "v0.10.0-dev" +var version = "v0.21.0-dev-TMT" var ( serveFlags = flag.NewFlagSet("serve-flags", flag.ContinueOnError) @@ -149,7 +149,7 @@ func printUsageInformation(args []string) { fmt.Fprintf(os.Stderr, " %7s %s\n", CommandNameInit, "Initialize the configuration") fmt.Fprintf(os.Stderr, " %7s %s\n", CommandNameServe, "Start serving the supplied repository via HTTP and HTTPs") fmt.Fprintf(os.Stderr, "\n") - fmt.Fprintf(os.Stderr, "Fork me on GitHub %q\n", "https://github.com/andreaskoch/allmark") + fmt.Fprintf(os.Stderr, "Fork me on GitHub %q\n", "https://github.com/elWyatt/allmark") os.Exit(2) } diff --git a/common/config/config.go b/common/config/config.go index 066e4e49..10ca88d5 100644 --- a/common/config/config.go +++ b/common/config/config.go @@ -15,10 +15,10 @@ import ( "os/exec" "path/filepath" - "github.com/andreaskoch/allmark/common/certificates" - "github.com/andreaskoch/allmark/common/logger/loglevel" - "github.com/andreaskoch/allmark/common/ports" - "github.com/andreaskoch/allmark/common/util/fsutil" + "github.com/elWyatt/allmark/common/certificates" + "github.com/elWyatt/allmark/common/logger/loglevel" + "github.com/elWyatt/allmark/common/ports" + "github.com/elWyatt/allmark/common/util/fsutil" "github.com/abbot/go-http-auth" "github.com/mitchellh/go-homedir" ) diff --git a/common/logger/console/console.go b/common/logger/console/console.go index 7272cf27..13a742d9 100644 --- a/common/logger/console/console.go +++ b/common/logger/console/console.go @@ -7,7 +7,7 @@ package console import ( - "github.com/andreaskoch/allmark/common/logger/loglevel" + "github.com/elWyatt/allmark/common/logger/loglevel" "fmt" "io" "log" diff --git a/common/logger/console/console_test.go b/common/logger/console/console_test.go index 6cad1dcc..7248f9e9 100644 --- a/common/logger/console/console_test.go +++ b/common/logger/console/console_test.go @@ -5,7 +5,7 @@ package console import ( - "github.com/andreaskoch/allmark/common/logger/loglevel" + "github.com/elWyatt/allmark/common/logger/loglevel" "bytes" "strings" "testing" diff --git a/common/logger/logger.go b/common/logger/logger.go index f3fbb3a1..23095bc8 100644 --- a/common/logger/logger.go +++ b/common/logger/logger.go @@ -5,7 +5,7 @@ package logger import ( - "github.com/andreaskoch/allmark/common/logger/loglevel" + "github.com/elWyatt/allmark/common/logger/loglevel" ) type Logger interface { diff --git a/common/paths/factory.go b/common/paths/factory.go index 1188a19b..702c34cc 100644 --- a/common/paths/factory.go +++ b/common/paths/factory.go @@ -5,7 +5,7 @@ package paths import ( - "github.com/andreaskoch/allmark/common/route" + "github.com/elWyatt/allmark/common/route" ) type PatherFactory interface { diff --git a/common/paths/paths.go b/common/paths/paths.go index a5f5ef98..f3c454a2 100644 --- a/common/paths/paths.go +++ b/common/paths/paths.go @@ -5,7 +5,7 @@ package paths import ( - "github.com/andreaskoch/allmark/common/route" + "github.com/elWyatt/allmark/common/route" ) type Pather interface { diff --git a/common/tree/util.go b/common/tree/util.go index 41f122c4..af0e13be 100644 --- a/common/tree/util.go +++ b/common/tree/util.go @@ -5,7 +5,7 @@ package tree import ( - "github.com/andreaskoch/allmark/common/route" + "github.com/elWyatt/allmark/common/route" ) func RouteToPath(route route.Route) Path { diff --git a/common/tree/util_test.go b/common/tree/util_test.go index f161d3d1..050062d5 100644 --- a/common/tree/util_test.go +++ b/common/tree/util_test.go @@ -5,7 +5,7 @@ package tree import ( - "github.com/andreaskoch/allmark/common/route" + "github.com/elWyatt/allmark/common/route" "testing" ) diff --git a/dataaccess/file.go b/dataaccess/file.go index ef9cc27d..5c9896a9 100644 --- a/dataaccess/file.go +++ b/dataaccess/file.go @@ -5,8 +5,8 @@ package dataaccess import ( - "github.com/andreaskoch/allmark/common/content" - "github.com/andreaskoch/allmark/common/route" + "github.com/elWyatt/allmark/common/content" + "github.com/elWyatt/allmark/common/route" ) // A File represents a file ressource that is associated with an Item. diff --git a/dataaccess/filesystem/contentprovider.go b/dataaccess/filesystem/contentprovider.go index b2ad40a6..01ac24c1 100644 --- a/dataaccess/filesystem/contentprovider.go +++ b/dataaccess/filesystem/contentprovider.go @@ -5,10 +5,10 @@ package filesystem import ( - "github.com/andreaskoch/allmark/common/content" - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/common/util/fsutil" - "github.com/andreaskoch/allmark/common/util/hashutil" + "github.com/elWyatt/allmark/common/content" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/common/util/fsutil" + "github.com/elWyatt/allmark/common/util/hashutil" "fmt" "io" "io/ioutil" diff --git a/dataaccess/filesystem/file.go b/dataaccess/filesystem/file.go index ae073981..f60ea9fa 100644 --- a/dataaccess/filesystem/file.go +++ b/dataaccess/filesystem/file.go @@ -5,9 +5,9 @@ package filesystem import ( - "github.com/andreaskoch/allmark/common/content" - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/common/util/hashutil" + "github.com/elWyatt/allmark/common/content" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/common/util/hashutil" "fmt" ) diff --git a/dataaccess/filesystem/fileprovider.go b/dataaccess/filesystem/fileprovider.go index 41f35034..80bd45ec 100644 --- a/dataaccess/filesystem/fileprovider.go +++ b/dataaccess/filesystem/fileprovider.go @@ -5,10 +5,10 @@ package filesystem import ( - "github.com/andreaskoch/allmark/common/logger" - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/common/util/fsutil" - "github.com/andreaskoch/allmark/dataaccess" + "github.com/elWyatt/allmark/common/logger" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/common/util/fsutil" + "github.com/elWyatt/allmark/dataaccess" "fmt" "io/ioutil" "path/filepath" diff --git a/dataaccess/filesystem/index.go b/dataaccess/filesystem/index.go index 71049520..ce2c94cc 100644 --- a/dataaccess/filesystem/index.go +++ b/dataaccess/filesystem/index.go @@ -5,8 +5,8 @@ package filesystem import ( - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/dataaccess" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/dataaccess" "fmt" ) diff --git a/dataaccess/filesystem/item.go b/dataaccess/filesystem/item.go index 24101bb5..af40ec05 100644 --- a/dataaccess/filesystem/item.go +++ b/dataaccess/filesystem/item.go @@ -5,10 +5,10 @@ package filesystem import ( - "github.com/andreaskoch/allmark/common/content" - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/common/util/hashutil" - "github.com/andreaskoch/allmark/dataaccess" + "github.com/elWyatt/allmark/common/content" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/common/util/hashutil" + "github.com/elWyatt/allmark/dataaccess" "fmt" ) diff --git a/dataaccess/filesystem/itemprovider.go b/dataaccess/filesystem/itemprovider.go index 863511e5..44a97ac9 100644 --- a/dataaccess/filesystem/itemprovider.go +++ b/dataaccess/filesystem/itemprovider.go @@ -5,11 +5,11 @@ package filesystem import ( - "github.com/andreaskoch/allmark/common/config" - "github.com/andreaskoch/allmark/common/logger" - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/common/util/fsutil" - "github.com/andreaskoch/allmark/dataaccess" + "github.com/elWyatt/allmark/common/config" + "github.com/elWyatt/allmark/common/logger" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/common/util/fsutil" + "github.com/elWyatt/allmark/dataaccess" "fmt" "path/filepath" ) diff --git a/dataaccess/filesystem/itemtree.go b/dataaccess/filesystem/itemtree.go index 23235a49..401b0606 100644 --- a/dataaccess/filesystem/itemtree.go +++ b/dataaccess/filesystem/itemtree.go @@ -5,9 +5,9 @@ package filesystem import ( - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/common/tree" - "github.com/andreaskoch/allmark/dataaccess" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/common/tree" + "github.com/elWyatt/allmark/dataaccess" "fmt" ) diff --git a/dataaccess/filesystem/repository.go b/dataaccess/filesystem/repository.go index a30fb045..6d2d573d 100644 --- a/dataaccess/filesystem/repository.go +++ b/dataaccess/filesystem/repository.go @@ -10,11 +10,11 @@ import ( "runtime" "time" - "github.com/andreaskoch/allmark/common/config" - "github.com/andreaskoch/allmark/common/logger" - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/common/util/fsutil" - "github.com/andreaskoch/allmark/dataaccess" + "github.com/elWyatt/allmark/common/config" + "github.com/elWyatt/allmark/common/logger" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/common/util/fsutil" + "github.com/elWyatt/allmark/dataaccess" ) type Repository struct { diff --git a/dataaccess/filesystem/util.go b/dataaccess/filesystem/util.go index 624982dd..93451105 100644 --- a/dataaccess/filesystem/util.go +++ b/dataaccess/filesystem/util.go @@ -5,8 +5,8 @@ package filesystem import ( - "github.com/andreaskoch/allmark/common/config" - "github.com/andreaskoch/allmark/common/util/fsutil" + "github.com/elWyatt/allmark/common/config" + "github.com/elWyatt/allmark/common/util/fsutil" "io/ioutil" "path/filepath" "strings" diff --git a/dataaccess/filesystem/watcher.go b/dataaccess/filesystem/watcher.go index ad029e7e..9120cd89 100644 --- a/dataaccess/filesystem/watcher.go +++ b/dataaccess/filesystem/watcher.go @@ -5,8 +5,8 @@ package filesystem import ( - "github.com/andreaskoch/allmark/common/logger" - "github.com/andreaskoch/allmark/common/route" + "github.com/elWyatt/allmark/common/logger" + "github.com/elWyatt/allmark/common/route" "fmt" "github.com/andreaskoch/go-fswatch" ) diff --git a/dataaccess/item.go b/dataaccess/item.go index 0dcdc099..53d74e7f 100644 --- a/dataaccess/item.go +++ b/dataaccess/item.go @@ -5,8 +5,8 @@ package dataaccess import ( - "github.com/andreaskoch/allmark/common/content" - "github.com/andreaskoch/allmark/common/route" + "github.com/elWyatt/allmark/common/content" + "github.com/elWyatt/allmark/common/route" ) type ItemType int diff --git a/dataaccess/repository.go b/dataaccess/repository.go index 4180c679..68130757 100644 --- a/dataaccess/repository.go +++ b/dataaccess/repository.go @@ -5,7 +5,7 @@ package dataaccess import ( - "github.com/andreaskoch/allmark/common/route" + "github.com/elWyatt/allmark/common/route" "fmt" ) diff --git a/model/file.go b/model/file.go index 0bc6025e..faf64724 100644 --- a/model/file.go +++ b/model/file.go @@ -5,7 +5,7 @@ package model import ( - "github.com/andreaskoch/allmark/dataaccess" + "github.com/elWyatt/allmark/dataaccess" "strings" ) diff --git a/model/item.go b/model/item.go index 8d26074c..87ada3cf 100644 --- a/model/item.go +++ b/model/item.go @@ -9,8 +9,8 @@ import ( "sort" "strings" - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/dataaccess" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/dataaccess" ) type ItemType int diff --git a/services/converter/converter.go b/services/converter/converter.go index d723bd71..ef3ce3dd 100644 --- a/services/converter/converter.go +++ b/services/converter/converter.go @@ -5,8 +5,8 @@ package converter import ( - "github.com/andreaskoch/allmark/common/paths" - "github.com/andreaskoch/allmark/model" + "github.com/elWyatt/allmark/common/paths" + "github.com/elWyatt/allmark/model" ) type Converter interface { diff --git a/services/converter/markdowntohtml/filetreerenderer/filetree.go b/services/converter/markdowntohtml/filetreerenderer/filetree.go index 6094d8a3..d5b882b4 100644 --- a/services/converter/markdowntohtml/filetreerenderer/filetree.go +++ b/services/converter/markdowntohtml/filetreerenderer/filetree.go @@ -5,9 +5,9 @@ package filetreerenderer import ( - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/common/tree" - "github.com/andreaskoch/allmark/model" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/common/tree" + "github.com/elWyatt/allmark/model" ) type FileNode struct { diff --git a/services/converter/markdowntohtml/filetreerenderer/renderer.go b/services/converter/markdowntohtml/filetreerenderer/renderer.go index a4d39580..8b9aea0a 100644 --- a/services/converter/markdowntohtml/filetreerenderer/renderer.go +++ b/services/converter/markdowntohtml/filetreerenderer/renderer.go @@ -8,9 +8,9 @@ import ( "fmt" "strings" - "github.com/andreaskoch/allmark/common/paths" - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/model" + "github.com/elWyatt/allmark/common/paths" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/model" ) func New(pathProvider paths.Pather, baseRoute route.Route, files []*model.File) *FileTreeRenderer { diff --git a/services/converter/markdowntohtml/imageprovider/image.go b/services/converter/markdowntohtml/imageprovider/image.go index 1a43d2ba..2e91cc90 100644 --- a/services/converter/markdowntohtml/imageprovider/image.go +++ b/services/converter/markdowntohtml/imageprovider/image.go @@ -5,9 +5,9 @@ package imageprovider import ( - "github.com/andreaskoch/allmark/common/paths" - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/services/thumbnail" + "github.com/elWyatt/allmark/common/paths" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/services/thumbnail" "fmt" "strings" ) diff --git a/services/converter/markdowntohtml/markdowntohtml.go b/services/converter/markdowntohtml/markdowntohtml.go index 673c1753..04e22dcb 100644 --- a/services/converter/markdowntohtml/markdowntohtml.go +++ b/services/converter/markdowntohtml/markdowntohtml.go @@ -5,12 +5,12 @@ package markdowntohtml import ( - "github.com/andreaskoch/allmark/common/logger" - "github.com/andreaskoch/allmark/common/paths" - "github.com/andreaskoch/allmark/model" - "github.com/andreaskoch/allmark/services/converter/markdowntohtml/imageprovider" - "github.com/andreaskoch/allmark/services/converter/markdowntohtml/postprocessor" - "github.com/andreaskoch/allmark/services/converter/markdowntohtml/preprocessor" + "github.com/elWyatt/allmark/common/logger" + "github.com/elWyatt/allmark/common/paths" + "github.com/elWyatt/allmark/model" + "github.com/elWyatt/allmark/services/converter/markdowntohtml/imageprovider" + "github.com/elWyatt/allmark/services/converter/markdowntohtml/postprocessor" + "github.com/elWyatt/allmark/services/converter/markdowntohtml/preprocessor" "github.com/russross/blackfriday" ) diff --git a/services/converter/markdowntohtml/postprocessor/image.go b/services/converter/markdowntohtml/postprocessor/image.go index c4890f8b..6f1daf1b 100644 --- a/services/converter/markdowntohtml/postprocessor/image.go +++ b/services/converter/markdowntohtml/postprocessor/image.go @@ -5,10 +5,10 @@ package postprocessor import ( - "github.com/andreaskoch/allmark/common/paths" - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/model" - "github.com/andreaskoch/allmark/services/converter/markdowntohtml/imageprovider" + "github.com/elWyatt/allmark/common/paths" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/model" + "github.com/elWyatt/allmark/services/converter/markdowntohtml/imageprovider" "regexp" "strings" ) diff --git a/services/converter/markdowntohtml/postprocessor/image_test.go b/services/converter/markdowntohtml/postprocessor/image_test.go index 8cf36b54..871d9763 100644 --- a/services/converter/markdowntohtml/postprocessor/image_test.go +++ b/services/converter/markdowntohtml/postprocessor/image_test.go @@ -8,16 +8,16 @@ import ( "fmt" "testing" - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/model" - "github.com/andreaskoch/allmark/services/converter/markdowntohtml/imageprovider" - "github.com/andreaskoch/allmark/services/thumbnail" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/model" + "github.com/elWyatt/allmark/services/converter/markdowntohtml/imageprovider" + "github.com/elWyatt/allmark/services/thumbnail" ) func Test_Convert(t *testing.T) { // arrange title := "Build Status" - imagePath := "https://travis-ci.org/andreaskoch/allmark.png" + imagePath := "https://travis-ci.org/elWyatt/allmark.png" expected := fmt.Sprintf(`%s`, imagePath, title) input := fmt.Sprintf(`%s`, imagePath, title) diff --git a/services/converter/markdowntohtml/postprocessor/postprocessor.go b/services/converter/markdowntohtml/postprocessor/postprocessor.go index 68c222cb..0f5b382d 100644 --- a/services/converter/markdowntohtml/postprocessor/postprocessor.go +++ b/services/converter/markdowntohtml/postprocessor/postprocessor.go @@ -5,11 +5,11 @@ package postprocessor import ( - "github.com/andreaskoch/allmark/common/logger" - "github.com/andreaskoch/allmark/common/paths" - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/model" - "github.com/andreaskoch/allmark/services/converter/markdowntohtml/imageprovider" + "github.com/elWyatt/allmark/common/logger" + "github.com/elWyatt/allmark/common/paths" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/model" + "github.com/elWyatt/allmark/services/converter/markdowntohtml/imageprovider" ) // Postprocessor provides post-processing capabilities for HTML code. diff --git a/services/converter/markdowntohtml/postprocessor/rewritelinks.go b/services/converter/markdowntohtml/postprocessor/rewritelinks.go index 8421e7c0..40307f5a 100644 --- a/services/converter/markdowntohtml/postprocessor/rewritelinks.go +++ b/services/converter/markdowntohtml/postprocessor/rewritelinks.go @@ -5,9 +5,9 @@ package postprocessor import ( - "github.com/andreaskoch/allmark/common/paths" - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/model" + "github.com/elWyatt/allmark/common/paths" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/model" "fmt" "regexp" "strings" diff --git a/services/converter/markdowntohtml/preprocessor/audio.go b/services/converter/markdowntohtml/preprocessor/audio.go index 2b5f8fe8..42b0b443 100644 --- a/services/converter/markdowntohtml/preprocessor/audio.go +++ b/services/converter/markdowntohtml/preprocessor/audio.go @@ -5,9 +5,9 @@ package preprocessor import ( - "github.com/andreaskoch/allmark/common/paths" - "github.com/andreaskoch/allmark/model" - "github.com/andreaskoch/allmark/services/converter/markdowntohtml/util" + "github.com/elWyatt/allmark/common/paths" + "github.com/elWyatt/allmark/model" + "github.com/elWyatt/allmark/services/converter/markdowntohtml/util" "fmt" "mime" "regexp" diff --git a/services/converter/markdowntohtml/preprocessor/csv.go b/services/converter/markdowntohtml/preprocessor/csv.go index 140331ff..c29b6202 100644 --- a/services/converter/markdowntohtml/preprocessor/csv.go +++ b/services/converter/markdowntohtml/preprocessor/csv.go @@ -5,9 +5,9 @@ package preprocessor import ( - "github.com/andreaskoch/allmark/common/paths" - "github.com/andreaskoch/allmark/model" - "github.com/andreaskoch/allmark/services/converter/markdowntohtml/util" + "github.com/elWyatt/allmark/common/paths" + "github.com/elWyatt/allmark/model" + "github.com/elWyatt/allmark/services/converter/markdowntohtml/util" "bufio" "bytes" "encoding/csv" diff --git a/services/converter/markdowntohtml/preprocessor/filepreview.go b/services/converter/markdowntohtml/preprocessor/filepreview.go index ebb98f2d..6634834d 100644 --- a/services/converter/markdowntohtml/preprocessor/filepreview.go +++ b/services/converter/markdowntohtml/preprocessor/filepreview.go @@ -5,9 +5,9 @@ package preprocessor import ( - "github.com/andreaskoch/allmark/common/paths" - "github.com/andreaskoch/allmark/model" - "github.com/andreaskoch/allmark/services/converter/markdowntohtml/util" + "github.com/elWyatt/allmark/common/paths" + "github.com/elWyatt/allmark/model" + "github.com/elWyatt/allmark/services/converter/markdowntohtml/util" "bufio" "bytes" "fmt" diff --git a/services/converter/markdowntohtml/preprocessor/files.go b/services/converter/markdowntohtml/preprocessor/files.go index 5f32fc6a..2d176aa6 100644 --- a/services/converter/markdowntohtml/preprocessor/files.go +++ b/services/converter/markdowntohtml/preprocessor/files.go @@ -5,10 +5,10 @@ package preprocessor import ( - "github.com/andreaskoch/allmark/common/paths" - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/model" - "github.com/andreaskoch/allmark/services/converter/markdowntohtml/filetreerenderer" + "github.com/elWyatt/allmark/common/paths" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/model" + "github.com/elWyatt/allmark/services/converter/markdowntohtml/filetreerenderer" "regexp" "strings" ) diff --git a/services/converter/markdowntohtml/preprocessor/imagegallery.go b/services/converter/markdowntohtml/preprocessor/imagegallery.go index de3548a1..c7fcd319 100644 --- a/services/converter/markdowntohtml/preprocessor/imagegallery.go +++ b/services/converter/markdowntohtml/preprocessor/imagegallery.go @@ -5,10 +5,10 @@ package preprocessor import ( - "github.com/andreaskoch/allmark/common/paths" - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/model" - "github.com/andreaskoch/allmark/services/converter/markdowntohtml/imageprovider" + "github.com/elWyatt/allmark/common/paths" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/model" + "github.com/elWyatt/allmark/services/converter/markdowntohtml/imageprovider" "fmt" "regexp" "strings" diff --git a/services/converter/markdowntohtml/preprocessor/mermaid.go b/services/converter/markdowntohtml/preprocessor/mermaid.go new file mode 100644 index 00000000..c0245ce8 --- /dev/null +++ b/services/converter/markdowntohtml/preprocessor/mermaid.go @@ -0,0 +1,63 @@ +// Copyright 2020 Thomas Marschall. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package preprocessor + +import ( + "github.com/elWyatt/allmark/common/paths" + "github.com/elWyatt/allmark/model" + "fmt" + "regexp" + "strings" +) + +var ( + // ```mermaid``` + mermaidMarkdownExtensionPattern = regexp.MustCompile(`(?s)\x60{3}mermaid(.*?)\x60{3}`) +) + +func newMermaidExtension(pathProvider paths.Pather, files []*model.File) *MermaidTableExtension { + return &MermaidTableExtension{ + pathProvider: pathProvider, + files: files, + } +} + +type MermaidTableExtension struct { + pathProvider paths.Pather + files []*model.File +} + +func (converter *MermaidTableExtension) Convert(markdown string) (convertedContent string, converterError error) { + + convertedContent = markdown + + for _, match := range mermaidMarkdownExtensionPattern.FindAllStringSubmatch(convertedContent, -1) { + + if len(match) != 2 { + continue + } + + // parameters + originalText := strings.TrimSpace(match[0]) + code := strings.TrimSpace(match[1]) + + // get the code + renderedCode := converter.getMermaidDiv(code) + + // replace markdown + convertedContent = strings.Replace(convertedContent, originalText, renderedCode, 1) + + } + + return convertedContent, nil +} + +func (converter *MermaidTableExtension) getMermaidDiv(code string) string { + + // div container with mermaid code + divCode := fmt.Sprintf(`
%s
`, code) + return divCode + +} diff --git a/services/converter/markdowntohtml/preprocessor/preprocessor.go b/services/converter/markdowntohtml/preprocessor/preprocessor.go index b34d490b..6e5b31dc 100644 --- a/services/converter/markdowntohtml/preprocessor/preprocessor.go +++ b/services/converter/markdowntohtml/preprocessor/preprocessor.go @@ -5,11 +5,11 @@ package preprocessor import ( - "github.com/andreaskoch/allmark/common/logger" - "github.com/andreaskoch/allmark/common/paths" - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/model" - "github.com/andreaskoch/allmark/services/converter/markdowntohtml/imageprovider" + "github.com/elWyatt/allmark/common/logger" + "github.com/elWyatt/allmark/common/paths" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/model" + "github.com/elWyatt/allmark/services/converter/markdowntohtml/imageprovider" ) // Preprocessor provides pre-processing capabilties for markdown code. @@ -83,6 +83,13 @@ func (preprocessor *Preprocessor) Convert( preprocessor.logger.Warn("Error while converting reference extensions. Error: %s", referenceConversionError) } + // markdown extension: mermaid + mermaidConverter := newMermaidExtension(pathProvider, files) + markdown, mermaidConversionError := mermaidConverter.Convert(markdown) + if mermaidConversionError != nil { + preprocessor.logger.Warn("Error while converting reference extensions. Error: %s", referenceConversionError) + } + return markdown, nil } diff --git a/services/converter/markdowntohtml/preprocessor/reference.go b/services/converter/markdowntohtml/preprocessor/reference.go index 4536fe7a..f06013a3 100644 --- a/services/converter/markdowntohtml/preprocessor/reference.go +++ b/services/converter/markdowntohtml/preprocessor/reference.go @@ -5,8 +5,8 @@ package preprocessor import ( - "github.com/andreaskoch/allmark/common/paths" - "github.com/andreaskoch/allmark/model" + "github.com/elWyatt/allmark/common/paths" + "github.com/elWyatt/allmark/model" "fmt" "regexp" "strings" diff --git a/services/converter/markdowntohtml/preprocessor/video.go b/services/converter/markdowntohtml/preprocessor/video.go index 3f842bb2..2ca75192 100644 --- a/services/converter/markdowntohtml/preprocessor/video.go +++ b/services/converter/markdowntohtml/preprocessor/video.go @@ -5,9 +5,9 @@ package preprocessor import ( - "github.com/andreaskoch/allmark/common/paths" - "github.com/andreaskoch/allmark/model" - "github.com/andreaskoch/allmark/services/converter/markdowntohtml/util" + "github.com/elWyatt/allmark/common/paths" + "github.com/elWyatt/allmark/model" + "github.com/elWyatt/allmark/services/converter/markdowntohtml/util" "fmt" "mime" "regexp" diff --git a/services/initialization/initialization.go b/services/initialization/initialization.go index 0757db70..348ec4a4 100644 --- a/services/initialization/initialization.go +++ b/services/initialization/initialization.go @@ -5,10 +5,10 @@ package initialization import ( - "github.com/andreaskoch/allmark/common/config" - "github.com/andreaskoch/allmark/common/util/fsutil" - "github.com/andreaskoch/allmark/web/view/templates" - "github.com/andreaskoch/allmark/web/view/themes" + "github.com/elWyatt/allmark/common/config" + "github.com/elWyatt/allmark/common/util/fsutil" + "github.com/elWyatt/allmark/web/view/templates" + "github.com/elWyatt/allmark/web/view/themes" "fmt" ) diff --git a/services/parser/document/parse.go b/services/parser/document/parse.go index 8a0c7665..38c1321e 100644 --- a/services/parser/document/parse.go +++ b/services/parser/document/parse.go @@ -5,9 +5,9 @@ package document import ( - "github.com/andreaskoch/allmark/model" - "github.com/andreaskoch/allmark/services/parser/metadata" - "github.com/andreaskoch/allmark/services/parser/pattern" + "github.com/elWyatt/allmark/model" + "github.com/elWyatt/allmark/services/parser/metadata" + "github.com/elWyatt/allmark/services/parser/pattern" "fmt" "strings" "time" diff --git a/services/parser/metadata/geoinformation.go b/services/parser/metadata/geoinformation.go index 978687ef..b2f97eda 100644 --- a/services/parser/metadata/geoinformation.go +++ b/services/parser/metadata/geoinformation.go @@ -5,7 +5,7 @@ package metadata import ( - "github.com/andreaskoch/allmark/model" + "github.com/elWyatt/allmark/model" "strconv" ) diff --git a/services/parser/metadata/parse.go b/services/parser/metadata/parse.go index 07bb3366..ff4dd7a8 100644 --- a/services/parser/metadata/parse.go +++ b/services/parser/metadata/parse.go @@ -9,9 +9,9 @@ import ( "strings" "time" - "github.com/andreaskoch/allmark/common/util/dateutil" - "github.com/andreaskoch/allmark/model" - "github.com/andreaskoch/allmark/services/parser/pattern" + "github.com/elWyatt/allmark/common/util/dateutil" + "github.com/elWyatt/allmark/model" + "github.com/elWyatt/allmark/services/parser/pattern" ) var aliasForbiddenCharacters = regexp.MustCompile(`[^\w\d-_]`) diff --git a/services/parser/metadata/parse_test.go b/services/parser/metadata/parse_test.go index 5052af81..39ef7dd5 100644 --- a/services/parser/metadata/parse_test.go +++ b/services/parser/metadata/parse_test.go @@ -7,7 +7,7 @@ package metadata import ( "testing" - "github.com/andreaskoch/allmark/model" + "github.com/elWyatt/allmark/model" ) func Test_normalizeAlias(t *testing.T) { diff --git a/services/parser/metadata/position.go b/services/parser/metadata/position.go index 4fbf0f13..721bb2da 100644 --- a/services/parser/metadata/position.go +++ b/services/parser/metadata/position.go @@ -5,7 +5,7 @@ package metadata import ( - "github.com/andreaskoch/allmark/services/parser/pattern" + "github.com/elWyatt/allmark/services/parser/pattern" "fmt" ) diff --git a/services/parser/metadata/util.go b/services/parser/metadata/util.go index cba4cdc1..f1224cb5 100644 --- a/services/parser/metadata/util.go +++ b/services/parser/metadata/util.go @@ -5,7 +5,7 @@ package metadata import ( - "github.com/andreaskoch/allmark/services/parser/pattern" + "github.com/elWyatt/allmark/services/parser/pattern" "strings" ) diff --git a/services/parser/parser.go b/services/parser/parser.go index ffbd3c6c..9f05863d 100644 --- a/services/parser/parser.go +++ b/services/parser/parser.go @@ -10,13 +10,13 @@ import ( "fmt" "io" - "github.com/andreaskoch/allmark/common/logger" - "github.com/andreaskoch/allmark/dataaccess" - "github.com/andreaskoch/allmark/model" - "github.com/andreaskoch/allmark/services/parser/cleanup" - "github.com/andreaskoch/allmark/services/parser/document" - "github.com/andreaskoch/allmark/services/parser/presentation" - "github.com/andreaskoch/allmark/services/parser/typedetection" + "github.com/elWyatt/allmark/common/logger" + "github.com/elWyatt/allmark/dataaccess" + "github.com/elWyatt/allmark/model" + "github.com/elWyatt/allmark/services/parser/cleanup" + "github.com/elWyatt/allmark/services/parser/document" + "github.com/elWyatt/allmark/services/parser/presentation" + "github.com/elWyatt/allmark/services/parser/typedetection" ) type Parser struct { diff --git a/services/parser/presentation/parse.go b/services/parser/presentation/parse.go index 5e36dfe1..0f713be2 100644 --- a/services/parser/presentation/parse.go +++ b/services/parser/presentation/parse.go @@ -5,9 +5,9 @@ package presentation import ( - "github.com/andreaskoch/allmark/model" - "github.com/andreaskoch/allmark/services/parser/document" - "github.com/andreaskoch/allmark/services/parser/pattern" + "github.com/elWyatt/allmark/model" + "github.com/elWyatt/allmark/services/parser/document" + "github.com/elWyatt/allmark/services/parser/pattern" "fmt" "strings" "time" diff --git a/services/parser/typedetection/detection.go b/services/parser/typedetection/detection.go index 4b448aae..7b14f405 100644 --- a/services/parser/typedetection/detection.go +++ b/services/parser/typedetection/detection.go @@ -7,9 +7,9 @@ package typedetection import ( "strings" - "github.com/andreaskoch/allmark/model" - "github.com/andreaskoch/allmark/services/parser/metadata" - "github.com/andreaskoch/allmark/services/parser/pattern" + "github.com/elWyatt/allmark/model" + "github.com/elWyatt/allmark/services/parser/metadata" + "github.com/elWyatt/allmark/services/parser/pattern" ) func DetectType(lines []string) model.ItemType { diff --git a/services/parser/typedetection/detection_test.go b/services/parser/typedetection/detection_test.go index 10270f4f..46d650f0 100644 --- a/services/parser/typedetection/detection_test.go +++ b/services/parser/typedetection/detection_test.go @@ -7,7 +7,7 @@ package typedetection import ( "testing" - "github.com/andreaskoch/allmark/model" + "github.com/elWyatt/allmark/model" ) func Test_DetectType_Document(t *testing.T) { diff --git a/services/thumbnail/conversion.go b/services/thumbnail/conversion.go index 02724dff..ea6062d2 100644 --- a/services/thumbnail/conversion.go +++ b/services/thumbnail/conversion.go @@ -5,11 +5,11 @@ package thumbnail import ( - "github.com/andreaskoch/allmark/common/logger" - // "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/common/util/fsutil" - "github.com/andreaskoch/allmark/dataaccess" - "github.com/andreaskoch/allmark/services/imageconversion" + "github.com/elWyatt/allmark/common/logger" + // "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/common/util/fsutil" + "github.com/elWyatt/allmark/dataaccess" + "github.com/elWyatt/allmark/services/imageconversion" "fmt" "io" "path/filepath" diff --git a/services/thumbnail/index.go b/services/thumbnail/index.go index 46df2d6e..f545bdc0 100644 --- a/services/thumbnail/index.go +++ b/services/thumbnail/index.go @@ -5,10 +5,10 @@ package thumbnail import ( - "github.com/andreaskoch/allmark/common/logger" - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/common/shutdown" - "github.com/andreaskoch/allmark/common/util/fsutil" + "github.com/elWyatt/allmark/common/logger" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/common/shutdown" + "github.com/elWyatt/allmark/common/util/fsutil" "encoding/json" "fmt" "io" diff --git a/services/thumbnail/index_test.go b/services/thumbnail/index_test.go index cabed336..c6ffea49 100644 --- a/services/thumbnail/index_test.go +++ b/services/thumbnail/index_test.go @@ -5,7 +5,7 @@ package thumbnail import ( - "github.com/andreaskoch/allmark/common/route" + "github.com/elWyatt/allmark/common/route" "testing" ) diff --git a/web/handlers/alias.go b/web/handlers/alias.go index 84c0100f..64343fc8 100644 --- a/web/handlers/alias.go +++ b/web/handlers/alias.go @@ -5,11 +5,11 @@ package handlers import ( - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/web/header" - "github.com/andreaskoch/allmark/web/orchestrator" - "github.com/andreaskoch/allmark/web/view/templates" - "github.com/andreaskoch/allmark/web/view/viewmodel" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/web/header" + "github.com/elWyatt/allmark/web/orchestrator" + "github.com/elWyatt/allmark/web/view/templates" + "github.com/elWyatt/allmark/web/view/viewmodel" "fmt" "net/http" "strings" diff --git a/web/handlers/auth.go b/web/handlers/auth.go index e08c2111..b61ef303 100644 --- a/web/handlers/auth.go +++ b/web/handlers/auth.go @@ -1,7 +1,7 @@ package handlers import ( - "github.com/andreaskoch/allmark/common/logger" + "github.com/elWyatt/allmark/common/logger" "github.com/abbot/go-http-auth" "net/http" ) diff --git a/web/handlers/docx.go b/web/handlers/docx.go index eb75ca85..55e3554b 100644 --- a/web/handlers/docx.go +++ b/web/handlers/docx.go @@ -5,13 +5,13 @@ package handlers import ( - "github.com/andreaskoch/allmark/common/logger" - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/common/util/fsutil" - "github.com/andreaskoch/allmark/web/header" - "github.com/andreaskoch/allmark/web/orchestrator" - "github.com/andreaskoch/allmark/web/view/templates" - "github.com/andreaskoch/allmark/web/view/viewmodel" + "github.com/elWyatt/allmark/common/logger" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/common/util/fsutil" + "github.com/elWyatt/allmark/web/header" + "github.com/elWyatt/allmark/web/orchestrator" + "github.com/elWyatt/allmark/web/view/templates" + "github.com/elWyatt/allmark/web/view/viewmodel" "bufio" "bytes" "fmt" diff --git a/web/handlers/error.go b/web/handlers/error.go index cecf6aef..a6949a8c 100644 --- a/web/handlers/error.go +++ b/web/handlers/error.go @@ -5,11 +5,11 @@ package handlers import ( - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/web/header" - "github.com/andreaskoch/allmark/web/orchestrator" - "github.com/andreaskoch/allmark/web/view/templates" - "github.com/andreaskoch/allmark/web/view/viewmodel" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/web/header" + "github.com/elWyatt/allmark/web/orchestrator" + "github.com/elWyatt/allmark/web/view/templates" + "github.com/elWyatt/allmark/web/view/viewmodel" "fmt" "net/http" ) diff --git a/web/handlers/factory.go b/web/handlers/factory.go index 0b020515..3d28781b 100644 --- a/web/handlers/factory.go +++ b/web/handlers/factory.go @@ -5,12 +5,12 @@ package handlers import ( - "github.com/andreaskoch/allmark/common/config" - "github.com/andreaskoch/allmark/common/logger" - "github.com/andreaskoch/allmark/common/util/fsutil" - "github.com/andreaskoch/allmark/web/header" - "github.com/andreaskoch/allmark/web/orchestrator" - "github.com/andreaskoch/allmark/web/view/templates" + "github.com/elWyatt/allmark/common/config" + "github.com/elWyatt/allmark/common/logger" + "github.com/elWyatt/allmark/common/util/fsutil" + "github.com/elWyatt/allmark/web/header" + "github.com/elWyatt/allmark/web/orchestrator" + "github.com/elWyatt/allmark/web/view/templates" "fmt" "net/http" ) diff --git a/web/handlers/item.go b/web/handlers/item.go index 83fb72a5..900783af 100644 --- a/web/handlers/item.go +++ b/web/handlers/item.go @@ -5,11 +5,11 @@ package handlers import ( - "github.com/andreaskoch/allmark/common/logger" - "github.com/andreaskoch/allmark/web/header" - "github.com/andreaskoch/allmark/web/orchestrator" - "github.com/andreaskoch/allmark/web/view/templates" - "github.com/andreaskoch/allmark/web/view/viewmodel" + "github.com/elWyatt/allmark/common/logger" + "github.com/elWyatt/allmark/web/header" + "github.com/elWyatt/allmark/web/orchestrator" + "github.com/elWyatt/allmark/web/view/templates" + "github.com/elWyatt/allmark/web/view/viewmodel" "io" "net/http" ) diff --git a/web/handlers/json.go b/web/handlers/json.go index 8172c64b..49737775 100644 --- a/web/handlers/json.go +++ b/web/handlers/json.go @@ -5,9 +5,9 @@ package handlers import ( - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/web/header" - "github.com/andreaskoch/allmark/web/orchestrator" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/web/header" + "github.com/elWyatt/allmark/web/orchestrator" "net/http" "strings" ) diff --git a/web/handlers/latest.go b/web/handlers/latest.go index 7857911d..452add77 100644 --- a/web/handlers/latest.go +++ b/web/handlers/latest.go @@ -5,11 +5,11 @@ package handlers import ( - "github.com/andreaskoch/allmark/common/logger" - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/common/util/hashutil" - "github.com/andreaskoch/allmark/web/header" - "github.com/andreaskoch/allmark/web/orchestrator" + "github.com/elWyatt/allmark/common/logger" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/common/util/hashutil" + "github.com/elWyatt/allmark/web/header" + "github.com/elWyatt/allmark/web/orchestrator" "encoding/json" "net/http" "strings" diff --git a/web/handlers/markdown.go b/web/handlers/markdown.go index b1285537..b77aed3e 100644 --- a/web/handlers/markdown.go +++ b/web/handlers/markdown.go @@ -5,9 +5,9 @@ package handlers import ( - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/web/header" - "github.com/andreaskoch/allmark/web/orchestrator" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/web/header" + "github.com/elWyatt/allmark/web/orchestrator" "fmt" "net/http" "strings" diff --git a/web/handlers/opensearchdescription.go b/web/handlers/opensearchdescription.go index 3dc3c5cb..7b4a1366 100644 --- a/web/handlers/opensearchdescription.go +++ b/web/handlers/opensearchdescription.go @@ -5,9 +5,9 @@ package handlers import ( - "github.com/andreaskoch/allmark/web/header" - "github.com/andreaskoch/allmark/web/orchestrator" - "github.com/andreaskoch/allmark/web/view/templates" + "github.com/elWyatt/allmark/web/header" + "github.com/elWyatt/allmark/web/orchestrator" + "github.com/elWyatt/allmark/web/view/templates" "fmt" "net/http" ) diff --git a/web/handlers/print.go b/web/handlers/print.go index 95696a64..2ac935bd 100644 --- a/web/handlers/print.go +++ b/web/handlers/print.go @@ -5,12 +5,12 @@ package handlers import ( - "github.com/andreaskoch/allmark/common/logger" - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/web/header" - "github.com/andreaskoch/allmark/web/orchestrator" - "github.com/andreaskoch/allmark/web/view/templates" - "github.com/andreaskoch/allmark/web/view/viewmodel" + "github.com/elWyatt/allmark/common/logger" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/web/header" + "github.com/elWyatt/allmark/web/orchestrator" + "github.com/elWyatt/allmark/web/view/templates" + "github.com/elWyatt/allmark/web/view/viewmodel" "io" "net/http" "strings" diff --git a/web/handlers/redirect.go b/web/handlers/redirect.go index 1531a762..20160f34 100644 --- a/web/handlers/redirect.go +++ b/web/handlers/redirect.go @@ -5,7 +5,7 @@ package handlers import ( - "github.com/andreaskoch/allmark/common/logger" + "github.com/elWyatt/allmark/common/logger" "net/http" ) diff --git a/web/handlers/robotstxt.go b/web/handlers/robotstxt.go index 35226564..62666d43 100644 --- a/web/handlers/robotstxt.go +++ b/web/handlers/robotstxt.go @@ -5,9 +5,9 @@ package handlers import ( - "github.com/andreaskoch/allmark/web/header" - "github.com/andreaskoch/allmark/web/view/templates" - "github.com/andreaskoch/allmark/web/view/viewmodel" + "github.com/elWyatt/allmark/web/header" + "github.com/elWyatt/allmark/web/view/templates" + "github.com/elWyatt/allmark/web/view/viewmodel" "fmt" "net/http" ) diff --git a/web/handlers/rss.go b/web/handlers/rss.go index 081ed5a0..9fa71d4b 100644 --- a/web/handlers/rss.go +++ b/web/handlers/rss.go @@ -5,9 +5,9 @@ package handlers import ( - "github.com/andreaskoch/allmark/web/header" - "github.com/andreaskoch/allmark/web/orchestrator" - "github.com/andreaskoch/allmark/web/view/templates" + "github.com/elWyatt/allmark/web/header" + "github.com/elWyatt/allmark/web/orchestrator" + "github.com/elWyatt/allmark/web/view/templates" "fmt" "net/http" ) diff --git a/web/handlers/search.go b/web/handlers/search.go index e0ca4e8e..b4f00aa0 100644 --- a/web/handlers/search.go +++ b/web/handlers/search.go @@ -12,11 +12,11 @@ import ( "strings" "text/template" - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/web/header" - "github.com/andreaskoch/allmark/web/orchestrator" - "github.com/andreaskoch/allmark/web/view/templates" - "github.com/andreaskoch/allmark/web/view/viewmodel" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/web/header" + "github.com/elWyatt/allmark/web/orchestrator" + "github.com/elWyatt/allmark/web/view/templates" + "github.com/elWyatt/allmark/web/view/viewmodel" ) func Search(headerWriter header.HeaderWriter, diff --git a/web/handlers/sitemap.go b/web/handlers/sitemap.go index 1c8676db..f08788b5 100644 --- a/web/handlers/sitemap.go +++ b/web/handlers/sitemap.go @@ -8,11 +8,11 @@ import ( "fmt" "net/http" - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/web/header" - "github.com/andreaskoch/allmark/web/orchestrator" - "github.com/andreaskoch/allmark/web/view/templates" - "github.com/andreaskoch/allmark/web/view/viewmodel" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/web/header" + "github.com/elWyatt/allmark/web/orchestrator" + "github.com/elWyatt/allmark/web/view/templates" + "github.com/elWyatt/allmark/web/view/viewmodel" "strings" "text/template" diff --git a/web/handlers/static.go b/web/handlers/static.go index c1449ad5..f26d0ff6 100644 --- a/web/handlers/static.go +++ b/web/handlers/static.go @@ -1,9 +1,9 @@ package handlers import ( - "github.com/andreaskoch/allmark/common/util/fsutil" - "github.com/andreaskoch/allmark/common/util/hashutil" - "github.com/andreaskoch/allmark/web/header" + "github.com/elWyatt/allmark/common/util/fsutil" + "github.com/elWyatt/allmark/common/util/hashutil" + "github.com/elWyatt/allmark/web/header" "net/http" "path/filepath" "strings" diff --git a/web/handlers/tags.go b/web/handlers/tags.go index a84a4b78..3f410366 100644 --- a/web/handlers/tags.go +++ b/web/handlers/tags.go @@ -8,11 +8,11 @@ import ( "fmt" "net/http" - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/web/header" - "github.com/andreaskoch/allmark/web/orchestrator" - "github.com/andreaskoch/allmark/web/view/templates" - "github.com/andreaskoch/allmark/web/view/viewmodel" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/web/header" + "github.com/elWyatt/allmark/web/orchestrator" + "github.com/elWyatt/allmark/web/view/templates" + "github.com/elWyatt/allmark/web/view/viewmodel" ) func Tags(headerWriter header.HeaderWriter, diff --git a/web/handlers/theme.go b/web/handlers/theme.go index 06c7eb75..4f910389 100644 --- a/web/handlers/theme.go +++ b/web/handlers/theme.go @@ -5,9 +5,9 @@ package handlers import ( - "github.com/andreaskoch/allmark/common/util/hashutil" - "github.com/andreaskoch/allmark/web/header" - "github.com/andreaskoch/allmark/web/view/themes" + "github.com/elWyatt/allmark/common/util/hashutil" + "github.com/elWyatt/allmark/web/header" + "github.com/elWyatt/allmark/web/view/themes" "fmt" "mime" "net/http" diff --git a/web/handlers/titles.go b/web/handlers/titles.go index 6c594d9b..7ce2d2c6 100644 --- a/web/handlers/titles.go +++ b/web/handlers/titles.go @@ -5,9 +5,9 @@ package handlers import ( - "github.com/andreaskoch/allmark/web/header" - "github.com/andreaskoch/allmark/web/orchestrator" - "github.com/andreaskoch/allmark/web/view/viewmodel" + "github.com/elWyatt/allmark/web/header" + "github.com/elWyatt/allmark/web/orchestrator" + "github.com/elWyatt/allmark/web/view/viewmodel" "encoding/json" "io" "net/http" diff --git a/web/handlers/typeahead.go b/web/handlers/typeahead.go index 779b36fe..9b90ba66 100644 --- a/web/handlers/typeahead.go +++ b/web/handlers/typeahead.go @@ -5,9 +5,9 @@ package handlers import ( - "github.com/andreaskoch/allmark/web/header" - "github.com/andreaskoch/allmark/web/orchestrator" - "github.com/andreaskoch/allmark/web/view/viewmodel" + "github.com/elWyatt/allmark/web/header" + "github.com/elWyatt/allmark/web/orchestrator" + "github.com/elWyatt/allmark/web/view/viewmodel" "encoding/json" "io" "net/http" diff --git a/web/handlers/update.go b/web/handlers/update.go index 314cde73..d2bbf711 100644 --- a/web/handlers/update.go +++ b/web/handlers/update.go @@ -5,14 +5,14 @@ package handlers import ( - "github.com/andreaskoch/allmark/common/logger" - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/web/handlers/update" - "github.com/andreaskoch/allmark/web/header" - "github.com/andreaskoch/allmark/web/orchestrator" - "github.com/andreaskoch/allmark/web/view/templates" - "github.com/andreaskoch/allmark/web/view/templates/templatenames" - "github.com/andreaskoch/allmark/web/view/viewmodel" + "github.com/elWyatt/allmark/common/logger" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/web/handlers/update" + "github.com/elWyatt/allmark/web/header" + "github.com/elWyatt/allmark/web/orchestrator" + "github.com/elWyatt/allmark/web/view/templates" + "github.com/elWyatt/allmark/web/view/templates/templatenames" + "github.com/elWyatt/allmark/web/view/viewmodel" "golang.org/x/net/websocket" "strings" ) diff --git a/web/handlers/update/connection.go b/web/handlers/update/connection.go index 61c0356d..75c93ba4 100644 --- a/web/handlers/update/connection.go +++ b/web/handlers/update/connection.go @@ -5,7 +5,7 @@ package update import ( - "github.com/andreaskoch/allmark/common/route" + "github.com/elWyatt/allmark/common/route" "fmt" "golang.org/x/net/websocket" ) diff --git a/web/handlers/update/hub.go b/web/handlers/update/hub.go index 29e2415a..c030a5a2 100644 --- a/web/handlers/update/hub.go +++ b/web/handlers/update/hub.go @@ -5,9 +5,9 @@ package update import ( - "github.com/andreaskoch/allmark/common/logger" - "github.com/andreaskoch/allmark/web/orchestrator" - "github.com/andreaskoch/allmark/web/view/viewmodel" + "github.com/elWyatt/allmark/common/logger" + "github.com/elWyatt/allmark/web/orchestrator" + "github.com/elWyatt/allmark/web/view/viewmodel" ) func NewHub(logger logger.Logger, updateOrchestrator *orchestrator.UpdateOrchestrator) *Hub { diff --git a/web/handlers/update/message.go b/web/handlers/update/message.go index 1bebfe7c..b1dd23ea 100644 --- a/web/handlers/update/message.go +++ b/web/handlers/update/message.go @@ -5,8 +5,8 @@ package update import ( - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/web/view/viewmodel" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/web/view/viewmodel" ) type Message struct { diff --git a/web/handlers/util.go b/web/handlers/util.go index 2bbb9d21..d02acfeb 100644 --- a/web/handlers/util.go +++ b/web/handlers/util.go @@ -5,8 +5,8 @@ package handlers import ( - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/web/view/viewmodel" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/web/view/viewmodel" "bufio" "bytes" "encoding/json" diff --git a/web/handlers/xmlsitemap.go b/web/handlers/xmlsitemap.go index c21b5833..e886cd8d 100644 --- a/web/handlers/xmlsitemap.go +++ b/web/handlers/xmlsitemap.go @@ -5,10 +5,10 @@ package handlers import ( - "github.com/andreaskoch/allmark/web/header" - "github.com/andreaskoch/allmark/web/orchestrator" - "github.com/andreaskoch/allmark/web/view/templates" - "github.com/andreaskoch/allmark/web/view/viewmodel" + "github.com/elWyatt/allmark/web/header" + "github.com/elWyatt/allmark/web/orchestrator" + "github.com/elWyatt/allmark/web/view/templates" + "github.com/elWyatt/allmark/web/view/viewmodel" "bytes" "fmt" "net/http" diff --git a/web/orchestrator/aliasindex.go b/web/orchestrator/aliasindex.go index ef38eefd..e3148fb7 100644 --- a/web/orchestrator/aliasindex.go +++ b/web/orchestrator/aliasindex.go @@ -5,7 +5,7 @@ package orchestrator import ( - "github.com/andreaskoch/allmark/web/view/viewmodel" + "github.com/elWyatt/allmark/web/view/viewmodel" "fmt" ) diff --git a/web/orchestrator/conversionmodel.go b/web/orchestrator/conversionmodel.go index ba6ef6a5..87869fbb 100644 --- a/web/orchestrator/conversionmodel.go +++ b/web/orchestrator/conversionmodel.go @@ -5,8 +5,8 @@ package orchestrator import ( - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/web/view/viewmodel" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/web/view/viewmodel" "fmt" ) diff --git a/web/orchestrator/factory.go b/web/orchestrator/factory.go index 45b02083..df4365be 100644 --- a/web/orchestrator/factory.go +++ b/web/orchestrator/factory.go @@ -5,12 +5,12 @@ package orchestrator import ( - "github.com/andreaskoch/allmark/common/config" - "github.com/andreaskoch/allmark/common/logger" - "github.com/andreaskoch/allmark/dataaccess" - "github.com/andreaskoch/allmark/services/converter" - "github.com/andreaskoch/allmark/services/parser" - "github.com/andreaskoch/allmark/web/webpaths" + "github.com/elWyatt/allmark/common/config" + "github.com/elWyatt/allmark/common/logger" + "github.com/elWyatt/allmark/dataaccess" + "github.com/elWyatt/allmark/services/converter" + "github.com/elWyatt/allmark/services/parser" + "github.com/elWyatt/allmark/web/webpaths" ) func NewFactory(logger logger.Logger, config config.Config, repository dataaccess.Repository, parser parser.Parser, converter converter.Converter, webPathProvider webpaths.WebPathProvider) *Factory { diff --git a/web/orchestrator/feed.go b/web/orchestrator/feed.go index 331ba8c5..42fd39a5 100644 --- a/web/orchestrator/feed.go +++ b/web/orchestrator/feed.go @@ -5,8 +5,8 @@ package orchestrator import ( - "github.com/andreaskoch/allmark/model" - "github.com/andreaskoch/allmark/web/view/viewmodel" + "github.com/elWyatt/allmark/model" + "github.com/elWyatt/allmark/web/view/viewmodel" "fmt" ) diff --git a/web/orchestrator/file.go b/web/orchestrator/file.go index 1943ed85..0efec52b 100644 --- a/web/orchestrator/file.go +++ b/web/orchestrator/file.go @@ -5,11 +5,11 @@ package orchestrator import ( - "github.com/andreaskoch/allmark/common/content" - "github.com/andreaskoch/allmark/common/paths" - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/model" - "github.com/andreaskoch/allmark/web/view/viewmodel" + "github.com/elWyatt/allmark/common/content" + "github.com/elWyatt/allmark/common/paths" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/model" + "github.com/elWyatt/allmark/web/view/viewmodel" "fmt" ) diff --git a/web/orchestrator/geolocation.go b/web/orchestrator/geolocation.go index f4ac460e..9b4f5772 100644 --- a/web/orchestrator/geolocation.go +++ b/web/orchestrator/geolocation.go @@ -5,8 +5,8 @@ package orchestrator import ( - "github.com/andreaskoch/allmark/model" - "github.com/andreaskoch/allmark/web/view/viewmodel" + "github.com/elWyatt/allmark/model" + "github.com/elWyatt/allmark/web/view/viewmodel" "fmt" "strings" ) diff --git a/web/orchestrator/index/index.go b/web/orchestrator/index/index.go index 03eb94bb..664fa5e4 100644 --- a/web/orchestrator/index/index.go +++ b/web/orchestrator/index/index.go @@ -5,9 +5,9 @@ package index import ( - "github.com/andreaskoch/allmark/common/logger" - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/model" + "github.com/elWyatt/allmark/common/logger" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/model" ) func New(logger logger.Logger) *Index { diff --git a/web/orchestrator/index/itemtree.go b/web/orchestrator/index/itemtree.go index c282c9ae..aedbcd7e 100644 --- a/web/orchestrator/index/itemtree.go +++ b/web/orchestrator/index/itemtree.go @@ -5,10 +5,10 @@ package index import ( - "github.com/andreaskoch/allmark/common/logger" - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/common/tree" - "github.com/andreaskoch/allmark/model" + "github.com/elWyatt/allmark/common/logger" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/common/tree" + "github.com/elWyatt/allmark/model" ) func newItemTree(logger logger.Logger) *ItemTree { diff --git a/web/orchestrator/itemcache.go b/web/orchestrator/itemcache.go index b83ff811..bd240a0d 100644 --- a/web/orchestrator/itemcache.go +++ b/web/orchestrator/itemcache.go @@ -8,12 +8,12 @@ package orchestrator import ( - "github.com/andreaskoch/allmark/model" + "github.com/elWyatt/allmark/model" "hash/fnv" "sync" ) -var ITEMCACHE_SHARD_COUNT = 32 +var ITEMCACHE_SHARD_COUNT = uint(32) // A "thread" safe map of type string:*model.Item. // To avoid lock bottlenecks this map is dived to several (ITEMCACHE_SHARD_COUNT) map shards. @@ -26,7 +26,7 @@ type ConcurrentItemMapShared struct { // Creates a new concurrent item cache map. func newItemCache() ItemCache { m := make(ItemCache, ITEMCACHE_SHARD_COUNT) - for i := 0; i < ITEMCACHE_SHARD_COUNT; i++ { + for i := uint(0); i < ITEMCACHE_SHARD_COUNT; i++ { m[i] = &ConcurrentItemMapShared{items: make(map[string]*model.Item)} } return m @@ -36,7 +36,7 @@ func newItemCache() ItemCache { func (m ItemCache) GetShard(key string) *ConcurrentItemMapShared { hasher := fnv.New32() hasher.Write([]byte(key)) - return m[int(hasher.Sum32())%ITEMCACHE_SHARD_COUNT] + return m[uint(hasher.Sum32())%ITEMCACHE_SHARD_COUNT] } // Sets the given value under the specified key. @@ -63,7 +63,7 @@ func (m ItemCache) Get(key string) (*model.Item, bool) { // Returns the number of elements within the map. func (m ItemCache) Count() int { count := 0 - for i := 0; i < ITEMCACHE_SHARD_COUNT; i++ { + for i := uint(0); i < ITEMCACHE_SHARD_COUNT; i++ { shard := m[i] shard.RLock() count += len(shard.items) diff --git a/web/orchestrator/navigation.go b/web/orchestrator/navigation.go index 47f0aa17..72053d08 100644 --- a/web/orchestrator/navigation.go +++ b/web/orchestrator/navigation.go @@ -5,8 +5,8 @@ package orchestrator import ( - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/web/view/viewmodel" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/web/view/viewmodel" ) type NavigationOrchestrator struct { diff --git a/web/orchestrator/opensearchdescription.go b/web/orchestrator/opensearchdescription.go index bb24f38b..406fb8bc 100644 --- a/web/orchestrator/opensearchdescription.go +++ b/web/orchestrator/opensearchdescription.go @@ -5,7 +5,7 @@ package orchestrator import ( - "github.com/andreaskoch/allmark/web/view/viewmodel" + "github.com/elWyatt/allmark/web/view/viewmodel" "fmt" "strings" ) diff --git a/web/orchestrator/orchestrator.go b/web/orchestrator/orchestrator.go index 67e14711..3a221945 100644 --- a/web/orchestrator/orchestrator.go +++ b/web/orchestrator/orchestrator.go @@ -8,18 +8,18 @@ import ( "fmt" "time" - "github.com/andreaskoch/allmark/common/config" - "github.com/andreaskoch/allmark/common/logger" - "github.com/andreaskoch/allmark/common/paths" - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/dataaccess" - "github.com/andreaskoch/allmark/model" - "github.com/andreaskoch/allmark/services/converter" - "github.com/andreaskoch/allmark/services/parser" - "github.com/andreaskoch/allmark/web/orchestrator/index" - "github.com/andreaskoch/allmark/web/orchestrator/search" - "github.com/andreaskoch/allmark/web/view/viewmodel" - "github.com/andreaskoch/allmark/web/webpaths" + "github.com/elWyatt/allmark/common/config" + "github.com/elWyatt/allmark/common/logger" + "github.com/elWyatt/allmark/common/paths" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/dataaccess" + "github.com/elWyatt/allmark/model" + "github.com/elWyatt/allmark/services/converter" + "github.com/elWyatt/allmark/services/parser" + "github.com/elWyatt/allmark/web/orchestrator/index" + "github.com/elWyatt/allmark/web/orchestrator/search" + "github.com/elWyatt/allmark/web/view/viewmodel" + "github.com/elWyatt/allmark/web/webpaths" ) type UpdateType int diff --git a/web/orchestrator/search.go b/web/orchestrator/search.go index 84250825..ad490fd3 100644 --- a/web/orchestrator/search.go +++ b/web/orchestrator/search.go @@ -5,8 +5,8 @@ package orchestrator import ( - "github.com/andreaskoch/allmark/web/orchestrator/search" - "github.com/andreaskoch/allmark/web/view/viewmodel" + "github.com/elWyatt/allmark/web/orchestrator/search" + "github.com/elWyatt/allmark/web/view/viewmodel" "strings" ) diff --git a/web/orchestrator/search/fulltextindex.go b/web/orchestrator/search/fulltextindex.go index a461d66e..1a16c61e 100644 --- a/web/orchestrator/search/fulltextindex.go +++ b/web/orchestrator/search/fulltextindex.go @@ -5,9 +5,9 @@ package search import ( - "github.com/andreaskoch/allmark/common/logger" - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/model" + "github.com/elWyatt/allmark/common/logger" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/model" "github.com/andreaskoch/fulltext" "github.com/spf13/afero" "strings" diff --git a/web/orchestrator/search/searcher.go b/web/orchestrator/search/searcher.go index 7a936817..69b9ce34 100644 --- a/web/orchestrator/search/searcher.go +++ b/web/orchestrator/search/searcher.go @@ -5,9 +5,9 @@ package search import ( - "github.com/andreaskoch/allmark/common/logger" - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/model" + "github.com/elWyatt/allmark/common/logger" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/model" "strings" ) diff --git a/web/orchestrator/sitemap.go b/web/orchestrator/sitemap.go index 305f019c..1d0c1ca4 100644 --- a/web/orchestrator/sitemap.go +++ b/web/orchestrator/sitemap.go @@ -5,8 +5,8 @@ package orchestrator import ( - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/web/view/viewmodel" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/web/view/viewmodel" ) type SitemapOrchestrator struct { diff --git a/web/orchestrator/tags.go b/web/orchestrator/tags.go index 3d7c8c83..6307e7e2 100644 --- a/web/orchestrator/tags.go +++ b/web/orchestrator/tags.go @@ -5,8 +5,8 @@ package orchestrator import ( - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/web/view/viewmodel" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/web/view/viewmodel" "fmt" "math" "net/url" diff --git a/web/orchestrator/titles.go b/web/orchestrator/titles.go index a37d123b..f8749b0a 100644 --- a/web/orchestrator/titles.go +++ b/web/orchestrator/titles.go @@ -5,7 +5,7 @@ package orchestrator import ( - "github.com/andreaskoch/allmark/web/view/viewmodel" + "github.com/elWyatt/allmark/web/view/viewmodel" "strings" ) diff --git a/web/orchestrator/typeahead.go b/web/orchestrator/typeahead.go index 624b151d..8077b19c 100644 --- a/web/orchestrator/typeahead.go +++ b/web/orchestrator/typeahead.go @@ -5,8 +5,8 @@ package orchestrator import ( - "github.com/andreaskoch/allmark/web/orchestrator/search" - "github.com/andreaskoch/allmark/web/view/viewmodel" + "github.com/elWyatt/allmark/web/orchestrator/search" + "github.com/elWyatt/allmark/web/view/viewmodel" "strings" ) diff --git a/web/orchestrator/update.go b/web/orchestrator/update.go index 855881db..16561562 100644 --- a/web/orchestrator/update.go +++ b/web/orchestrator/update.go @@ -5,8 +5,8 @@ package orchestrator import ( - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/web/view/viewmodel" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/web/view/viewmodel" ) type UpdateOrchestrator struct { diff --git a/web/orchestrator/util.go b/web/orchestrator/util.go index 7bb716dc..86cc8d9c 100644 --- a/web/orchestrator/util.go +++ b/web/orchestrator/util.go @@ -9,10 +9,10 @@ import ( "strings" "time" - "github.com/andreaskoch/allmark/common/config" - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/model" - "github.com/andreaskoch/allmark/web/view/viewmodel" + "github.com/elWyatt/allmark/common/config" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/model" + "github.com/elWyatt/allmark/web/view/viewmodel" ) func getBaseModel(root, item *model.Item, config config.Config) viewmodel.Base { diff --git a/web/orchestrator/viewmodel.go b/web/orchestrator/viewmodel.go index c22cc0d0..7e067bd7 100644 --- a/web/orchestrator/viewmodel.go +++ b/web/orchestrator/viewmodel.go @@ -7,10 +7,10 @@ package orchestrator import ( "time" - "github.com/andreaskoch/allmark/common/paths" - "github.com/andreaskoch/allmark/common/route" - "github.com/andreaskoch/allmark/model" - "github.com/andreaskoch/allmark/web/view/viewmodel" + "github.com/elWyatt/allmark/common/paths" + "github.com/elWyatt/allmark/common/route" + "github.com/elWyatt/allmark/model" + "github.com/elWyatt/allmark/web/view/viewmodel" ) type ViewModelOrchestrator struct { diff --git a/web/orchestrator/viewmodelcache.go b/web/orchestrator/viewmodelcache.go index 6b9e41a5..ef66eff5 100644 --- a/web/orchestrator/viewmodelcache.go +++ b/web/orchestrator/viewmodelcache.go @@ -8,12 +8,12 @@ package orchestrator import ( - "github.com/andreaskoch/allmark/web/view/viewmodel" + "github.com/elWyatt/allmark/web/view/viewmodel" "hash/fnv" "sync" ) -var VIEWMODELCACHE_SHARD_COUNT = 32 +var VIEWMODELCACHE_SHARD_COUNT = uint(32) // A "thread" safe map of type string:viewmodel.Model. // To avoid lock bottlenecks this map is dived to several (VIEWMODELCACHE_SHARD_COUNT) map shards. @@ -26,7 +26,7 @@ type ConcurrentViewModelMapShared struct { // Creates a new concurrent viewmodel cache map. func newViewmodelCache() ViewModelCache { m := make(ViewModelCache, VIEWMODELCACHE_SHARD_COUNT) - for i := 0; i < VIEWMODELCACHE_SHARD_COUNT; i++ { + for i := uint(0); i < VIEWMODELCACHE_SHARD_COUNT; i++ { m[i] = &ConcurrentViewModelMapShared{items: make(map[string]viewmodel.Model)} } return m @@ -36,7 +36,7 @@ func newViewmodelCache() ViewModelCache { func (m ViewModelCache) GetShard(key string) *ConcurrentViewModelMapShared { hasher := fnv.New32() hasher.Write([]byte(key)) - return m[int(hasher.Sum32())%VIEWMODELCACHE_SHARD_COUNT] + return m[uint(hasher.Sum32())%VIEWMODELCACHE_SHARD_COUNT] } // Sets the given value under the specified key. @@ -63,7 +63,7 @@ func (m ViewModelCache) Get(key string) (viewmodel.Model, bool) { // Returns the number of elements within the map. func (m ViewModelCache) Count() int { count := 0 - for i := 0; i < VIEWMODELCACHE_SHARD_COUNT; i++ { + for i := uint(0); i < VIEWMODELCACHE_SHARD_COUNT; i++ { shard := m[i] shard.RLock() count += len(shard.items) diff --git a/web/orchestrator/viewmodellistcache.go b/web/orchestrator/viewmodellistcache.go index 9eddf306..62cafa49 100644 --- a/web/orchestrator/viewmodellistcache.go +++ b/web/orchestrator/viewmodellistcache.go @@ -8,12 +8,12 @@ package orchestrator import ( - "github.com/andreaskoch/allmark/web/view/viewmodel" + "github.com/elWyatt/allmark/web/view/viewmodel" "hash/fnv" "sync" ) -var VIEWMODELLISTCACHE_SHARD_COUNT = 32 +var VIEWMODELLISTCACHE_SHARD_COUNT = uint(32) // A "thread" safe map of type string:[]viewmodel.Model. // To avoid lock bottlenecks this map is dived to several (VIEWMODELLISTCACHE_SHARD_COUNT) map shards. @@ -26,7 +26,7 @@ type ConcurrentViewModelListMapShared struct { // Creates a new concurrent viewmodel cache map. func newViewModelListCache() ViewModelListCache { m := make(ViewModelListCache, VIEWMODELLISTCACHE_SHARD_COUNT) - for i := 0; i < VIEWMODELLISTCACHE_SHARD_COUNT; i++ { + for i := uint(0); i < VIEWMODELLISTCACHE_SHARD_COUNT; i++ { m[i] = &ConcurrentViewModelListMapShared{items: make(map[string][]viewmodel.Model)} } return m @@ -36,7 +36,7 @@ func newViewModelListCache() ViewModelListCache { func (m ViewModelListCache) GetShard(key string) *ConcurrentViewModelListMapShared { hasher := fnv.New32() hasher.Write([]byte(key)) - return m[int(hasher.Sum32())%VIEWMODELLISTCACHE_SHARD_COUNT] + return m[uint(hasher.Sum32())%VIEWMODELLISTCACHE_SHARD_COUNT] } // Sets the given value under the specified key. @@ -63,7 +63,7 @@ func (m ViewModelListCache) Get(key string) ([]viewmodel.Model, bool) { // Returns the number of elements within the map. func (m ViewModelListCache) Count() int { count := 0 - for i := 0; i < VIEWMODELLISTCACHE_SHARD_COUNT; i++ { + for i := uint(0); i < VIEWMODELLISTCACHE_SHARD_COUNT; i++ { shard := m[i] shard.RLock() count += len(shard.items) diff --git a/web/orchestrator/xmlsitemap.go b/web/orchestrator/xmlsitemap.go index 770466da..6f4e51d8 100644 --- a/web/orchestrator/xmlsitemap.go +++ b/web/orchestrator/xmlsitemap.go @@ -5,9 +5,9 @@ package orchestrator import ( - "github.com/andreaskoch/allmark/common/paths" - "github.com/andreaskoch/allmark/model" - "github.com/andreaskoch/allmark/web/view/viewmodel" + "github.com/elWyatt/allmark/common/paths" + "github.com/elWyatt/allmark/model" + "github.com/elWyatt/allmark/web/view/viewmodel" "fmt" "time" ) diff --git a/web/server/server.go b/web/server/server.go index 4f6017e4..2bf36cf0 100644 --- a/web/server/server.go +++ b/web/server/server.go @@ -7,18 +7,18 @@ package server import ( - "github.com/andreaskoch/allmark/common/config" - "github.com/andreaskoch/allmark/common/logger" - "github.com/andreaskoch/allmark/dataaccess" - "github.com/andreaskoch/allmark/services/converter/markdowntohtml" - "github.com/andreaskoch/allmark/services/converter/markdowntohtml/imageprovider" - "github.com/andreaskoch/allmark/services/parser" - "github.com/andreaskoch/allmark/services/thumbnail" - "github.com/andreaskoch/allmark/web/handlers" - "github.com/andreaskoch/allmark/web/header" - "github.com/andreaskoch/allmark/web/orchestrator" - "github.com/andreaskoch/allmark/web/view/templates" - "github.com/andreaskoch/allmark/web/webpaths" + "github.com/elWyatt/allmark/common/config" + "github.com/elWyatt/allmark/common/logger" + "github.com/elWyatt/allmark/dataaccess" + "github.com/elWyatt/allmark/services/converter/markdowntohtml" + "github.com/elWyatt/allmark/services/converter/markdowntohtml/imageprovider" + "github.com/elWyatt/allmark/services/parser" + "github.com/elWyatt/allmark/services/thumbnail" + "github.com/elWyatt/allmark/web/handlers" + "github.com/elWyatt/allmark/web/header" + "github.com/elWyatt/allmark/web/orchestrator" + "github.com/elWyatt/allmark/web/view/templates" + "github.com/elWyatt/allmark/web/webpaths" "fmt" "github.com/gorilla/mux" "github.com/skratchdot/open-golang/open" diff --git a/web/server/server_test.go b/web/server/server_test.go index c290bee0..5c51b546 100644 --- a/web/server/server_test.go +++ b/web/server/server_test.go @@ -5,7 +5,7 @@ package server import ( - "github.com/andreaskoch/allmark/common/config" + "github.com/elWyatt/allmark/common/config" "net" "testing" ) diff --git a/web/view/templates/defaulttheme/aliasindex.go b/web/view/templates/defaulttheme/aliasindex.go index 02e89e2c..58e5db62 100644 --- a/web/view/templates/defaulttheme/aliasindex.go +++ b/web/view/templates/defaulttheme/aliasindex.go @@ -5,7 +5,7 @@ package defaulttheme import ( - "github.com/andreaskoch/allmark/web/view/templates/templatenames" + "github.com/elWyatt/allmark/web/view/templates/templatenames" ) func init() { diff --git a/web/view/templates/defaulttheme/conversion.go b/web/view/templates/defaulttheme/conversion.go index 059c09f7..dd128693 100644 --- a/web/view/templates/defaulttheme/conversion.go +++ b/web/view/templates/defaulttheme/conversion.go @@ -5,7 +5,7 @@ package defaulttheme import ( - "github.com/andreaskoch/allmark/web/view/templates/templatenames" + "github.com/elWyatt/allmark/web/view/templates/templatenames" ) func init() { @@ -13,6 +13,7 @@ func init() { } const converterTemplate = ` + diff --git a/web/view/templates/defaulttheme/document.go b/web/view/templates/defaulttheme/document.go index 9a9a63d8..22253c4a 100644 --- a/web/view/templates/defaulttheme/document.go +++ b/web/view/templates/defaulttheme/document.go @@ -5,7 +5,7 @@ package defaulttheme import ( - "github.com/andreaskoch/allmark/web/view/templates/templatenames" + "github.com/elWyatt/allmark/web/view/templates/templatenames" ) func init() { diff --git a/web/view/templates/defaulttheme/error.go b/web/view/templates/defaulttheme/error.go index fd5b86d1..9b0de19d 100644 --- a/web/view/templates/defaulttheme/error.go +++ b/web/view/templates/defaulttheme/error.go @@ -5,7 +5,7 @@ package defaulttheme import ( - "github.com/andreaskoch/allmark/web/view/templates/templatenames" + "github.com/elWyatt/allmark/web/view/templates/templatenames" ) func init() { diff --git a/web/view/templates/defaulttheme/master.go b/web/view/templates/defaulttheme/master.go index d3eda017..a969b459 100644 --- a/web/view/templates/defaulttheme/master.go +++ b/web/view/templates/defaulttheme/master.go @@ -5,7 +5,7 @@ package defaulttheme import ( - "github.com/andreaskoch/allmark/web/view/templates/templatenames" + "github.com/elWyatt/allmark/web/view/templates/templatenames" ) func init() { @@ -129,7 +129,7 @@ const masterTemplate = `
- powered by allmark - the markdown webserver + powered by allmark - the markdown webserver
@@ -145,6 +145,22 @@ const masterTemplate = ` + + +