fdx is a Go package and two small command line programs for working with the XML files that Final Draft writes (.fdx), and that other screenwriting programs such as Trelby, Celtx and Fade In read and write. The package parses an FDX document, writes it back as XML, renders it as Fountain-like plain text, and builds one from a Fountain document parsed by the fountain package. Its types carry JSON and YAML tags.
doc, err := fdx.ParseFile("screenplay.fdx")
fmt.Println(doc.String()) // Fountain-like plain text
screenplay, _ := fountain.ParseFile("screenplay.fountain")
out := fdx.NewFinalDraft()
out.FromFountain(screenplay)
xml, _ := out.ToXML() // an FDX document- Scene numbers. A Fountain heading that ends in a number between hashes,
INT. KITCHEN - DAY #12A#, becomes a Scene Heading whoseNumberattribute is "12A", and the heading text no longer holds the marker. Going the other way, aNumberon a Scene Heading is written back as#12A#. - Boneyards. A Fountain boneyard (
/* ... */) becomes an ordinary paragraph, so it shows and prints in Final Draft.
fdx2txt : reads an FDX file and writes plain text in a Fountain-like format.
txt2fdx : reads a Fountain file and writes an FDX file.
Get a release from GitHub, or see INSTALL.md, which also covers installing from source. To use the package in a Go program:
go get github.com/rsdoiel/fdxYou need Go 1.26.4 or later. Pandoc and GNU Make are only needed for the man pages and the website, and cmt (CMTools) only to regenerate version.go, about.md and CITATION.cff from codemeta.json.
make # build the programs into bin/ and the man pages into man/
make test # go test ./...
make check # gofmt -l and go vet; rewrites nothing