As of May 2017, the Public folder has been converted to a standard, private folder (this conversion happened for Dropbox Basic users on March 15, 2017).
The in-browser rendering of HTML files has also been/is being discontinued (see quoted paragraphs below for the exact dates). According to the pinned answer on this question, shared HTML files will be available for download only, as opposed to being rendered in-browser.
As of October 3, 2016 Dropbox Basic (free) users can no longer use
public links to render HTML content in a web browser. If you're a
Basic user, and you created a website that directly displays HTML
content from your Dropbox account, it will no longer render in the
browser. The HTML content itself remains safe in Dropbox, and you can
share it using any of our other sharing methods.
Effective September 1, 2017 Dropbox Pro, Plus, and Business users will
no longer be able to render HTML content, and the Public folder and
its sharing functionality will be disabled. Until that date, Dropbox
Pro, Plus, and Business users can continue to use public links to
render HTML content.
From: https://www.dropbox.com/help/files-folders/public-folder
As for hosting other static files, I manually tested including a shared CSS file from Dropbox in an HTML file. The share link I was given for the file was like this:
https://www.dropbox.com/s/anxsno1zw25jo34/test.css?dl=0
Trying to include this link in the CSS file did not work (that page returns the HTML for the Dropbox "web viewer" for the file), but it worked when I used the dl=1
query parameter instead, like so:
<link rel="stylesheet" type="text/css" href="https://www.dropbox.com/s/anxsno1zw25jo34/test.css?dl=1">
However, including the CSS in this way did add an additional redirect as the request to this share URL responded with a HTTP 302 status code and redirected to another URL:
https://dl.dropboxusercontent.com/content_link/Q5jNr3kDXOtSyrXFw7qM4LYMMZynVb0YrnUdPLXtiVbBXG1bor57HxlVQ2T3V3tu/file?dl=1
Including the CSS using this link bypassed the redirect, but I'm not sure if this is a permanent URL or if it may change in the future (while the URL that redirects should work permanently).
Hot-linking (directly embedding) images from Dropbox seems to behave in the same way (the share link with the dl=1
query parameter works, but incurs a redirect).
Best Answer
Please read the following: http://ramblings.mcpher.com/Home/excelquirks/gaspublish.
Bruce McPherson created a way to integrate Google Prettify into Google Apps Script (GAS) allowing code to be prettified using an iFrame.
The code can be collected from many places, like Github, within GAS, ScriptDb. You're already familiar with the usage of a public Dropbox folder and that's exactly how Bruce McPherson does it as well.
I use his technique to prettify my own snippets, see example: Gplus in GAS.
UPDATE: Some feedback from Bruce McPherson:
Happy coding !!