tinycm rev 54
Improve the export plugin
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Sat Jan 25 13:00:48 2014 +0100 (2014-01-25) |
parents | 190b9ba3af06 |
children | 8a26630ccceb |
files | plugins/export/export.cgi |
line diff
1.1 --- a/plugins/export/export.cgi Sat Jan 25 00:28:36 2014 +0000 1.2 +++ b/plugins/export/export.cgi Sat Jan 25 13:00:48 2014 +0100 1.3 @@ -5,8 +5,8 @@ 1.4 . /usr/lib/slitaz/httphelper 1.5 1.6 # 1.7 -# NOTE: Exporting wiki and making all urls work is a bit tricky and 1.8 -# actually doesn't work as expected. The goal is to have a SliTaz codex 1.9 +# NOTE: Exporting wiki to HTML and making all urls work is a bit tricky. 1.10 +# Actually it doesn't work as expected. The goal is to have a SliTaz codex 1.11 # online that can be included on the ISO, so we could have an export 1.12 # including a small CGI script to simply display wiki pages via HTTPd 1.13 # knowing that with HTML we must also deal with ../../ 1.14 @@ -22,22 +22,23 @@ 1.15 cat << EOT 1.16 <h2>Export</h2> 1.17 <p> 1.18 -$(gettext "EXPERIMENTAL: Export to HTML and create a tarball of your text 1.19 -content or plugins files.") 1.20 +$(gettext "Create a tarball off your wiki and plugins files. EXPERIMENTAL: 1.21 +Export wiki documents to HTML.") 1.22 </p> 1.23 <form method="get" action="$WEB_URL"> 1.24 <select name="export"> 1.25 EOT 1.26 for c in $(ls -1 content/) 1.27 do 1.28 - echo "<option value="$c">$c</option>" 1.29 + echo "<option value=\"${c}\">$c</option>" 1.30 done 1.31 + echo "<option value='wikitohtml'>wiki to HTML</option>" 1.32 cat << EOT 1.33 </select> 1.34 <input type="submit" value="$(gettext "Export")" /> 1.35 </form> 1.36 EOT 1.37 - # Functions 1.38 + # HTML fixes EPERIMENTAL Functions 1.39 css_path() { 1.40 # Sed CSS style path in all documents 1.41 sed -i s'/style.css/..\/style.css/' */*.html 1.42 @@ -58,15 +59,7 @@ 1.43 } 1.44 # Export requested content 1.45 case " $(GET export) " in 1.46 - *\ cloud\ *) 1.47 - export="cloud" 1.48 - tmpdir="content" 1.49 - echo '<pre>' 1.50 - gettext "Exporting:"; echo " $export" 1.51 - gen_tarball 1.52 - echo '</pre>' 1.53 - dl_link ;; 1.54 - *\ wiki\ *) 1.55 + *\ wikitohtml\ *) 1.56 export="wiki" 1.57 echo '<pre>' 1.58 gettext "Exporting:"; echo " $export" 1.59 @@ -103,9 +96,13 @@ 1.60 *\ export\ ) 1.61 html_footer && exit 0 ;; 1.62 *) 1.63 + export="$(GET export)" 1.64 + tmpdir="content" 1.65 echo '<pre>' 1.66 - gettext "Export not yet implemented for"; echo ": $(GET export)" 1.67 - echo '</pre>' ;; 1.68 + gettext "Exporting:"; echo " $export" 1.69 + gen_tarball 1.70 + echo '</pre>' 1.71 + dl_link ;; 1.72 esac 1.73 1.74 html_footer && exit 0