[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Libguestfs] [PATCH 2/3] gobject: Wrap literal sections in POD in CDATA sections



On Thu, Apr 26, 2012 at 11:44:51AM +0100, Matthew Booth wrote:
> ---
>  generator/generator_gobject.ml |    5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/generator/generator_gobject.ml b/generator/generator_gobject.ml
> index 48ddbf0..479e34d 100644
> --- a/generator/generator_gobject.ml
> +++ b/generator/generator_gobject.ml
> @@ -765,6 +765,7 @@ guestfs_session_close(GuestfsSession *session, GError **err)
>    let api_crossref = Str.regexp "C<guestfs_\\([-_0-9a-zA-Z]+\\)>" in
>    let nonapi_crossref = Str.regexp "C<\\([-_0-9a-zA-Z]+\\)>" in
>    let escaped = Str.regexp "E<\\([0-9a-zA-Z]+\\)>" in
> +  let literal = Str.regexp "\\(^\\|\n\\)[ \t]+\\([^\n]*\\)\\(\n\\|$\\)" in
>  
>    List.iter (
>      fun (name, (ret, args, optargs as style), _, flags, _, shortdesc, longdesc) ->
> @@ -807,6 +808,10 @@ guestfs_session_close(GuestfsSession *session, GError **err)
>            fun s ->
>              "&" ^ Str.matched_group 1 s ^ ";"
>          ) longdesc in
> +      let longdesc = Str.global_substitute literal (
> +          fun s ->
> +            "\n <![CDATA[" ^ Str.matched_group 2 s ^ "]]>\n"
> +        ) longdesc in
>        let doc = pod2text ~width:76 name longdesc in
>        let doc = String.concat "\n * " doc in
>        let camel_name = camel_of_name flags name in
> -- 
> 1.7.10

ACK.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
libguestfs lets you edit virtual machines.  Supports shell scripting,
bindings from many languages.  http://libguestfs.org


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]