iwork

module
v0.0.0-...-02c26eb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2024 License: MIT

README

iWork utilities

This project contains a tool for converting Pages files to HTML. The initial motivation was to recover my older Pages files, but I got carried away and wrote a converter for the current format and the older iOS format.

It is very much a work in progress, but hopefully someone finds it useful.

Setup process

Download and build

go get https://github.com/dunhamsteve/iwork/iwork2html

Usage

Export path

export PATH=$PATH:$(go env GOPATH)/bin

Run conventer

./iwork2html infile.pages outfile.html

Pages '13

I'm building on the work of Sean Patrick O'Brien on github. He determined the base format of the .iwa files in the iWork'13 were a snappy compressed sequence of protobuf-encoded records and wrote a tool to extract the protobuf definitions from the executables. Those .proto files are included in the proto directory. He also extracted tables of int to type, needed to decode the .iwa archives. Those .json files are included in this project.

I've used the json files to generate some of the code in the index directory. (Using the code found in codegen.) I ran protoc on the .proto files and cleaned up the results so they would compile.

On top of this, I wrote the index package, which loads the database into memory. And I wrote iwork2html which will load a pages file and render the contents to HTML.

iOS '.pages-tef' files

Before the format change in Pages'13, the iOS version of pages introduced a .pages-tef bundle format for iCloud storage. It turns out that the sqlite database within these bundles mirror the '13 format. The iwork2html program handles these files too.

Pages'08 and Pages'09

I have included an XSLT file (pages08tohtml.xsl) that will process the xml from Pages'08 and Pages'09 files to HTML. You can apply it to the index.xml.gz in a Pages'08 file bundle (which is a directory) or the index.xml found within a Pages'09 file (which is just a zip file). For now I'll leave it as an exercise to write a wrapper script.

Directories

Path Synopsis
proto
KN
Package KN is a generated protocol buffer package.
Package KN is a generated protocol buffer package.
TN
Package TN is a generated protocol buffer package.
Package TN is a generated protocol buffer package.
TP
Package TP is a generated protocol buffer package.
Package TP is a generated protocol buffer package.
TSA
Package TSA is a generated protocol buffer package.
Package TSA is a generated protocol buffer package.
TSCE
Package TSCE is a generated protocol buffer package.
Package TSCE is a generated protocol buffer package.
TSCH
Package TSCH is a generated protocol buffer package.
Package TSCH is a generated protocol buffer package.
TSCH/PreUFF
Package TSCH_PreUFF is a generated protocol buffer package.
Package TSCH_PreUFF is a generated protocol buffer package.
TSCH_Generated
Package TSCH_Generated is a generated protocol buffer package.
Package TSCH_Generated is a generated protocol buffer package.
TSD
Package TSD is a generated protocol buffer package.
Package TSD is a generated protocol buffer package.
TSK
Package TSK is a generated protocol buffer package.
Package TSK is a generated protocol buffer package.
TSP
Package TSP is a generated protocol buffer package.
Package TSP is a generated protocol buffer package.
TSS
Package TSS is a generated protocol buffer package.
Package TSS is a generated protocol buffer package.
TST
Package TST is a generated protocol buffer package.
Package TST is a generated protocol buffer package.
TSWP
Package TSWP is a generated protocol buffer package.
Package TSWP is a generated protocol buffer package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL