diff --git a/.gitignore b/.gitignore index f6c18f3c..d2f37314 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ /mark /docker -/testdata .idea/ /mark.test /profile.cov diff --git a/pkg/mark/attachment/attachment.go b/attachment/attachment.go similarity index 98% rename from pkg/mark/attachment/attachment.go rename to attachment/attachment.go index fbda8515..0d1344d7 100644 --- a/pkg/mark/attachment/attachment.go +++ b/attachment/attachment.go @@ -11,8 +11,8 @@ import ( "sort" "strings" - "github.com/kovetskiy/mark/pkg/confluence" - "github.com/kovetskiy/mark/pkg/mark/vfs" + "github.com/kovetskiy/mark/confluence" + "github.com/kovetskiy/mark/vfs" "github.com/reconquest/karma-go" "github.com/reconquest/pkg/log" ) diff --git a/pkg/mark/attachment/attachment_test.go b/attachment/attachment_test.go similarity index 100% rename from pkg/mark/attachment/attachment_test.go rename to attachment/attachment_test.go diff --git a/pkg/confluence/api.go b/confluence/api.go similarity index 100% rename from pkg/confluence/api.go rename to confluence/api.go diff --git a/pkg/mark/includes/templates.go b/includes/templates.go similarity index 100% rename from pkg/mark/includes/templates.go rename to includes/templates.go diff --git a/pkg/mark/macro/macro.go b/macro/macro.go similarity index 98% rename from pkg/mark/macro/macro.go rename to macro/macro.go index 34f82331..b2167f29 100644 --- a/pkg/mark/macro/macro.go +++ b/macro/macro.go @@ -7,7 +7,7 @@ import ( "strings" "text/template" - "github.com/kovetskiy/mark/pkg/mark/includes" + "github.com/kovetskiy/mark/includes" "github.com/reconquest/karma-go" "github.com/reconquest/pkg/log" "github.com/reconquest/regexputil-go" diff --git a/main.go b/main.go index e9c77a24..ec70bc77 100644 --- a/main.go +++ b/main.go @@ -11,13 +11,15 @@ import ( "github.com/bmatcuk/doublestar/v4" "github.com/kovetskiy/lorg" - "github.com/kovetskiy/mark/pkg/confluence" - "github.com/kovetskiy/mark/pkg/mark" - "github.com/kovetskiy/mark/pkg/mark/attachment" - "github.com/kovetskiy/mark/pkg/mark/includes" - "github.com/kovetskiy/mark/pkg/mark/macro" - "github.com/kovetskiy/mark/pkg/mark/stdlib" - "github.com/kovetskiy/mark/pkg/mark/vfs" + "github.com/kovetskiy/mark/attachment" + "github.com/kovetskiy/mark/confluence" + "github.com/kovetskiy/mark/includes" + "github.com/kovetskiy/mark/macro" + mark "github.com/kovetskiy/mark/markdown" + "github.com/kovetskiy/mark/metadata" + "github.com/kovetskiy/mark/page" + "github.com/kovetskiy/mark/stdlib" + "github.com/kovetskiy/mark/vfs" "github.com/reconquest/karma-go" "github.com/reconquest/pkg/log" "github.com/urfave/cli/v2" @@ -307,7 +309,7 @@ func processFile( parents := strings.Split(cCtx.String("parents"), cCtx.String("parents-delimiter")) - meta, markdown, err := mark.ExtractMeta(markdown, cCtx.String("space"), cCtx.Bool("title-from-h1"), parents) + meta, markdown, err := metadata.ExtractMeta(markdown, cCtx.String("space"), cCtx.Bool("title-from-h1"), parents) if err != nil { log.Fatal(err) } @@ -386,15 +388,15 @@ func processFile( } } - links, err := mark.ResolveRelativeLinks(api, meta, markdown, filepath.Dir(file), cCtx.String("space"), cCtx.Bool("title-from-h1"), parents) + links, err := page.ResolveRelativeLinks(api, meta, markdown, filepath.Dir(file), cCtx.String("space"), cCtx.Bool("title-from-h1"), parents) if err != nil { log.Fatalf(err, "unable to resolve relative links") } - markdown = mark.SubstituteLinks(markdown, links) + markdown = page.SubstituteLinks(markdown, links) if cCtx.Bool("dry-run") { - _, _, err := mark.ResolvePage(cCtx.Bool("dry-run"), api, meta) + _, _, err := page.ResolvePage(cCtx.Bool("dry-run"), api, meta) if err != nil { log.Fatalf(err, "unable to resolve page location") } @@ -415,7 +417,7 @@ func processFile( var target *confluence.PageInfo if meta != nil { - parent, page, err := mark.ResolvePage(cCtx.Bool("dry-run"), api, meta) + parent, page, err := page.ResolvePage(cCtx.Bool("dry-run"), api, meta) if err != nil { log.Fatalf( karma.Describe("title", meta.Title).Reason(err), @@ -542,7 +544,7 @@ func processFile( return target } -func updateLabels(api *confluence.API, target *confluence.PageInfo, meta *mark.Meta) { +func updateLabels(api *confluence.API, target *confluence.PageInfo, meta *metadata.Meta) { labelInfo, err := api.GetPageLabels(target, "global") if err != nil { @@ -579,7 +581,7 @@ func updateLabels(api *confluence.API, target *confluence.PageInfo, meta *mark.M } // Page has label but label not in Metadata -func determineLabelsToRemove(labelInfo *confluence.LabelInfo, meta *mark.Meta) []string { +func determineLabelsToRemove(labelInfo *confluence.LabelInfo, meta *metadata.Meta) []string { var labels []string for _, label := range labelInfo.Labels { if !slices.ContainsFunc(meta.Labels, func(metaLabel string) bool { @@ -592,7 +594,7 @@ func determineLabelsToRemove(labelInfo *confluence.LabelInfo, meta *mark.Meta) [ } // Metadata has label but Page does not have it -func determineLabelsToAdd(meta *mark.Meta, labelInfo *confluence.LabelInfo) []string { +func determineLabelsToAdd(meta *metadata.Meta, labelInfo *confluence.LabelInfo) []string { var labels []string for _, metaLabel := range meta.Labels { if !slices.ContainsFunc(labelInfo.Labels, func(label confluence.Label) bool { diff --git a/pkg/mark/markdown.go b/markdown/markdown.go similarity index 87% rename from pkg/mark/markdown.go rename to markdown/markdown.go index b1c58cd2..26f8297d 100644 --- a/pkg/mark/markdown.go +++ b/markdown/markdown.go @@ -2,12 +2,11 @@ package mark import ( "bytes" - "regexp" - "github.com/kovetskiy/mark/pkg/mark/attachment" - cparser "github.com/kovetskiy/mark/pkg/mark/parser" - crenderer "github.com/kovetskiy/mark/pkg/mark/renderer" - "github.com/kovetskiy/mark/pkg/mark/stdlib" + "github.com/kovetskiy/mark/attachment" + cparser "github.com/kovetskiy/mark/parser" + crenderer "github.com/kovetskiy/mark/renderer" + "github.com/kovetskiy/mark/stdlib" "github.com/reconquest/pkg/log" "github.com/yuin/goldmark" @@ -104,16 +103,4 @@ func CompileMarkdown(markdown []byte, stdlib *stdlib.Lib, path string, mermaidPr log.Tracef(nil, "rendered markdown to html:\n%s", string(html)) return string(html), confluenceExtension.Attachments - -} - -// ExtractDocumentLeadingH1 will extract leading H1 heading -func ExtractDocumentLeadingH1(markdown []byte) string { - h1 := regexp.MustCompile(`#[^#]\s*(.*)\s*\n`) - groups := h1.FindSubmatch(markdown) - if groups == nil { - return "" - } else { - return string(groups[1]) - } } diff --git a/pkg/mark/markdown_test.go b/markdown/markdown_test.go similarity index 82% rename from pkg/mark/markdown_test.go rename to markdown/markdown_test.go index eaf18cd9..24780840 100644 --- a/pkg/mark/markdown_test.go +++ b/markdown/markdown_test.go @@ -2,11 +2,13 @@ package mark import ( "os" + "path" "path/filepath" + "runtime" "strings" "testing" - "github.com/kovetskiy/mark/pkg/mark/stdlib" + "github.com/kovetskiy/mark/stdlib" "github.com/stretchr/testify/assert" ) @@ -29,6 +31,13 @@ func loadData(t *testing.T, filename, variant string) ([]byte, string, []byte) { } func TestCompileMarkdown(t *testing.T) { + _, filename, _, _ := runtime.Caller(0) + dir := path.Join(path.Dir(filename), "..") + err := os.Chdir(dir) + if err != nil { + panic(err) + } + test := assert.New(t) testcases, err := filepath.Glob("testdata/*.md") @@ -48,6 +57,13 @@ func TestCompileMarkdown(t *testing.T) { } func TestCompileMarkdownDropH1(t *testing.T) { + _, filename, _, _ := runtime.Caller(0) + dir := path.Join(path.Dir(filename), "..") + err := os.Chdir(dir) + if err != nil { + panic(err) + } + test := assert.New(t) testcases, err := filepath.Glob("testdata/*.md") @@ -67,6 +83,13 @@ func TestCompileMarkdownDropH1(t *testing.T) { } func TestCompileMarkdownStripNewlines(t *testing.T) { + _, filename, _, _ := runtime.Caller(0) + dir := path.Join(path.Dir(filename), "..") + err := os.Chdir(dir) + if err != nil { + panic(err) + } + test := assert.New(t) testcases, err := filepath.Glob("testdata/*.md") @@ -84,16 +107,3 @@ func TestCompileMarkdownStripNewlines(t *testing.T) { test.EqualValues(string(html), actual, filename+" vs "+htmlname) } } - -func TestExtractDocumentLeadingH1(t *testing.T) { - filename := "testdata/header.md" - - markdown, err := os.ReadFile(filename) - if err != nil { - panic(err) - } - - actual := ExtractDocumentLeadingH1(markdown) - - assert.Equal(t, "a", actual) -} diff --git a/pkg/mark/mermaid/mermaid.go b/mermaid/mermaid.go similarity index 96% rename from pkg/mark/mermaid/mermaid.go rename to mermaid/mermaid.go index 18c946e0..3096db04 100644 --- a/pkg/mark/mermaid/mermaid.go +++ b/mermaid/mermaid.go @@ -7,7 +7,7 @@ import ( "time" mermaid "github.com/dreampuf/mermaid.go" - "github.com/kovetskiy/mark/pkg/mark/attachment" + "github.com/kovetskiy/mark/attachment" "github.com/reconquest/pkg/log" ) diff --git a/pkg/mark/mermaid/mermaid_test.go b/mermaid/mermaid_test.go similarity index 97% rename from pkg/mark/mermaid/mermaid_test.go rename to mermaid/mermaid_test.go index 0d34a37a..129d7d22 100644 --- a/pkg/mark/mermaid/mermaid_test.go +++ b/mermaid/mermaid_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/kovetskiy/mark/pkg/mark/attachment" + "github.com/kovetskiy/mark/attachment" "github.com/stretchr/testify/assert" ) diff --git a/pkg/mark/meta.go b/metadata/metadata.go similarity index 92% rename from pkg/mark/meta.go rename to metadata/metadata.go index b76c743d..0365f994 100644 --- a/pkg/mark/meta.go +++ b/metadata/metadata.go @@ -1,4 +1,4 @@ -package mark +package metadata import ( "bufio" @@ -166,3 +166,14 @@ func ExtractMeta(data []byte, spaceFromCli string, titleFromH1 bool, parents []s return meta, data[offset:], nil } + +// ExtractDocumentLeadingH1 will extract leading H1 heading +func ExtractDocumentLeadingH1(markdown []byte) string { + h1 := regexp.MustCompile(`#[^#]\s*(.*)\s*\n`) + groups := h1.FindSubmatch(markdown) + if groups == nil { + return "" + } else { + return string(groups[1]) + } +} diff --git a/metadata/metadata_test.go b/metadata/metadata_test.go new file mode 100644 index 00000000..6249553e --- /dev/null +++ b/metadata/metadata_test.go @@ -0,0 +1,30 @@ +package metadata + +import ( + "os" + "path" + "runtime" + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestExtractDocumentLeadingH1(t *testing.T) { + _, filename, _, _ := runtime.Caller(0) + dir := path.Join(path.Dir(filename), "..") + err := os.Chdir(dir) + if err != nil { + panic(err) + } + + filename = "testdata/header.md" + + markdown, err := os.ReadFile(filename) + if err != nil { + panic(err) + } + + actual := ExtractDocumentLeadingH1(markdown) + + assert.Equal(t, "a", actual) +} diff --git a/pkg/mark/ancestry.go b/page/ancestry.go similarity index 98% rename from pkg/mark/ancestry.go rename to page/ancestry.go index 0c90c58b..523fc501 100644 --- a/pkg/mark/ancestry.go +++ b/page/ancestry.go @@ -1,10 +1,10 @@ -package mark +package page import ( "fmt" "strings" - "github.com/kovetskiy/mark/pkg/confluence" + "github.com/kovetskiy/mark/confluence" "github.com/reconquest/karma-go" "github.com/reconquest/pkg/log" ) diff --git a/pkg/mark/link.go b/page/link.go similarity index 95% rename from pkg/mark/link.go rename to page/link.go index 3cc5ddb7..2ce740a7 100644 --- a/pkg/mark/link.go +++ b/page/link.go @@ -1,4 +1,4 @@ -package mark +package page import ( "bytes" @@ -8,7 +8,8 @@ import ( "path/filepath" "regexp" - "github.com/kovetskiy/mark/pkg/confluence" + "github.com/kovetskiy/mark/confluence" + "github.com/kovetskiy/mark/metadata" "github.com/reconquest/karma-go" "github.com/reconquest/pkg/log" "golang.org/x/tools/godoc/util" @@ -27,7 +28,7 @@ type markdownLink struct { func ResolveRelativeLinks( api *confluence.API, - meta *Meta, + meta *metadata.Meta, markdown []byte, base string, spaceFromCli string, @@ -104,7 +105,7 @@ func resolveLink( // This helps to determine if found link points to file that's // not markdown or have mark required metadata - linkMeta, _, err := ExtractMeta(linkContents, spaceFromCli, titleFromH1, parents) + linkMeta, _, err := metadata.ExtractMeta(linkContents, spaceFromCli, titleFromH1, parents) if err != nil { log.Errorf( err, diff --git a/pkg/mark/link_test.go b/page/link_test.go similarity index 99% rename from pkg/mark/link_test.go rename to page/link_test.go index 7b790787..3f94ddf8 100644 --- a/pkg/mark/link_test.go +++ b/page/link_test.go @@ -1,4 +1,4 @@ -package mark +package page import ( "testing" diff --git a/pkg/mark/mark.go b/page/page.go similarity index 94% rename from pkg/mark/mark.go rename to page/page.go index ba4497aa..0cfff394 100644 --- a/pkg/mark/mark.go +++ b/page/page.go @@ -1,9 +1,10 @@ -package mark +package page import ( "strings" - "github.com/kovetskiy/mark/pkg/confluence" + "github.com/kovetskiy/mark/confluence" + "github.com/kovetskiy/mark/metadata" "github.com/reconquest/karma-go" "github.com/reconquest/pkg/log" ) @@ -11,7 +12,7 @@ import ( func ResolvePage( dryRun bool, api *confluence.API, - meta *Meta, + meta *metadata.Meta, ) (*confluence.PageInfo, *confluence.PageInfo, error) { page, err := api.FindPage(meta.Space, meta.Title, meta.Type) if err != nil { diff --git a/pkg/mark/parser/confluencetags.go b/parser/confluencetags.go similarity index 100% rename from pkg/mark/parser/confluencetags.go rename to parser/confluencetags.go diff --git a/pkg/mark/renderer/blockquote.go b/renderer/blockquote.go similarity index 100% rename from pkg/mark/renderer/blockquote.go rename to renderer/blockquote.go diff --git a/pkg/mark/renderer/codeblock.go b/renderer/codeblock.go similarity index 97% rename from pkg/mark/renderer/codeblock.go rename to renderer/codeblock.go index 99b02d61..5bddc03c 100644 --- a/pkg/mark/renderer/codeblock.go +++ b/renderer/codeblock.go @@ -3,7 +3,7 @@ package renderer import ( "strings" - "github.com/kovetskiy/mark/pkg/mark/stdlib" + "github.com/kovetskiy/mark/stdlib" "github.com/yuin/goldmark/ast" "github.com/yuin/goldmark/renderer" diff --git a/pkg/mark/renderer/fencedcodeblock.go b/renderer/fencedcodeblock.go similarity index 96% rename from pkg/mark/renderer/fencedcodeblock.go rename to renderer/fencedcodeblock.go index 5e36bd34..50d5285d 100644 --- a/pkg/mark/renderer/fencedcodeblock.go +++ b/renderer/fencedcodeblock.go @@ -5,9 +5,9 @@ import ( "regexp" "strings" - "github.com/kovetskiy/mark/pkg/mark/attachment" - "github.com/kovetskiy/mark/pkg/mark/mermaid" - "github.com/kovetskiy/mark/pkg/mark/stdlib" + "github.com/kovetskiy/mark/attachment" + "github.com/kovetskiy/mark/mermaid" + "github.com/kovetskiy/mark/stdlib" "github.com/reconquest/pkg/log" "github.com/yuin/goldmark/ast" diff --git a/pkg/mark/renderer/heading.go b/renderer/heading.go similarity index 100% rename from pkg/mark/renderer/heading.go rename to renderer/heading.go diff --git a/pkg/mark/renderer/htmlblock.go b/renderer/htmlblock.go similarity index 98% rename from pkg/mark/renderer/htmlblock.go rename to renderer/htmlblock.go index b8d9d1a3..5214be59 100644 --- a/pkg/mark/renderer/htmlblock.go +++ b/renderer/htmlblock.go @@ -3,7 +3,7 @@ package renderer import ( "strings" - "github.com/kovetskiy/mark/pkg/mark/stdlib" + "github.com/kovetskiy/mark/stdlib" "github.com/yuin/goldmark/ast" "github.com/yuin/goldmark/renderer" diff --git a/pkg/mark/renderer/image.go b/renderer/image.go similarity index 95% rename from pkg/mark/renderer/image.go rename to renderer/image.go index 309f3f0c..c76d9fe0 100644 --- a/pkg/mark/renderer/image.go +++ b/renderer/image.go @@ -5,9 +5,9 @@ import ( "path/filepath" "strings" - "github.com/kovetskiy/mark/pkg/mark/attachment" - "github.com/kovetskiy/mark/pkg/mark/stdlib" - "github.com/kovetskiy/mark/pkg/mark/vfs" + "github.com/kovetskiy/mark/attachment" + "github.com/kovetskiy/mark/stdlib" + "github.com/kovetskiy/mark/vfs" "github.com/yuin/goldmark/ast" "github.com/yuin/goldmark/renderer" diff --git a/pkg/mark/renderer/link.go b/renderer/link.go similarity index 100% rename from pkg/mark/renderer/link.go rename to renderer/link.go diff --git a/pkg/mark/renderer/paragraph.go b/renderer/paragraph.go similarity index 100% rename from pkg/mark/renderer/paragraph.go rename to renderer/paragraph.go diff --git a/pkg/mark/renderer/text.go b/renderer/text.go similarity index 100% rename from pkg/mark/renderer/text.go rename to renderer/text.go diff --git a/pkg/mark/stdlib/stdlib.go b/stdlib/stdlib.go similarity index 99% rename from pkg/mark/stdlib/stdlib.go rename to stdlib/stdlib.go index 55ec26f5..6986f1c6 100644 --- a/pkg/mark/stdlib/stdlib.go +++ b/stdlib/stdlib.go @@ -4,8 +4,8 @@ import ( "strings" "text/template" - "github.com/kovetskiy/mark/pkg/confluence" - "github.com/kovetskiy/mark/pkg/mark/macro" + "github.com/kovetskiy/mark/confluence" + "github.com/kovetskiy/mark/macro" "github.com/reconquest/pkg/log" "github.com/reconquest/karma-go" diff --git a/pkg/mark/testdata/codes-droph1.html b/testdata/codes-droph1.html similarity index 100% rename from pkg/mark/testdata/codes-droph1.html rename to testdata/codes-droph1.html diff --git a/pkg/mark/testdata/codes-stripnewlines.html b/testdata/codes-stripnewlines.html similarity index 100% rename from pkg/mark/testdata/codes-stripnewlines.html rename to testdata/codes-stripnewlines.html diff --git a/pkg/mark/testdata/codes.html b/testdata/codes.html similarity index 100% rename from pkg/mark/testdata/codes.html rename to testdata/codes.html diff --git a/pkg/mark/testdata/codes.md b/testdata/codes.md similarity index 100% rename from pkg/mark/testdata/codes.md rename to testdata/codes.md diff --git a/pkg/mark/testdata/header-droph1.html b/testdata/header-droph1.html similarity index 100% rename from pkg/mark/testdata/header-droph1.html rename to testdata/header-droph1.html diff --git a/pkg/mark/testdata/header-stripnewlines.html b/testdata/header-stripnewlines.html similarity index 100% rename from pkg/mark/testdata/header-stripnewlines.html rename to testdata/header-stripnewlines.html diff --git a/pkg/mark/testdata/header.html b/testdata/header.html similarity index 100% rename from pkg/mark/testdata/header.html rename to testdata/header.html diff --git a/pkg/mark/testdata/header.md b/testdata/header.md similarity index 100% rename from pkg/mark/testdata/header.md rename to testdata/header.md diff --git a/pkg/mark/testdata/issue-64-broken-link-droph1.html b/testdata/issue-64-broken-link-droph1.html similarity index 100% rename from pkg/mark/testdata/issue-64-broken-link-droph1.html rename to testdata/issue-64-broken-link-droph1.html diff --git a/pkg/mark/testdata/issue-64-broken-link-stripnewlines.html b/testdata/issue-64-broken-link-stripnewlines.html similarity index 100% rename from pkg/mark/testdata/issue-64-broken-link-stripnewlines.html rename to testdata/issue-64-broken-link-stripnewlines.html diff --git a/pkg/mark/testdata/issue-64-broken-link.html b/testdata/issue-64-broken-link.html similarity index 100% rename from pkg/mark/testdata/issue-64-broken-link.html rename to testdata/issue-64-broken-link.html diff --git a/pkg/mark/testdata/issue-64-broken-link.md b/testdata/issue-64-broken-link.md similarity index 100% rename from pkg/mark/testdata/issue-64-broken-link.md rename to testdata/issue-64-broken-link.md diff --git a/pkg/mark/testdata/links-droph1.html b/testdata/links-droph1.html similarity index 100% rename from pkg/mark/testdata/links-droph1.html rename to testdata/links-droph1.html diff --git a/pkg/mark/testdata/links-stripnewlines.html b/testdata/links-stripnewlines.html similarity index 100% rename from pkg/mark/testdata/links-stripnewlines.html rename to testdata/links-stripnewlines.html diff --git a/pkg/mark/testdata/links.html b/testdata/links.html similarity index 100% rename from pkg/mark/testdata/links.html rename to testdata/links.html diff --git a/pkg/mark/testdata/links.md b/testdata/links.md similarity index 100% rename from pkg/mark/testdata/links.md rename to testdata/links.md diff --git a/pkg/mark/testdata/lists-droph1.html b/testdata/lists-droph1.html similarity index 100% rename from pkg/mark/testdata/lists-droph1.html rename to testdata/lists-droph1.html diff --git a/pkg/mark/testdata/lists-stripnewlines.html b/testdata/lists-stripnewlines.html similarity index 100% rename from pkg/mark/testdata/lists-stripnewlines.html rename to testdata/lists-stripnewlines.html diff --git a/pkg/mark/testdata/lists.html b/testdata/lists.html similarity index 100% rename from pkg/mark/testdata/lists.html rename to testdata/lists.html diff --git a/pkg/mark/testdata/lists.md b/testdata/lists.md similarity index 100% rename from pkg/mark/testdata/lists.md rename to testdata/lists.md diff --git a/pkg/mark/testdata/macro-include-droph1.html b/testdata/macro-include-droph1.html similarity index 100% rename from pkg/mark/testdata/macro-include-droph1.html rename to testdata/macro-include-droph1.html diff --git a/pkg/mark/testdata/macro-include-stripnewlines.html b/testdata/macro-include-stripnewlines.html similarity index 100% rename from pkg/mark/testdata/macro-include-stripnewlines.html rename to testdata/macro-include-stripnewlines.html diff --git a/pkg/mark/testdata/macro-include.html b/testdata/macro-include.html similarity index 100% rename from pkg/mark/testdata/macro-include.html rename to testdata/macro-include.html diff --git a/pkg/mark/testdata/macro-include.md b/testdata/macro-include.md similarity index 100% rename from pkg/mark/testdata/macro-include.md rename to testdata/macro-include.md diff --git a/pkg/mark/testdata/newlines-droph1.html b/testdata/newlines-droph1.html similarity index 100% rename from pkg/mark/testdata/newlines-droph1.html rename to testdata/newlines-droph1.html diff --git a/pkg/mark/testdata/newlines-stripnewlines.html b/testdata/newlines-stripnewlines.html similarity index 100% rename from pkg/mark/testdata/newlines-stripnewlines.html rename to testdata/newlines-stripnewlines.html diff --git a/pkg/mark/testdata/newlines.html b/testdata/newlines.html similarity index 100% rename from pkg/mark/testdata/newlines.html rename to testdata/newlines.html diff --git a/pkg/mark/testdata/newlines.md b/testdata/newlines.md similarity index 100% rename from pkg/mark/testdata/newlines.md rename to testdata/newlines.md diff --git a/pkg/mark/testdata/pagelayout-droph1.html b/testdata/pagelayout-droph1.html similarity index 100% rename from pkg/mark/testdata/pagelayout-droph1.html rename to testdata/pagelayout-droph1.html diff --git a/pkg/mark/testdata/pagelayout-stripnewlines.html b/testdata/pagelayout-stripnewlines.html similarity index 100% rename from pkg/mark/testdata/pagelayout-stripnewlines.html rename to testdata/pagelayout-stripnewlines.html diff --git a/pkg/mark/testdata/pagelayout.html b/testdata/pagelayout.html similarity index 100% rename from pkg/mark/testdata/pagelayout.html rename to testdata/pagelayout.html diff --git a/pkg/mark/testdata/pagelayout.md b/testdata/pagelayout.md similarity index 100% rename from pkg/mark/testdata/pagelayout.md rename to testdata/pagelayout.md diff --git a/pkg/mark/testdata/quotes-droph1.html b/testdata/quotes-droph1.html similarity index 100% rename from pkg/mark/testdata/quotes-droph1.html rename to testdata/quotes-droph1.html diff --git a/pkg/mark/testdata/quotes-stripnewlines.html b/testdata/quotes-stripnewlines.html similarity index 100% rename from pkg/mark/testdata/quotes-stripnewlines.html rename to testdata/quotes-stripnewlines.html diff --git a/pkg/mark/testdata/quotes.html b/testdata/quotes.html similarity index 100% rename from pkg/mark/testdata/quotes.html rename to testdata/quotes.html diff --git a/pkg/mark/testdata/quotes.md b/testdata/quotes.md similarity index 100% rename from pkg/mark/testdata/quotes.md rename to testdata/quotes.md diff --git a/pkg/mark/testdata/table-droph1.html b/testdata/table-droph1.html similarity index 100% rename from pkg/mark/testdata/table-droph1.html rename to testdata/table-droph1.html diff --git a/pkg/mark/testdata/table-stripnewlines.html b/testdata/table-stripnewlines.html similarity index 100% rename from pkg/mark/testdata/table-stripnewlines.html rename to testdata/table-stripnewlines.html diff --git a/pkg/mark/testdata/table.html b/testdata/table.html similarity index 100% rename from pkg/mark/testdata/table.html rename to testdata/table.html diff --git a/pkg/mark/testdata/table.md b/testdata/table.md similarity index 100% rename from pkg/mark/testdata/table.md rename to testdata/table.md diff --git a/pkg/mark/testdata/tags-droph1.html b/testdata/tags-droph1.html similarity index 100% rename from pkg/mark/testdata/tags-droph1.html rename to testdata/tags-droph1.html diff --git a/pkg/mark/testdata/tags-stripnewlines.html b/testdata/tags-stripnewlines.html similarity index 100% rename from pkg/mark/testdata/tags-stripnewlines.html rename to testdata/tags-stripnewlines.html diff --git a/pkg/mark/testdata/tags.html b/testdata/tags.html similarity index 100% rename from pkg/mark/testdata/tags.html rename to testdata/tags.html diff --git a/pkg/mark/testdata/tags.md b/testdata/tags.md similarity index 100% rename from pkg/mark/testdata/tags.md rename to testdata/tags.md diff --git a/pkg/mark/testdata/test.png b/testdata/test.png similarity index 100% rename from pkg/mark/testdata/test.png rename to testdata/test.png diff --git a/pkg/mark/vfs/vfs.go b/vfs/vfs.go similarity index 100% rename from pkg/mark/vfs/vfs.go rename to vfs/vfs.go