From 78de7ed98abff93fe5fef94907bcfa4f76dcef07 Mon Sep 17 00:00:00 2001 From: Steve Manuel Date: Sat, 27 May 2017 10:27:51 -0700 Subject: adding docs to repo --- docs/build/Interfaces/Format/index.html | 986 ++++++++++++++++++++++++++++++++ 1 file changed, 986 insertions(+) create mode 100644 docs/build/Interfaces/Format/index.html (limited to 'docs/build/Interfaces/Format') diff --git a/docs/build/Interfaces/Format/index.html b/docs/build/Interfaces/Format/index.html new file mode 100644 index 0000000..d85bd14 --- /dev/null +++ b/docs/build/Interfaces/Format/index.html @@ -0,0 +1,986 @@ + + + + + + + + + + + + + + + + + + Format Package Interfaces + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + +
+
+ + +
+
+
+ +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+ + + +

Format

+ +

Ponzu provides a set of interfaces from the management/format package which +determine how content data should be converted and formatted for exporting via +the Admin interface.

+
+

Interfaces

+

format.CSVFormattable

+

CSVFormattable controls if an "Export" button is added to the contents view for +a Content type in the CMS to export the data to CSV. If it is implemented, a +button will be present beneath the "New" button per Content type.

+
Method Set
+
type CSVFormattable interface {
+    FormatCSV() []string
+}
+
+ + +
Implementation
+
func (p *Post) FormatCSV() []string {
+    // []string contains the JSON struct tags generated for your Content type 
+    // implementing the interface
+    return []string{
+        "id",
+        "timestamp",
+        "slug",
+        "title",
+        "photos",
+        "body",
+        "written_by",
+    }
+}
+
+ + +
+

FormatCSV() []string

+

Just like other Ponzu content extension interfaces, like Push(), you will +return the JSON struct tags for the fields you want exported to the CSV file. +These will also be the "header" row in the CSV file to give titles to the file +columns. Keep in mind that all of item.Item's fields are available here as well.

+
+ + + + + + + +
+
+
+
+ + + + +
+ + + + + + + + + + + + \ No newline at end of file -- cgit v1.2.3