Skip to content

Commit

Permalink
fix: style and responsiveness
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Sunglasses authored Dec 11, 2023
1 parent 79dca9a commit b0c6b5c
Showing 1 changed file with 102 additions and 57 deletions.
159 changes: 102 additions & 57 deletions src/paste/templates/index.html
Original file line number Diff line number Diff line change
@@ -1,59 +1,104 @@
<!DOCTYPE html>
<html>
<body>
<pre style="position: relative;"> ABOUT

A simple pastebin powered by <a href="https://fastapi.tiangolo.com/">FastAPI</a>.

Paste is Fully Free and Open-Source <a href="https://github.com/FOSS-Community/paste.py">Source Code</a>.

Simple API. CLI. Web form.

Web Form: <a href="https://paste.fosscu.org/web" alt="paste.py web interface">https://paste.fosscu.org/web</a>

API USAGE

POST https://paste.fosscu.org/paste

Send the raw data along. Will respond with a link to the paste.

If the response code is 201 (CREATED), then the entire paste was
uploaded. If the response is 206 (PARTIAL), then the paste exceeded
the server's maximum upload size, and only part of the paste was
uploaded. If the response code is anything else, an error has
occurred. Pasting is heavily rate limited.

GET https://paste.fosscu.org/paste/&lt;id&gt;

Retrieve the paste with the given id as plain-text.


DELETE https://paste.fosscu.org/paste/&lt;id&gt;

Delete the paste with the given id.

EXAMPLES

Paste a file named 'file.txt' using cURL:

curl -X POST -F "file=@file.txt" https://paste.fosscu.org/file

Paste from stdin using cURL:

echo "Hello, world." | curl -X POST -F "file=@-" https://paste.fosscu.org/file

Delete an existing paste with id &lt;id&gt; using cURL:

curl -X DELETE https://paste.fosscu.org/paste/&lt;id&gt;

A shell function that can be added to `.bashrc` or `.bash_profle` for
quick pasting from the command line. The command takes a filename or reads
from stdin if none was supplied and outputs the URL of the paste to
stdout: `paste file.txt` or `echo "hi" | paste`.

function paste() {
local file=${1:-/dev/stdin}
curl -X POST -F "file=@${file}" https://paste.fosscu.org/file
}
</body>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>FastAPI Pastebin</title>
<style>
body {
font-family: sans-serif;
margin: 0;
padding: 20px;
display: flex;
flex-direction: column;
align-items: center;
}

pre {
font-family: monospace;
padding: 10px;
border: 1px solid #ddd;
border-radius: 3px;
background-color: #f5f5f5;
max-width: 100%;
overflow-x: auto;
}

a {
color: #007bff;
text-decoration: none;
}

h3 {
margin-bottom: 5px;
margin-top: 15px;
}

ul {
margin-top: 5px;
}

@media only screen and (max-width: 768px) {
pre {
font-size: 16px;
padding: 5px;
}
}
</style>
</head>
<body>
<pre>
<h3>ABOUT</h3>

<p>A simple pastebin powered by <a href="https://fastapi.tiangolo.com/">FastAPI</a>.</p>

<ul>
<li>Simple API</li>
<li>CLI</li>
<li>Web form</li>
</ul>

<strong>Web Form:</strong> <a href="https://paste.fosscu.org/web" alt="paste.py web interface">https://paste.fosscu.org/web</a>

<h3>API USAGE</h3>

<p><strong>POST:</strong> https://paste.fosscu.org/paste</p>
<p>Send the raw data along. Will respond with a link to the paste.</p>

<ul>
<li>201 (CREATED): entire paste uploaded</li>
<li>206 (PARTIAL): exceeded server limit</li>
<li>Other codes: error</li>
</ul>

<p>Pasting is heavily rate limited.</p>

<p><strong>GET:</strong> https://paste.fosscu.org/paste/&lt;id&gt;</p>
<p>Retrieve the paste with the given id as plain-text.</p>

<p><strong>DELETE:</strong> https://paste.fosscu.org/paste/&lt;id&gt;</p>
<p>Delete the paste with the given id.</p>

<h3>EXAMPLES</h3>

<p><strong>cURL:</strong> Paste a file named 'file.txt'</p>

<pre>curl -X POST -f "file=@file.txt" https://paste.fosscu.org/file</pre>

<p><strong>cURL:</strong> Paste from stdin</p>

<pre>echo "Hello, world." | curl -X POST -f "file=@-" https://paste.fosscu.org/file</pre>

<p><strong>cURL:</strong> Delete an existing paste</p>

<pre>curl -X DELETE https://paste.fosscu.org/paste/&lt;id&gt;</pre>

<p><strong>Shell function:</strong> paste from the command line</p>

<pre>function paste() {
local file=${1:-/dev/stdin}
curl -X POST -f "file=@${file}" https://paste.fosscu.org/file
}</pre>
</pre>
</body>
</html>

0 comments on commit b0c6b5c

Please sign in to comment.