e1687c96ff
Split tawashi into lib+executable to enable unit testing
2017-05-04 19:52:18 +01:00
73323c9ee7
Add plain text mode
2017-04-27 09:33:47 +01:00
3191203bfd
Tell the browser returned plain text is utf8.
2017-04-26 20:12:59 +01:00
5377d25c72
Simplify the response pipeline.
...
There is no on_send() anymore, instead responses can
override the way the top-level mustache file is retrieved.
2017-04-26 09:17:57 +01:00
06920f8d84
Return pasties into a proper html page.
...
I don't think html escaping is needed, since pasties
go through the colorizer first.
I don't really like the workaround to not call on_send() when
I don't want the html output, it's a bit omg what's going on
there... I'll have to rewrite that bit.
2017-04-25 22:56:19 +01:00
54e737c171
Escape html in non-plaintext responses.
2017-04-25 22:09:46 +01:00
8a23dc1add
An empty GET is synonym of m=plain
2017-04-25 22:09:46 +01:00
b423522af8
Enable language and expiry in pasties.
2017-04-25 00:21:44 +01:00
9232644cbb
I missed this in a previous commit - take the setting from the SettingsBag.
2017-04-25 00:10:50 +01:00
fe53ea7ea1
Implement as_str() and as_ref() as template as<>().
...
Also provide a commodity at() that is a synonym
for as<boost::string_ref>() but much shorter to type.
2017-04-24 09:25:04 +01:00
0add0720d5
Add langmap_dir setting.
...
Allows users to specify the path to the langmap dir for
source-highlight.
2017-04-23 13:57:49 +01:00
75674525de
Response keeps a ptr to the SettingsBag now.
2017-04-23 13:40:48 +01:00
b03c3198b8
Make a SettingsBag class that wraps the ini settings.
...
Easily allows to have default values for options
that are not specified in the loaded ini file.
2017-04-21 23:10:16 +01:00
00aa06282d
Set the html root from the config file.
2017-04-18 20:10:36 +01:00
680f13e1f6
Refactoring.
...
IncRedis is now held by Response, if requested by the base class.
Response objects know their names, and they use it to load
the html (soon to be mustache) data from disk.
Main only prepares a factory, the factory then instantiates
the actual Response.
The code now correctly serves index.cgi when the request is /.
Remove kakoune's safe_ptr from inside src and put an updated
one in lib/kakoune.
2017-04-15 03:18:33 +01:00
da2484b0d4
Use base_uri in the response
2017-04-11 19:36:18 +01:00
ed25d60351
Use source-highlight library for syntax colorizing.
2017-04-07 23:57:32 +01:00
ef9e74c473
Redirect to the new page if pastie was successful.
2017-04-07 00:31:06 +01:00
4354f4bf29
Add GPL3 licence.
2017-04-06 23:35:06 +01:00
31890ba5e4
Allow retrieval of pasties
2017-04-06 23:28:57 +01:00