Mohit Sindhwani wrote:
Hi, this is one of my first posts in a while where I'm not asking someone to write for the Summer Reboot. I need help!

[1] Can I search for a relative page?
I am trying to convert an API document to HTML to be hosted within Radiant. The system will hold multiple versions of the original document, e.g. v1.00.00 then v1.01.00 and so on. So, it will hold numerous same-named eventual pages:
and so on. Between the pages of each version, I'd like to create links between 'file' and other pages (e.g. file and say, 'hash') but it should stay within the same version. So, /doc/v1.00/file --> /doc/v1.00/hash and /doc/v1.01/file/ and /doc/v1.01/systemcall/

Is there any way to do a search for a relative item in this sense? Or must each page definitely be linked within a specific link to that version? Or should I just do a relative 'link' (../hash) rather than doing a search.

Maybe a simple tag is in order here:

<r:sibling slug="hash"><r:link/></r:sibling>

Where the sibling tag is defined as:

tag 'sibling' do |tag| = {|s| s.slug == tag.attr['slug'] };
 tag.expand if

If you want (or can settle for) all of the sibling links, use <r:parent:children:each>.

[2] Binary Data
The other problem is more Ruby-related, I think. I'm writing a script to extract data from the Word document and then automatically create the pages. One of the pages has a 'micro' character in it (μ) and this looks OK in the text file but it doesn't show up in the pages correctly.

Any idea what I should do?

I would escape the characters into HTML entities before you write it to the page. Not sure what the 'micro' character corresponds to (or what character set it is in originally), but it should be easy to look up if you have to. Try out the CGI::escape* methods.



Radiant mailing list

Reply via email to