zalambar
Obsidian Portal users should be accustomed to writing textile and are likely to create textile based input via applications which take advantage of the API. As application authors we don't and shouldn't need to know which version of which textile parser Obsidian Portal is currently using or what the filtering rules applied to inline html currently are. However it would be nice to allow our application's users to preview content they are about to submit.
Therefore I would like to see an API call which accepts text input and returns whatever html results from parsing the input as textile and applying whatever restrictions on inline HTML Obsidian Portal currently thinks are necessary. I think it would make sense for that response to be a full html page and include at least a reasonable set of stylesheets for the default look and feel of html elements on the Obsidian Portal website. However even a context free snippet of html might be helpful in allowing applications to preview the structure of the content a user is attempting to post.
Comments
Just trying to help out.
p. The allows HTML tag and attribute list is available at "http://www.obsidianportal.com/tutorials/allowed-html-tags":http://www.obsidianportal.com/tutorials/allowed-html-tags but again I expect that to change over time. If someone convinces Micah to allow ==no == tags (not currently in the allowed list) then I don't want any users of my app to become frustrated that they cannot add audio elements to their pages via my application because I failed to keep up with changes to that list.
p. Playing around with the idea for this request I think I'm looking for something like the following:
h3. Request
*URL:* http://api.obsidianportal.com/v1/preview
*HTTP Verb:* POST
*Requires Authentication:* whatever
_Request Body_
@{
'body' : 'textile and raw html to preview'
'campaign_id' : 'optional, the campaign to evaluate this content within allowing the preview to include campaign specific styling or markup restricted to ascendant campaigns.'
'type' : 'optional, Post/WikiPage/Character/whatever if we're going to need to consider different rules for different types of editable content'
}@
_Response_
@{
'body' : 'textile version of the preview which would be saved by OP, may have escaped forbidden markup or stripped forbidden attributes'
'body_html' : 'html formatted version of the body'
'stylesheets' : [array of stylesheet urls which will apply to this content]
'errors' : {
notify the requestor of content escaped or stripped from the body
}
}@