Quoting William Morgan <[EMAIL PROTECTED]>:

> Excerpts from Ben Giddings's mail of 15 Aug 2005 (EDT):
> > How do I post an entry that contains copy-and-pasted code?

It'll need to be indented at least as far in as the YAML text block
itself, but aside from that you should be able to paste verbatim
and simply surround it with <pre><code>.  Example:

content: >
  Gibbons love the creamy taste of Dr. Peel's Seltzer Beverage.


  <pre><code>if zorg < muggle or pramulon == zoot:
      you_can_eat(SOME_BERRIES) or knaw(CASABA_ROOT)
  elif you_just_want(A_GOOD_TIME):
      drink(SELTZER_BEVERAGE, WITH_FRUIT)</code></pre>


  Drink Dr. Peel's!

Occasionally something in the code will confuse Textile and you'll
have to add an extra blank line to force a line break (some trial
and error may be required), but otherwise the above approach should
work fine.

If you don't want to have to mess with YAML formatting at all, a
custom editor is really what's called for.  I believe Hobix has a
very alpha one built in, but I've not played with it yet.

> I can't really speak to this as I've never used |. I've seen YAML
> rewrite >'s as quoted strings when they're really small, which is
> kinda irritating. Maybe it's a similar thing---under what
> circumstances does this happen?

It's hardcoded in Hobix on a field-by-field basis.  Some fields get
plain strings when possible, but for others it requests that
YAML.rb always serialize with >.

Sadly, I don't think Syck provides a way to force | or I would
prefer that option.  But I could be wrong.  _why?

-mental
_______________________________________________
Hobix-is-the-way mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/hobix-is-the-way

Reply via email to