X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/7558a6d8aa56f38908c613882db44a009d33ae37..c98ea6a971438fa465f6c0092a77c6d2fc6fda1c:/doc/todo/latex.mdwn?ds=sidebyside diff --git a/doc/todo/latex.mdwn b/doc/todo/latex.mdwn index 58a522282..e96e4b782 100644 --- a/doc/todo/latex.mdwn +++ b/doc/todo/latex.mdwn @@ -1,7 +1,7 @@ How about a plugin adding a -[[preprocessor_directive|preprocessordirective]] to render some given LaTeX +[[preprocessor_directive|ikiwiki/preprocessordirective]] to render some given LaTeX and include it in the page? This could either render the LaTeX as a PNG via -[[debpkg dvipng]] and include the resulting image in the page, or perhaps +[[!debpkg dvipng]] and include the resulting image in the page, or perhaps render via [HeVeA](http://pauillac.inria.fr/~maranget/hevea/index.html), [TeX2page](http://www.ccs.neu.edu/~dorai/tex2page/tex2page-doc.html), or similar. Useful for mathematics, as well as for stuff like the LaTeX version @@ -98,6 +98,8 @@ Fixed Okay, I'll provide the log as an link in the wiki. But there should be a kind of mechanism how they can be removed. This could lead to an DOS (create via a bot so much nonsense code that the disk is full.) +Fixed, the log is now provided if latex will fail. + > The url handling could stand to be improved. Currently it uses $config{url}, so it depends on that being set. Some ikiwiki builds don't have an url set. The thing to do is to use urlto(), to generate a nice relative url from the page to the image. >> Mh... i choose one single dir explizitly since if you use on several pages the same formula this would really improve the time to generate the formulas and it would waste extra space if you store every formula 3-4 times. But if you really like I'll change this behaviour. @@ -107,6 +109,8 @@ Okay, I'll provide the log as an link in the wiki. But there should be a kind of Yes of course, I'll improve the url handling. My comment was only about the several folder ;-) +Fixed. Now I use urlto and will_render. + > Another (minor) problem with the url handling is that you put all the images in a "teximages" directory in the toplevel of the wiki. I think it would be better to put each image in the subdirectory for the page that created it. See how the `img` and `sparkline` plugins handle this. > It looks like if the tempdir already exists, tempdir() will croak(), thus crashing ikiwiki. It would be good to catch a failure there and fail more gracefully. @@ -133,10 +137,10 @@ Fixed. I'll removed these two lines completly. ----- Okay here an short timetable how I want to proceed further: -* Until weekend (21-22. July) I'll try to fix all errors above. +* Until weekend (21-22. July) I'll try to fix all errors above. (done) * From 22.July until 29. July I'll try to set up a first security check My plans are two parts of a security check: - * One with an array of blacklisted regular expression. (This would blacklist all the well known and easy to fetch things like \include {/path/to/something} and things like closing the math formula environment ($$). + * One with an array of blacklisted regular expression. (This would blacklist all the well known and easy to fetch things like \include {/path/to/something} and things like closing the math formula environment ($$). (done) * the second step will be based on Tom::latex, which will help to parse and get a tree view of the code. Okay what do you think of this procedure? @@ -151,10 +155,66 @@ Okay what do you think of this procedure? > with the rest of the text if you change the font size in your browser (ctrl + +/-). -Thanks for the comment.. is fixed. +Thanks for the comment.. is fixed. +Mh... not really fixed :S I added it into the return but it is somehow ignored. I'll figure out why. ----- -[[tag soc]] +Okay, the last version of the tex plugin for ikiwiki can be downloaded [here](https://www.der-winnie.de/~winnie/gsoc07/tex.pm). + +> I've looked this over, fixed the indenting, fixed some variable names +> ("$foo" is a bad variable name), removed a gratuotuous use of `tie`, +> fixed a bug (the first time it was run, it tried to write the png file +> before the teximages/ directory existed) and checked the result in. +> +> Can you please flesh out [[plugins/teximg]] with +> whatever documentation people who know tex will expect to see? + +Okay, I'll fill this up today I think with information about the plugin + +Done. Is that docu fine with you? + +>> Perhaps add some documentation about the kind of tex code that can be +>> used, or a link to some documentation so people who don't know latex +>> well can figure this out? + +> Also, please review my changes. In particular, I changed the @badthings +> array to use qr//, which is much clearer, but it needs to be tested that +> I didn't break the checking code when I did it. It would be nice to write +> a test case that tries to feed it bad code and makes sure it rejects it. + +I'll test this now on my server. I'll report here later. +Okay, checked. it works fine. My blacklist tests were successfull. + +> +> Does it really make sense to have an alt tag for the image +> that contains the tex code? Will that make any sense when browsing +> without images? + +Mh.. For people who know latex very well this would be enough to imagine how the image would look like. +This are of course the minority of people (but I guess also the minority of people are using non-gui browsers). + + + +> I'm thinking about renameing the preprocessor directive to teximg. +> \[[!teximg code="" alt="foo"]] makes sense.. Would it make sense to rename +> the whole plugin, or do you think that other tex stuff should go in this +> same plugin? + +I'll think over this until I'm at work ;) Only for rendering images... not for generating .tex files .../wiki/ +the name is all the same i think. If you like teximg better than switch :) + + +> Note: I removed the style= attribute, since as I've told you, the +> htmlsanitizer strips those since they can be used to insert javascript. I +> put in a class=teximage instead; the style sheet could be modified to +> style that, if you want to send a patch for that. + +Ah yes.. sorry forgot to update the plugin in my public_html folder %-). This was my last change in this plugin :) Sorry. + + +> +> --[[Joey]] -[[tag wishlist]] +[[!tag soc]] +[[!tag wishlist]]