datauri

command module
v0.0.0-...-39e22ac Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2012 License: GPL-2.0 Imports: 7 Imported by: 0

README

datauri
=======

This program is a data: URI generator.  data: URIs are useful for embedding data
in HTML and CSS documents where a URL for a small external resource such as an
icon or background texture would go.  See RFC 2397 for details.

This program  reads input from a file or standard input and generates a data:
URI version of the file.  Output is on standard output or, if the -o option is
used, a file.  Only base64 encoding is available.

This program was written partly as an exercise using Go.  Feel free to fork it
on GitHub:

    https://github.com/jayarndt/datauri

Building and Installing
=======================

If you have the gc compiler toolchain installed you can compile the program with
the following command:

    go build datauri.go

All you need to do to install it is copy the binary to somewhere in your $PATH
like /usr/local/bin/ .


Usage
=====

Examples:

    Generate a data URI of icon.png to stdout:
        datauri icon.png

    Generate a data URI of icon.png to a file called icon_uri.txt:
        datauri -o icon_uri.txt icon.png

    Generate a data URI of icon.png to stdout with MIME type foo/bar:
        datauri -t foo/bar icon.png

    Generate a data URI of data from stdin to stdout with MIME type foo/bar:
        datauri -t foo/bar

By default, datauri will select a MIME type from the operating system's MIME
database based on the extension of the input file.  If no entry is found in the
MIME database or the input was stdin the MIME type will default to
application/octet-stream if the -t option is not used.


License
=======

datauri is distributed under the terms of the GNU GPLv2 or later and with
ABSOLUTELY NO WARRANTY.  See COPYING for details.


Author
======

This program was written by Jay Arndt <jayarn27182@windstream.net>.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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