From: Rob M. <rob...@am...> - 2009-10-08 08:56:06
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=UTF-8" http-equiv="Content-Type"> <title></title> </head> <body bgcolor="#ffffff" text="#000000"> David Goodger wrote: <blockquote cite="mid:433...@ma..." type="cite"> <pre wrap="">On Wed, Oct 7, 2009 at 11:44, Rob Mason <a class="moz-txt-link-rfc2396E" href="mailto:rob...@am..."><rob...@am...></a> wrote: </pre> <blockquote type="cite"> <pre wrap="">I am trying to create a custom role in a reST document to do text strike-through (HTML <del></del>). I havetried workign through the docs but haven't fully gotten my head around things. I thought it should be something like the following: </pre> </blockquote> <pre wrap=""><!---->... </pre> <blockquote type="cite"> <pre wrap="">.. role:: del :prefix: :html: <del> :suffix: :html: </del> An example of using :del: `deleted deleted` </pre> </blockquote> <pre wrap=""><!---->... </pre> <blockquote type="cite"> <pre wrap="">However when I try to compile it to html I get an error: (ERROR/3) Error in "role" directive: unknown option: "prefix". </pre> </blockquote> <pre wrap=""><!----> </pre> </blockquote> Oops just realised I was looking at a prest doc a rest example (long day).<br> <blockquote cite="mid:433...@ma..." type="cite"> <pre wrap="">Why would you think there are "prefix" & "suffix" options for the "role" directive? Docs here: <a class="moz-txt-link-freetext" href="http://docutils.sourceforge.net/docs/ref/rst/directives.html#role">http://docutils.sourceforge.net/docs/ref/rst/directives.html#role</a> To get HTML <del> tags in your output would require a lot of work. If all you want is the effect though, it's easy. In your document, simply use this: """ .. role:: del An example of using :del:`deleted deleted` """ (Note that there's no space between ":del:" and the opening "`".) And in your stylesheet, add this: """ .del {text-decoration: line-through;} """ </pre> </blockquote> This will do exactly what I want. Thanks for your help.<br> <br> <br> <br> <br> </body> </html><HTML><BODY><BR><P><hr size=1></P> <P> <i>This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. </i><BR> </P></BODY></HTML> |