hypo/README.org

108 lines
4 KiB
Org Mode
Raw Permalink Normal View History

2013-08-25 23:21:39 +02:00
#+STARTUP: showall
2014-04-24 23:52:59 +02:00
#+OPTIONS: toc:nil
2013-08-25 23:21:39 +02:00
2014-04-24 23:51:18 +02:00
Quickly share bits of code, screenshots and whatnot with some friends.
2013-08-01 01:24:32 +02:00
Easily delete them too.
* Setup
2014-04-24 23:51:18 +02:00
Hypo is written in [[http://hylang.org][hy]]. Which is a Lisp and Python thrown together.
2013-08-01 01:24:32 +02:00
This doesn't matter much, it should function as a regular python
module.
** Requirements
Hypo has the following requirements:
- [[http://hylang.org][hy]] 0.10.0 :: The language.
- [[http://webpy.org][web.py]] 0.37 :: The Python web framework.
- [[https://github.com/FriendCode/gittle][gittle]] 0.2.2 :: Pythonic Git for Humans
- [[https://bitbucket.org/babab/pycommand][pycommand]] 0.1.0 :: Command line arguments parser
- [[http://pygments.org/][Pygments]] 1.6 :: Python syntax highlighter
2013-08-01 01:24:32 +02:00
Besides these it also requires everything needed to run web.py
applications using your favorite webserver.
* Usage
2014-04-24 23:51:18 +02:00
Once setup it will show most of this file if you browse to the ~/~ of
your installation, then you'll have to upload something.
2013-08-01 01:24:32 +02:00
** Uploading
Uploading is done with the ~PUT~ HTTP method. An example with curl:
: # curl --upload-file README.org http://yourserver.example.com/ 2>/dev/null
: http://yourserver.example.com/abcdef1
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 ~jpg~, ~png~ and ~gif~) it will show the
image.
If Hypo doens't know what kind of file you're uploading it will
default to treating it as a text file.
2013-08-25 23:21:39 +02:00
** Viewing
All files can be viewed (from, for example, your web browser) in
three different ways. The regularly, raw and as download.
The regular way shows a web page with the file either syntax
highlighted using ~pygments~ or (in case it is an image) with the
image shown on the page. This is viewed by using the URL printed
after upload has completed. For example:
: http://yourserver.example.com/abcdef1
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 ~raw/~. For example:
: http://yourserver.example.com/raw/abcdef1
The download view is the same as the raw view except that the
~Content-Disposition~ header has been set to ~attachment~. This causes
a download dialog to show up instead of your browser trying to
2014-04-23 23:15:58 +02:00
render it. This is viewed by prefixing the last part of the URL
2013-08-25 23:21:39 +02:00
with ~dl/~. For example:
: http://yourserver.example.com/dl/abcdef1
2013-08-01 01:24:32 +02:00
** Deleting
After you have uploaded a file you can delete it again by using
the ~DELETE~ HTTP method. An example with curl:
: # curl -XDELETE http://yourserver.example.com/abcdef1
2014-04-23 23:18:48 +02:00
: Successfully removed abcdef1
2013-08-01 01:24:32 +02:00
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.
2013-08-25 23:21:39 +02:00
* Clients
2014-04-23 23:18:48 +02:00
Hypo tries to stay simple to work with, at least on the client-side.
However, some clients may make things easier. Currently there is
only the (incomplete) [[http://code.ryuslash.org/hypo-emacs/][Emacs client]] and a simple [[http://code.ryuslash.org/hypo-cli/about/][CLI client]].
2013-08-25 23:21:39 +02:00
2013-08-01 01:24:32 +02:00
* License
Hypo is free software: you can redistribute it and/or modify it
under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
Hypo is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public
License along with Hypo. If not, see [[http://www.gnu.org/licenses/]].
2013-08-01 01:29:00 +02:00
See [[http://code.ryuslash.org/cgit.cgi/hypo/tree/COPYING][COPYING]] for more information.