Skip to content

djcrock/periodize

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Periodize

GoDoc Reference Build Status Go Report Card

Go library to generate periodical .mobi files.

Dependencies

Periodize requires that the kindlegen executable be available in PATH.

Usage

package main

import (
	"os"

	"github.com/djcrock/periodize"
)

func main() {
	iss := periodize.Issue{
		UniqueID:    "123",
		Title:       "My Periodical",
		Creator:     "djcrock",
		Publisher:   "djcrock",
		Subject:     "eBook Publishing",
		Description: "Demonstration of periodical publishing",
		Date:        "2017-10-21",
		Sections: []periodize.Section{
			{
				Title: "Section 1",
				Articles: []periodize.Article{
					{
						Title:   "Article 1-1",
						Author:  "djcrock",
						Content: "<body>Content 1</body>",
					},
				},
			},
			{
				Title: "Section 2",
				Articles: []periodize.Article{
					{
						Title:   "Article 2-1",
						Author:  "djcrock",
						Content: "<body>Content 2</body>",
					},
					{
						Title:   "Article 2-2",
						Author:  "djcrock",
						Content: "<body>Content 3</body>",
					},
				},
			},
		},
	}

	mobi, _ := os.Create("my_periodical.mobi")
	defer mobi.Close()

	// GenerateMobi accepts any io.Writer
	iss.GenerateMobi(mobi)
}

About

Go library to generate periodical .mobi files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published