DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:getraw

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:getraw [2021-07-07 05:51] – accept tag with language declared for syntax highlight, and .htaccess with option for ".c" becoplugin:getraw [2021-07-07 05:54] (current) – [Usability suggestions] dot is not bar-dot beco
Line 6: Line 6:
 email      : elifenton@this_is_not_a_real_email.fake email      : elifenton@this_is_not_a_real_email.fake
 type       :  type       : 
-lastupdate : 2015-06-09+lastupdate : 2021-07-07
 compatible : angua, rincewind, hrun, detritus, Frusterick Manners, greebo compatible : angua, rincewind, hrun, detritus, Frusterick Manners, greebo
 depends    :  depends    : 
Line 121: Line 121:
 For ease of use, you can set up another rewrite rule in your .htaccess so that a user only needs to add .txt to their URL to get the text format. Also, optionally, add .c to the URL to get only the the source inside the code tags.  For ease of use, you can set up another rewrite rule in your .htaccess so that a user only needs to add .txt to their URL to get the text format. Also, optionally, add .c to the URL to get only the the source inside the code tags. 
  
-''RewriteRule ^(.*).txt$                getRaw.php?id=$1  [L]''\\+''RewriteRule ^(.*)\.txt$                getRaw.php?id=$1  [L]''\\
 ''RewriteRule ^(.*)\.c$                 getRaw.php?id=$1&onlyCode=1 [L]'' ''RewriteRule ^(.*)\.c$                 getRaw.php?id=$1&onlyCode=1 [L]''
  
 Also for readability, throw a ''header('Content-Type: text/plain');'' in line 4, and the browser will know to interpret the newlines instead of eating them like HTML.  --- [[user>NReilingh|NReilingh]] //2015-11-29 07:30// --- [[user>beco|beco]] //2021-07-07 05:48// Also for readability, throw a ''header('Content-Type: text/plain');'' in line 4, and the browser will know to interpret the newlines instead of eating them like HTML.  --- [[user>NReilingh|NReilingh]] //2015-11-29 07:30// --- [[user>beco|beco]] //2021-07-07 05:48//
plugin/getraw.1625629897.txt.gz · Last modified: 2021-07-07 05:51 by beco

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki