aboutsummaryrefslogtreecommitdiffstats
path: root/doc/hypo.texi
blob: b7862d099f1fe97b31234018aa9e88de11bf3aa7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
\input texinfo   @c -*-texinfo-*-
@c %**start of header
@setfilename hypo.info
@settitle Hypo user manual
@c %**end of header
@copying
How to use hypo.

Copyright @copyright{} 2013  Tom Willemse

@quotation
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled ``GNU
Free Documentation License''.

A copy of the license is also available from the Free Software
Foundation Web site at @url{http://www.gnu.org/licenses/fdl.html}.

@end quotation

The document was typeset with
@uref{http://www.texinfo.org/, GNU Texinfo}.

@end copying

@titlepage
@title Hypo user manual
@subtitle How to use hypo
@author Tom Willemse <tom@@ryuslash.org>
@page
@vskip 0pt plus 1filll
@insertcopying
@end titlepage

@c Output the table of the contents at the beginning.
@contents

@ifnottex
@node Top, Introduction, (dir), (dir)
@top Hypo user manual

@insertcopying
@end ifnottex

@c Generate the nodes for this menu with `C-c C-u C-m'.
@menu
* Introduction::                Meet Hypo
* Usage::                       What you can do with hypo
* Clients::
* Copying This Manual::
* Index::
@end menu

@c Update all node entries with `C-c C-u C-n'.
@c Insert new nodes with `C-c C-c n'.
@node Introduction, Usage, Top, Top
@chapter Introduction to Hypo

Hypo comes from a desire to share snippets, screenshots and the like
with friends and colleagues the easiest and fastest way possible.

@menu
* Features::                    What hypo can do
@end menu

@node Features,  , Introduction, Introduction
@section Features

Hypo offers a small, but useful number of features.

@itemize
@item
Easy sharing and maintenance of files, snippets or screenshots using
familiar HTTP verbs such as @samp{POST}, @samp{GET} and @samp{DELETE}.

@item
Syntax highlighting with @uref{http://pygments.org/, pygments}.

@item
Separate HTML, raw or download views.
@end itemize

@node Usage, Clients, Introduction, Top
@chapter Using hypo

Hypo is used through a very simple web API that uses normal, everyday
HTTP methods to manipulate files.

@menu
* Uploading::                   Getting new files in hypo
* Viewing::                     Viewing the files in hypo
* Deleting::                    Removing old files from hypo
@end menu

@node Uploading, Viewing, Usage, Usage
@section Uploading files

Uploading is done with the @samp{PUT} HTTP method. An example with
curl:

@example
# curl --upload-file README.org http://yourserver.example.com/ 2>/dev/null
http://yourserver.example.com/abcdef1
@end example

After uploading a file to the server it will respond with the url of
your newly uploaded file. If you browse to this URL using your
favorite browser you will find a page showing the file. For text files
it will try to provide some syntax highlighting, for certain types of
images (currently @samp{jpg}, @samp{png} and @samp{gif}) it will show
the image.

If Hypo doesn't know what kind of file you're uploading it will
default to treating it as a text file.

@node Viewing, Deleting, Uploading, Usage
@section Viewing uploaded files

All files can be viewed (from, for example, your web browser) in three
different ways. The regularly, raw and as download.

The regular way sshows a web page with the file either syntax
highlighted using @samp{pygments} or (in case it is an image) with the
image shown on the page. This is viewed using the URL printed after
upload has completed. For example:

@example
http://yourserver.example.com/abcdef1
@end example

The raw view is just the file, saving this file is the same as
downloading it. This is viewed by prefixing the last part of the URL
with @samp{raw/}. For example:

@example
http://yourserver.example.com/raw/abcdef1
@end example

The download view is the same as the raw view except that the
@samp{Content-Disposition} header has been set to @samp{attachment}.
This causes a download dialog to show up instead of your browser
trying to render it. This is viewed by prefixing the last part of the
URL with @samp{dl/}. For example:

@example
http://yourserver.example.com/dl/abcdef1
@end example

@node Deleting,  , Viewing, Usage
@section Deleting uploaded files

After you have uploaded a file you can delete it again by using the
@samp{DELETE} HTTP method. An example with curl:

@example
# curl -XDELETE http://yourserver.example.com/abcdef1
Succesfully removed abcdef1
@end example

There is currently no way to authenticate yourself with the server,
so anyone can delete (also post) files. Of course they would first
have to know the URL to send the delete to.

@node Clients, Copying This Manual, Usage, Top
@chapter Client programs

Hypo tries to stay simple to work with, at least on the client-side.
However, some clients may make things even easier. Currently there is
the (incomplete) @uref{http://code.ryuslash.org/hypo-emacs/about/,
Emacs client} and also a
@uref{http://code.ryuslash.org/hypo-cli/about/, simple CLI client}.

@node Copying This Manual, Index, Clients, Top
@appendix Copying This Manual

@include fdl.texi

@node Index,  , Copying This Manual, Top
@unnumbered Index

@printindex cp

@bye

@c hypo.texi ends here