]> sipb.mit.edu Git - ikiwiki.git/blobdiff - doc/todo/inline_raw_files.mdwn
thanks for response; follow-up; I've got something working…
[ikiwiki.git] / doc / todo / inline_raw_files.mdwn
index 58920cc126051ddb34d7cfb83ab18dd46621b4b5..52a4be7265667b111dd89229e3dfd49f02f58af0 100644 (file)
@@ -9,7 +9,7 @@ Also raise an error in `IkiWiki::pagetype($file)` if `$file` is blank, which avo
 
 I'm using the new code in my [blog][].
 
-[blog]: http://www.physics.drexel.edu/~wking/unfolding-disasters/posts/yacc2dot/
+[blog]: http://blog.tremily.us/posts/yacc2dot/
 
 usage
 =====
@@ -64,3 +64,52 @@ usage
 >>> will be easier to merge or reject.  Note the new branch name:
 >>> `raw_inline`. I'll open separate todo items for items mentioned in my
 >>> previous comment. --[[wtk]]
+
+---- 
+
+Reviewing your patch the first thing I see is this:
+
+<pre>
++        if (! $file) {
++               error("Missing file.");
++        }
+</pre>
+
+This fails if the filename is "0". Also, `pagetype()`
+currently cannot fail; allowing it to crash the entire
+wiki build if the filename is somehow undefined seems
+unwise.
+
+I didn't look much further, because it seems to me what you're trying to do
+can be better accomplished by using the highlight plugin. Assuming the raw
+file you want to inline and comment on is some source-code-like thing,
+which seems likely.
+
+Or, another way to do it would be to use the templates plugin, and make
+a template there that puts an inline directive inside pre tags.
+ --[[Joey]] [[!tag reviewed]]
+
+----
+
+If `pagetype()` cannot fail, then I suppose that check has to go ;).
+
+I was under the impression that [[plugins/highlight]] didn't support
+inlining code.  It looks like it supports highlighing stand-alone
+files or embedded code.  Perhaps I should extend it to support inlined
+code instead of pushing this patch?
+
+> If you configure highlight to support standalone files, then you can
+> inline the resulting pages and get nicely highlighted source code
+> inlined into the page. --[[Joey]]
+
+The `raw.tmpl` included in the patch *does* include the inlined
+content inside `pre` tags.  The problem is that the current inline
+code insists on running `htmlize()` on the content before inserting it
+in the template.  The heart of my patch is an altered
+`get_inline_content()` that makes the `htmlize()` call dependent on a
+`$read_raw` flag.  If the flag is set, the raw (non-htmlized) content
+is used instead.
+
+I just rebased my patches against the current Ikiwiki trunk (no major
+changes) to make them easier to review.
+ --[[wtk]]