Skip to content

Commit

Permalink
Add metadata description (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcelMue committed Nov 15, 2020
1 parent e8ed3de commit 685e773
Show file tree
Hide file tree
Showing 37 changed files with 52 additions and 1 deletion.
2 changes: 2 additions & 0 deletions cmd/gen/fiftyfive/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/spf13/cobra"

"github.com/marcelmue/konstrukt/pkg/color"
"github.com/marcelmue/konstrukt/pkg/project"
)

type runner struct {
Expand Down Expand Up @@ -55,6 +56,7 @@ func (r *runner) run(ctx context.Context, cmd *cobra.Command, args []string) err

canvas := svg.New(f)
canvas.Start(width, height)
canvas.Desc(project.PatternDesc())
canvas.Rect(0, 0, width, height, "fill:"+c1)

// Polygon
Expand Down
2 changes: 2 additions & 0 deletions cmd/gen/interlocking/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/spf13/cobra"

"github.com/marcelmue/konstrukt/pkg/color"
"github.com/marcelmue/konstrukt/pkg/project"
)

type runner struct {
Expand Down Expand Up @@ -55,6 +56,7 @@ func (r *runner) run(ctx context.Context, cmd *cobra.Command, args []string) err

canvas := svg.New(f)
canvas.Start(width, height)
canvas.Desc(project.PatternDesc())
canvas.Rect(0, 0, width, height, "fill:"+c1)

// Polygon
Expand Down
2 changes: 2 additions & 0 deletions cmd/gen/interruptions/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/spf13/cobra"

"github.com/marcelmue/konstrukt/pkg/color"
"github.com/marcelmue/konstrukt/pkg/project"
)

type runner struct {
Expand Down Expand Up @@ -55,6 +56,7 @@ func (r *runner) run(ctx context.Context, cmd *cobra.Command, args []string) err

canvas := svg.New(f)
canvas.Start(width, height)
canvas.Desc(project.PatternDesc())

// Rectangle size offsets in each column.
ypos := []int{0, -80, -75, -5, -145, -100, -50, -10, -130, -120, -20}
Expand Down
2 changes: 2 additions & 0 deletions cmd/gen/janein/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/spf13/cobra"

"github.com/marcelmue/konstrukt/pkg/color"
"github.com/marcelmue/konstrukt/pkg/project"
)

type runner struct {
Expand Down Expand Up @@ -53,6 +54,7 @@ func (r *runner) run(ctx context.Context, cmd *cobra.Command, args []string) err

canvas := svg.New(f)
canvas.Start(width, height)
canvas.Desc(project.PatternDesc())

canvas.Def()
canvas.Gid("unit")
Expand Down
2 changes: 2 additions & 0 deletions cmd/gen/ladysweat/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/spf13/cobra"

"github.com/marcelmue/konstrukt/pkg/color"
"github.com/marcelmue/konstrukt/pkg/project"
)

type runner struct {
Expand Down Expand Up @@ -55,6 +56,7 @@ func (r *runner) run(ctx context.Context, cmd *cobra.Command, args []string) err

canvas := svg.New(f)
canvas.Start(width, height)
canvas.Desc(project.PatternDesc())
canvas.Rect(0, 0, width, height, "fill:"+c1)

// Skewed rectangle.
Expand Down
2 changes: 2 additions & 0 deletions cmd/gen/modernhive/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/spf13/cobra"

"github.com/marcelmue/konstrukt/pkg/color"
"github.com/marcelmue/konstrukt/pkg/project"
)

type runner struct {
Expand Down Expand Up @@ -54,6 +55,7 @@ func (r *runner) run(ctx context.Context, cmd *cobra.Command, args []string) err

canvas := svg.New(f)
canvas.Start(width, height)
canvas.Desc(project.PatternDesc())
canvas.Rect(0, 0, width, height, "fill:"+c1)

// Polyline.
Expand Down
2 changes: 2 additions & 0 deletions cmd/gen/quadrat/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/spf13/cobra"

"github.com/marcelmue/konstrukt/pkg/color"
"github.com/marcelmue/konstrukt/pkg/project"
)

type runner struct {
Expand Down Expand Up @@ -53,6 +54,7 @@ func (r *runner) run(ctx context.Context, cmd *cobra.Command, args []string) err

canvas := svg.New(f)
canvas.Start(width, height)
canvas.Desc(project.PatternDesc())

// Triangle 1.
xt1 := []int{0, 25, 0}
Expand Down
3 changes: 3 additions & 0 deletions cmd/gen/shining/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/spf13/cobra"

"github.com/marcelmue/konstrukt/pkg/color"
"github.com/marcelmue/konstrukt/pkg/project"
)

type runner struct {
Expand Down Expand Up @@ -59,6 +60,8 @@ func (r *runner) run(ctx context.Context, cmd *cobra.Command, args []string) err

canvas := svg.New(f)
canvas.Start(width, height)
canvas.Desc(project.PatternDesc())

canvas.Def()
canvas.Gid("unit")
canvas.Polyline(xl, yl, "fill:none")
Expand Down
2 changes: 2 additions & 0 deletions cmd/gen/swiss16/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/spf13/cobra"

"github.com/marcelmue/konstrukt/pkg/color"
"github.com/marcelmue/konstrukt/pkg/project"
)

type runner struct {
Expand Down Expand Up @@ -54,6 +55,7 @@ func (r *runner) run(ctx context.Context, cmd *cobra.Command, args []string) err

canvas := svg.New(f)
canvas.Start(width, height)
canvas.Desc(project.PatternDesc())
canvas.Rect(0, 0, width, height, "fill:"+c1)

// Polygon.
Expand Down
7 changes: 6 additions & 1 deletion pkg/project/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ var (
description = "Command line tool for generating konstruktive art."
gitSHA = "n/a"
name = "konstrukt"
patternDesc = "Generated with https://github.com/marcelmue/konstrukt"
source = "https://github.com/marcelmue/konstrukt"
version = "0.0.1"
version = "0.1.0"
)

func Description() string {
Expand All @@ -20,6 +21,10 @@ func Name() string {
return name
}

func PatternDesc() string {
return patternDesc
}

func Source() string {
return source
}
Expand Down
1 change: 1 addition & 0 deletions samples/fiftyfive-tr.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions samples/fiftyfive-wide.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions samples/fiftyfive.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions samples/interlocking-es.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions samples/interlocking-wide.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions samples/interlocking.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions samples/interruptions-br.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions samples/interruptions-wide.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions samples/interruptions.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions samples/janein-cn.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions samples/janein-wide.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions samples/janein.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions samples/ladysweat-ru.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions samples/ladysweat-wide.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions samples/ladysweat.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions samples/modernhive-in.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions samples/modernhive-wide.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions samples/modernhive.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions samples/quadrat-fr.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions samples/quadrat-wide.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions samples/quadrat.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions samples/shining-es.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions samples/shining-wide.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions samples/shining.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions samples/swiss16-ca.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions samples/swiss16-wide.svg
1 change: 1 addition & 0 deletions samples/swiss16.svg

0 comments on commit 685e773

Please sign in to comment.