~dricottone/epub2html

epub2html/html.go -rw-r--r-- 636 bytes
ae806b41Dominic Ricottone Fixing blockquotes and refactoring 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Structs for marshaling HTML files

package main

import (
	"encoding/xml"
)

// Unlike the nested X(HT)ML division, this division is raw XHTML.
type HtmlDivision struct {
	Content []byte `xml:",innerxml"`
}

// The HTML structure should be a pair of one head and one body.
// An HTML head will mirror an XML head.
// An HTML body will be much simpler than an XML body.
type HtmlBody struct {
	Title    string       `xml:"h3"`
	Division HtmlDivision `xml:"div"`
}

type HtmlHead struct {
	Title string `xml:"title"`
}

type Html struct {
	XMLName xml.Name `xml:"html"`
	Head    HtmlHead `xml:"head"`
	Body    HtmlBody `xml:"body"`
}