Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow adding extra resources to EPUB files
This adds a few extra `MetaProperty` definitions that allow for adding resources to EPUB files. It also introduces Tika to guess content types for file suffixes instead of the hardcoded table in previous versions. Fix: #19
- Loading branch information
Showing
13 changed files
with
332 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
com.io7m.xstructural.tests/src/test/resources/com/io7m/xstructural/tests/example4_80.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
|
||
<!-- Comments! --> | ||
|
||
<Document xmlns="urn:com.io7m.structural:8:0" | ||
xmlns:dc="http://purl.org/dc/elements/1.1/" | ||
tableOfContentsDepth="3" | ||
tableOfContents="true"> | ||
|
||
<!-- Comments! --> | ||
|
||
<Metadata> | ||
<dc:contributor>A Contributor</dc:contributor> | ||
<dc:creator>A Creator</dc:creator> | ||
<dc:description>An example article.</dc:description> | ||
<dc:identifier>7486b85a-30de-4007-8b32-679b8a851b91</dc:identifier> | ||
<dc:language>English</dc:language> | ||
<dc:publisher>A Publisher</dc:publisher> | ||
<dc:relation>A Relation</dc:relation> | ||
<dc:rights>CC-0</dc:rights> | ||
<dc:source>A Source</dc:source> | ||
<dc:title>Example Document</dc:title> | ||
|
||
<MetaProperty name="com.io7m.xstructural.epub.resource">file0.txt</MetaProperty> | ||
<MetaProperty name="com.io7m.xstructural.epub.resource">file1.txt</MetaProperty> | ||
<MetaProperty name="com.io7m.xstructural.epub.resource">file2.txt</MetaProperty> | ||
</Metadata> | ||
|
||
<Section title="08eb2001-58ef-44be-acce-5eecee051515"> | ||
<Paragraph> | ||
No bagel. | ||
</Paragraph> | ||
<Paragraph> | ||
No bagel. | ||
</Paragraph> | ||
<Paragraph> | ||
No bagel. | ||
</Paragraph> | ||
<Paragraph> | ||
No bagel. | ||
</Paragraph> | ||
</Section> | ||
|
||
</Document> |
42 changes: 42 additions & 0 deletions
42
com.io7m.xstructural.tests/src/test/resources/com/io7m/xstructural/tests/example5_80.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
|
||
<!-- Comments! --> | ||
|
||
<Document xmlns="urn:com.io7m.structural:8:0" | ||
xmlns:dc="http://purl.org/dc/elements/1.1/" | ||
tableOfContentsDepth="3" | ||
tableOfContents="true"> | ||
|
||
<!-- Comments! --> | ||
|
||
<Metadata> | ||
<dc:contributor>A Contributor</dc:contributor> | ||
<dc:creator>A Creator</dc:creator> | ||
<dc:description>An example article.</dc:description> | ||
<dc:identifier>7486b85a-30de-4007-8b32-679b8a851b91</dc:identifier> | ||
<dc:language>English</dc:language> | ||
<dc:publisher>A Publisher</dc:publisher> | ||
<dc:relation>A Relation</dc:relation> | ||
<dc:rights>CC-0</dc:rights> | ||
<dc:source>A Source</dc:source> | ||
<dc:title>Example Document</dc:title> | ||
|
||
<MetaProperty name="com.io7m.xstructural.epub.resource-list">extra-resources.txt</MetaProperty> | ||
</Metadata> | ||
|
||
<Section title="08eb2001-58ef-44be-acce-5eecee051515"> | ||
<Paragraph> | ||
No bagel. | ||
</Paragraph> | ||
<Paragraph> | ||
No bagel. | ||
</Paragraph> | ||
<Paragraph> | ||
No bagel. | ||
</Paragraph> | ||
<Paragraph> | ||
No bagel. | ||
</Paragraph> | ||
</Section> | ||
|
||
</Document> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.