summaryrefslogtreecommitdiffstats
path: root/output/outputFormat.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-04-02 14:20:34 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-04-02 14:20:34 +0200
commit7eb71ee06419f9ceedfd701ab2a27513ef448829 (patch)
tree254ba6c75575e067df76b4abe4e566936619adcb /output/outputFormat.go
parentc97dae40d9cd24c467f5b8cfbe2ac06f3cdef1d2 (diff)
Revert "tpl: Rework to handle both text and HTML templates"
Will have to take another stab at this ... This reverts commit 5c5efa03d2512749950b0d05a7d4bde35ecbdc37. Closes #3260
Diffstat (limited to 'output/outputFormat.go')
-rw-r--r--output/outputFormat.go40
1 files changed, 0 insertions, 40 deletions
diff --git a/output/outputFormat.go b/output/outputFormat.go
index 9d43b135a..76329a936 100644
--- a/output/outputFormat.go
+++ b/output/outputFormat.go
@@ -33,7 +33,6 @@ var (
IsHTML: true,
}
- // CalendarFormat is AAA
CalendarFormat = Format{
Name: "Calendar",
MediaType: media.CalendarType,
@@ -105,45 +104,6 @@ func (formats Formats) GetByName(name string) (f Format, found bool) {
return
}
-func (formats Formats) GetBySuffix(name string) (f Format, found bool) {
- for _, ff := range formats {
- if name == ff.MediaType.Suffix {
- if found {
- // ambiguous
- found = false
- return
- }
- f = ff
- found = true
- }
- }
- return
-}
-
-func (formats Formats) FromFilename(filename string) (f Format, found bool) {
- // mytemplate.amp.html
- // mytemplate.html
- // mytemplate
- var ext, outFormat string
-
- parts := strings.Split(filename, ".")
- if len(parts) > 2 {
- outFormat = parts[1]
- ext = parts[2]
- } else if len(parts) > 1 {
- ext = parts[1]
- }
-
- if outFormat != "" {
- return formats.GetByName(outFormat)
- }
-
- if ext != "" {
- return formats.GetBySuffix(ext)
- }
- return
-}
-
// Format represents an output representation, usually to a file on disk.
type Format struct {
// The Name is used as an identifier. Internal output formats (i.e. HTML and RSS)