From fc982125c9faf77df0be967d0265ca93ace4eba9 Mon Sep 17 00:00:00 2001 From: Niklas Fasching Date: Sun, 2 Dec 2018 16:52:27 +0100 Subject: [PATCH] Restructure directory layout: org subpackage --- Makefile | 16 ++++++++++------ cmd/org/org.go => main.go | 2 +- block.go => org/block.go | 0 document.go => org/document.go | 0 footnote.go => org/footnote.go | 0 headline.go => org/headline.go | 0 html.go => org/html.go | 0 html_test.go => org/html_test.go | 0 inline.go => org/inline.go | 0 keyword.go => org/keyword.go | 0 list.go => org/list.go | 0 org.go => org/org.go | 0 org_test.go => org/org_test.go | 0 paragraph.go => org/paragraph.go | 0 table.go => org/table.go | 0 {testdata => org/testdata}/example.html | 0 {testdata => org/testdata}/example.org | 0 17 files changed, 11 insertions(+), 7 deletions(-) rename cmd/org/org.go => main.go (96%) rename block.go => org/block.go (100%) rename document.go => org/document.go (100%) rename footnote.go => org/footnote.go (100%) rename headline.go => org/headline.go (100%) rename html.go => org/html.go (100%) rename html_test.go => org/html_test.go (100%) rename inline.go => org/inline.go (100%) rename keyword.go => org/keyword.go (100%) rename list.go => org/list.go (100%) rename org.go => org/org.go (100%) rename org_test.go => org/org_test.go (100%) rename paragraph.go => org/paragraph.go (100%) rename table.go => org/table.go (100%) rename {testdata => org/testdata}/example.html (100%) rename {testdata => org/testdata}/example.org (100%) diff --git a/Makefile b/Makefile index ba12877..6045d4f 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,17 @@ .PHONY: default default: test -.PHONY: test -test: - go test ./... -v +.PHONY: install +install: + go get ./... .PHONY: build -build: - go build cmd/org/* +build: install + go build main.go + +.PHONY: test +test: install + go test ./... -v .PHONY: setup setup: @@ -16,4 +20,4 @@ setup: case=example .PHONY: render render: - bash -c "go run cmd/org/org.go testdata/$(case).org html |& html2text" + bash -c "go run main.go org/testdata/$(case).org html |& html2text" diff --git a/cmd/org/org.go b/main.go similarity index 96% rename from cmd/org/org.go rename to main.go index 63315de..d4780e5 100644 --- a/cmd/org/org.go +++ b/main.go @@ -11,7 +11,7 @@ import ( "github.com/alecthomas/chroma/formatters/html" "github.com/alecthomas/chroma/lexers" "github.com/alecthomas/chroma/styles" - "github.com/niklasfasching/org" + "github.com/niklasfasching/go-org/org" ) func main() { diff --git a/block.go b/org/block.go similarity index 100% rename from block.go rename to org/block.go diff --git a/document.go b/org/document.go similarity index 100% rename from document.go rename to org/document.go diff --git a/footnote.go b/org/footnote.go similarity index 100% rename from footnote.go rename to org/footnote.go diff --git a/headline.go b/org/headline.go similarity index 100% rename from headline.go rename to org/headline.go diff --git a/html.go b/org/html.go similarity index 100% rename from html.go rename to org/html.go diff --git a/html_test.go b/org/html_test.go similarity index 100% rename from html_test.go rename to org/html_test.go diff --git a/inline.go b/org/inline.go similarity index 100% rename from inline.go rename to org/inline.go diff --git a/keyword.go b/org/keyword.go similarity index 100% rename from keyword.go rename to org/keyword.go diff --git a/list.go b/org/list.go similarity index 100% rename from list.go rename to org/list.go diff --git a/org.go b/org/org.go similarity index 100% rename from org.go rename to org/org.go diff --git a/org_test.go b/org/org_test.go similarity index 100% rename from org_test.go rename to org/org_test.go diff --git a/paragraph.go b/org/paragraph.go similarity index 100% rename from paragraph.go rename to org/paragraph.go diff --git a/table.go b/org/table.go similarity index 100% rename from table.go rename to org/table.go diff --git a/testdata/example.html b/org/testdata/example.html similarity index 100% rename from testdata/example.html rename to org/testdata/example.html diff --git a/testdata/example.org b/org/testdata/example.org similarity index 100% rename from testdata/example.org rename to org/testdata/example.org