scripttool

package module
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: BSD-2-Clause Imports: 16 Imported by: 1

README

Get it from the Snap Store

scripttool

A tool for working with screenplay file formats (e.g. fdx, fountain, osf, FadeIn).

Converting to fountain format

Convert from screenplay.fdx to screenplay.fountain

    scripttool fdx2fountain screenplay.fdx screenplay.fountain

Convert from screenplay.fadein to screenplay.fountain

    scripttool fadein2fountain screenplay.fadein screenplay.fountain

Convert from screenplay.osf to screenplay.fountain

    scripttool osf2fountain screenplay.osf screenplay.fountain

Working with fountain files

Pretty print fountain files

    scripttool fountainfmt screenplay.fountain

Render a fountain file as JSON

    scripttool fountain2json screenplay.fountain

Convert from fountain format

Convert from screenplay.fountain to screenplay.fdx

    scripttool fountain2fdx screenplay.fountain screenplay.fdx

Convert from screenplay.fountain to screenplay.fadein

    scripttool fountain2fadein screenplay.fountain screenplay.fadein

Convert from screenplay.fountain to screenplay.osf

    scripttool fountain2osf screenplay.fountain screenplay.osf

Script Reports

NOTE: Currently only fountain documents are supported for reporting. Currently the character list report is implemented as a proof of concept.

List the characters in screenplay.fountain

    scripttool characters screenplay.fountain

Documentation

Overview

scripttool is a package focused on converting to/from different file formats used in working with scripts,screenplays and other creative writing.

@author R. S. Doiel, <rsdoiel@gmail.com>

BSD 2-Clause License

Copyright (c) 2021, R. S. Doiel All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

scripttool is a package focused on converting to/from different file formats used in working with scripts,screenplays and other creative writing.

@author R. S. Doiel, <rsdoiel@gmail.com>

BSD 2-Clause License

Copyright (c) 2021, R. S. Doiel All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Index

Constants

View Source
const (
	// Version number of release
	Version = "0.0.9"

	// ReleaseDate, the date version.go was generated
	ReleaseDate = "2024-03-11"

	// ReleaseHash, the Git hash when version.go was generated
	ReleaseHash = "7febcd7"

	LicenseText = `` /* 1258-byte string literal not displayed */

)
View Source
const (
	HelpText = `% scripttool(1) scripttool user manual
% R. S. Doiel
% Augest 4, 2022

# NAME

scripttool

# SYNOPSIS

scripttool [-help,-version,-license] VERB [OPTIONS] [VERB PARAMETERS]


# DESCRIPTION

_scripttool_ a program for converting between screenplay formats (e.g. .fdx, .fadein, .fountain)

_scripttool_ converts screen play file formats. Supported formats include FileDraft's XML format, FadeIn's zipped XML format, Fountain formatted plain text as the Open Screenplay Format XML documents. The command line program is based on a Go package also called scripttool. The Go package can be compiled to a shared library and integrated with Python via the ctypes package.  

Internally _scripttool_ works with Fountain formatter files for reporting purposes. You can use the ` + "`" + `fountain2json` + "`" + ` verb to see the data structure represented as JSON for reports.

# verbs

Like many recent command line tools running under POSIX _scripttool_ uses
a ` + "`" + `CMD VERB [INPUT_FILENAME] [OUTPUT_FILENAME]` + "`" + ` scheme. The following verbs are provided. Each "verb" may also have related options.

## Convert FadeIn files

fadein2fdx
: Converts a FadeIn file to Final Draft XML 

fadein2fountain
: Converts a FadeIn file to fountain screenplay format

fadein2json
: Convert a FadeIn file to JSON format

fadein2osf
: Convert a FadeIn file to Open Screenplay Format 2.0

## Convert Final Draft XML

fdx2fadein
: Convert from Final Draft XML ("*.fdx" files) to FadeIn format

fdx2fountain
: Convert from Final Draft XML ("*.fdx" files) to Fountain screenplay format)

fdx2json
: Convert from Final Draft XML ("*.fdx" files) to JSON

fdx2osf
: Convert from Final Draft XML ("*.fdx" files) to Open Screenplay Format 2.0

## Convert Open Screenplay Format 2.0

osf2fadein
: Convert from Open Screenplay Format 2.0 to FadeIn

osf2fdx
: Convert from Open Screenplay Format 2.0 to Final Draft XML

osf2fountain
: Convert from Open Screenplay Format 2.0 to Fountain screenplay format

osf2json
: Convert from Open Screenplay Format 2.0 to JSON

## Convert Fountain fomat

fountain2fadein
: Converts a fountain screenplay formatted file to FadeIn formatted file.

fountain2fdx
: Convert a Fountain screenplay formatted file to Final Draft XML

fountain2json
: Convert a Fountain screenplay formatted file to JSON

fountain2osf
: Convert a Fountain screenplay formatted file to Open Screenplay Format 2.0 

fountainfmt
: Pretty print a fountain screenplay format

characters
: Provide a character list from a fountain formatted file. Internally the fountain file is parse and resulting JSON structure is analyzed to produce the count of character references in the elements of the file.



# OPTIONS

Below are a set of options available.

-help
: display help

-license
: display license

-version
: display version number

# VERB OPTIONS

-i
: set input filename

-o
: set output filename

-notes
: include notes in output

-synopsis
: include synopsis in output

-section
: include section headings in output

-width
: set max width in integers

-html
: output full HTML page

-inline-css
: include inline CSS (works with -html option)

-link-css
: include CSS link (works with -html option)

-pretty
: pretty print output

-alpha
: sort characters alphabetically instead of appearence order


# EXAMPLES

Converting *screenplay.fdx* to *screenplay.fountain* (2 examples)

~~~shell
    scripttool fdx2fountain screenplay.fdx screenplay.fountain
    scripttool fdx2fountain -i screenplay.fdx -o screenplay.fountain
~~~

Converting *screenplay.fountain* to *screenplay.fdx* (2 examples)

~~~shell
    scripttool fountain2fdx screenplay.fountain screenplay.fdx
    scripttool fountain2fdx -i screenplay.fountain -o screenplay.fdx
~~~

Listing characters from a *screenplay.fountain*. First list is order of appearence and the second set is characters sorted alphabetically using the "-alpha" option.

~~~shell
    scripttool characters screenplay.fountain
    scripttool characters -alpha screenplay.fountain
~~~

`
)

Variables

This section is empty.

Functions

func CharacterList

func CharacterList(in io.Reader, out io.Writer, alphaSort bool) error

CharacterList lists character in a screenplay (in should be fountain formated text).

func FadeInToFDX added in v0.0.9

func FadeInToFDX(inputFName string, out io.Writer) error

FadeInToFDX converts an input file to .fdx format

func FadeInToFountain

func FadeInToFountain(inputFName string, out io.Writer) error

FadeInToFountain converts an input file to .fountain format.

func FadeInToJSON added in v0.0.9

func FadeInToJSON(inputFName string, out io.Writer) error

FadeInToJSON converts an input file to JSON format.

func FadeInToOSF added in v0.0.9

func FadeInToOSF(inputFName string, out io.Writer) error

FadeInToOSF converts an input file to .fountain format.

func FadeInToYAML added in v0.0.9

func FadeInToYAML(inputFName string, out io.Writer) error

FadeInToYAML converts an input file to YAML format.

func FdxToFadeIn added in v0.0.9

func FdxToFadeIn(in io.Reader, outputFName string) error

FdxToFadeIn converts an input buffer from .fdx to FadeIn file

func FdxToFountain

func FdxToFountain(in io.Reader, out io.Writer) error

FdxToFountain converts an input buffer from .fdx to a .fountain format.

func FdxToJSON added in v0.0.9

func FdxToJSON(in io.Reader, out io.Writer) error

FdxToJSON converts an input buffer from a .fdx file to a .json format

func FdxToOSF added in v0.0.9

func FdxToOSF(in io.Reader, out io.Writer) error

FdxToOSF concerts an input buffer from .fdx to Open Screenplay Format 2.0

func FdxToYAML added in v0.0.9

func FdxToYAML(in io.Reader, out io.Writer) error

FdxToYAML converts an input buffer from a .fdx file to a .yaml format

func FmtCliHelp added in v0.0.9

func FmtCliHelp(appName string, verb string) string

func FmtCliText added in v0.0.9

func FmtCliText(s string, appName string, verb string, version string) string

func FmtHelp added in v0.0.9

func FmtHelp(src string, appName string, version string, releaseDate string, releaseHash string) string

FmtHelp lets you process a text block with simple curly brace markup.

func FountainFmt added in v0.0.5

func FountainFmt(in io.Reader, out io.Writer) error

FountainFmt pretty prints a fountain document, optionally passing on sections, synopsis and notes.

func FountainToFadeIn

func FountainToFadeIn(in io.Reader, outFName string) error

FountainToFadeIn converts an input buffer in .fountain format to output buffer in .fadein

func FountainToFdx

func FountainToFdx(in io.Reader, out io.Writer) error

Fountain2Fdx converts an input buffer in .fountain format to output buffer in .fdx

func FountainToFountain

func FountainToFountain(in io.Reader, out io.Writer) error

Fountain2Fountain reads a input buffer as .fountain and pretty prints output as .fountain

func FountainToHTML added in v0.0.5

func FountainToHTML(in io.Reader, out io.Writer) error

FountainToHTML takes a fountain script and formats it in the fountain scrippets HTML markup that can be used with the scrippets CSS, see https://fountain.io/scrippets and https://johnaugust.com/2004/screenbox. FIXME: Write wrapping functioHTMLon and add appropriate writer method to fountain package.

func FountainToJSON added in v0.0.5

func FountainToJSON(in io.Reader, out io.Writer) error

FountainToJSON convert .fountain file to JSON

func FountainToOSF

func FountainToOSF(in io.Reader, out io.Writer) error

FountainToOSF converts an input buffer in .fountain format to output buffer in .osf

func FountainToYAML added in v0.0.9

func FountainToYAML(in io.Reader, out io.Writer) error

FountainToYAML convert .fountain file to YAML

func OSFToFadeIn added in v0.0.9

func OSFToFadeIn(in io.Reader, outputFName string) error

OSFToFadeIn converts the input buffer from .osf to FadeIn file

func OSFToFdx added in v0.0.9

func OSFToFdx(in io.Reader, out io.Writer) error

OSFToFdx converts the input buffer from .osf to .fdx format.

func OSFToFountain

func OSFToFountain(in io.Reader, out io.Writer) error

OSFToFountain converts the input buffer from .osf to .fountain format.

func OSFToJSON added in v0.0.9

func OSFToJSON(in io.Reader, out io.Writer) error

OSFToJSON converts the input buffer from .osf to .json format.

func OSFToYAML added in v0.0.9

func OSFToYAML(in io.Reader, out io.Writer) error

OSFToYAML converts the input buffer from .osf to .yaml format.

func RunScripttool added in v0.0.9

func RunScripttool(in *os.File, out *os.File, eout *os.File, args []string) error

Types

This section is empty.

Directories

Path Synopsis
cmd
scripttool
scripttool is a tool for working with screenplay file formats.
scripttool is a tool for working with screenplay file formats.

Jump to

Keyboard shortcuts

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