Skip to content

fmartingr/go-comicinfo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-comicinfo

Go Reference Go Report Card codecov License: MIT

Golang implementation of the ComicInfo.xml specification to read and write comicinfo.xml files.

Contributing

Contributions are welcome, please open an issue or a pull request.

Versioning

This project uses Semantic Versioning and will follow the major and minor versions of the ComicInfo.xml specification, while using the hotfix version for any changes to the library itself.

Usage example

package main

import "github.com/fmartingr/go-comicinfo/v2"

func main() {
	ci := comicinfo.NewComicInfo()
	ci.Series = "One Piece"
	ci.Number = "3093"
	ci.Summary = "Luffy and the Straw Hat Pirates return in an all-new Epic Voyage!"
	ci.AgeRating = comicinfo.AgeRatingEveryone
	ci.LanguageISO = "en"

	for i := 1; i <= 17; i++ {
		ci.Pages.Pages = append(ci.Pages.Pages, comicinfo.ComicPageInfo{
			Image: i,
		})
	}

	_ = comicinfo.Write(ci, "volume/comicinfo.xml")
}

Result

<?xml version="1.0" encoding="UTF-8"?>
<ComicInfo xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Series>One Piece</Series>
    <Number>3093</Number>
    <Summary>Luffy and the Straw Hat Pirates return in an all-new Epic Voyage!</Summary>
    <LanguageISO>en</LanguageISO>
    <AgeRating>Everyone</AgeRating>
    <Pages>
        <Page Image="1"></Page>
        <Page Image="2"></Page>
        <Page Image="3"></Page>
        <Page Image="4"></Page>
        <Page Image="5"></Page>
        <Page Image="6"></Page>
        <Page Image="7"></Page>
        <Page Image="8"></Page>
        <Page Image="9"></Page>
        <Page Image="10"></Page>
        <Page Image="11"></Page>
        <Page Image="12"></Page>
        <Page Image="13"></Page>
        <Page Image="14"></Page>
        <Page Image="15"></Page>
        <Page Image="16"></Page>
        <Page Image="17"></Page>
    </Pages>
</ComicInfo>

License

MIT LICENSE

About

Golang implementation of the ComicInfo spec to write and read comicinfo.xml files.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published