code-filter improvements

20 views
Skip to first unread message

Dag Wieers

unread,
Nov 24, 2011, 8:46:54 AM11/24/11
to asci...@googlegroups.com
Hi Stuart,

Can you take the changes from:

https://github.com/dagwieers/asciidoc-odf/blob/master/filters/code/code-filter.py

They add bash and ksh language support, as well as odf output support.

Thanks,
--
-- dag wieers, d...@wieers.com, http://dag.wieers.com/
-- dagit linux solutions, in...@dagit.net, http://dagit.net/

[Any errors in spelling, tact or fact are transmission errors]

Stuart Rackham

unread,
Nov 24, 2011, 2:21:26 PM11/24/11
to asci...@googlegroups.com
Hi Dag

The code filter is didactic example I wrote to illustrate how to write a filter
(http://www.methods.co.nz/asciidoc/userguide.html#X56), strictly speaking it
probably shouldn't even be in the distribution. If you want to take it further
then the best course would be to rename your enhanced version and publish it as
a filter plugin.


Cheers, Stuart

Dag Wieers

unread,
Nov 24, 2011, 3:20:01 PM11/24/11
to asci...@googlegroups.com
On Fri, 25 Nov 2011, Stuart Rackham wrote:

> The code filter is didactic example I wrote to illustrate how to write a
> filter (http://www.methods.co.nz/asciidoc/userguide.html#X56), strictly
> speaking it probably shouldn't even be in the distribution. If you want to
> take it further then the best course would be to rename your enhanced version
> and publish it as a filter plugin.

I understand.

I don't want to take it further, in fact I just finished color highlight
support for the source-highlight project for ODF output, and that is
clearly the way forward.

But for the people that try code-filter, having ODF and bash/ksh support
might be sufficient. Even if it's a didactic example ?

Dag Wieers

unread,
Nov 26, 2011, 7:30:48 PM11/26/11
to asci...@googlegroups.com
On Thu, 24 Nov 2011, Dag Wieers wrote:

> On Fri, 25 Nov 2011, Stuart Rackham wrote:
>
>> The code filter is didactic example I wrote to illustrate how to write a
>> filter (http://www.methods.co.nz/asciidoc/userguide.html#X56), strictly
>> speaking it probably shouldn't even be in the distribution. If you want to
>> take it further then the best course would be to rename your enhanced
>> version and publish it as a filter plugin.
>
> I understand.
>
> I don't want to take it further, in fact I just finished color highlight
> support for the source-highlight project for ODF output, and that is clearly
> the way forward.
>
> But for the people that try code-filter, having ODF and bash/ksh support
> might be sufficient. Even if it's a didactic example ?

I have to add to this that the AsciiDoc User Guide does use the
code-filter and therefor without these improvements added, will fail to
convert to ODF.

For that reason I would recommend adding ODF support to upstream's
code-filter.

Stuart Rackham

unread,
Nov 27, 2011, 4:55:30 PM11/27/11
to asci...@googlegroups.com

On 27/11/11 13:30, Dag Wieers wrote:
> On Thu, 24 Nov 2011, Dag Wieers wrote:
>
>> On Fri, 25 Nov 2011, Stuart Rackham wrote:
>>
>>> The code filter is didactic example I wrote to illustrate how to write a
>>> filter (http://www.methods.co.nz/asciidoc/userguide.html#X56), strictly
>>> speaking it probably shouldn't even be in the distribution. If you want to
>>> take it further then the best course would be to rename your enhanced
>>> version and publish it as a filter plugin.
>>
>> I understand.
>>
>> I don't want to take it further, in fact I just finished color highlight
>> support for the source-highlight project for ODF output, and that is clearly
>> the way forward.
>>
>> But for the people that try code-filter, having ODF and bash/ksh support might
>> be sufficient. Even if it's a didactic example ?
>
> I have to add to this that the AsciiDoc User Guide does use the code-filter and
> therefor without these improvements added, will fail to convert to ODF.
>
> For that reason I would recommend adding ODF support to upstream's code-filter.
>

Adding additional languages doesn't add anything in terms of illustrating how to
write a filter and would just encourage people to use it in production. If
someone has a burning desire to use and extend it then they should fork it and

publish it as a filter plugin.

Cheers, Stuart

Dag Wieers

unread,
Nov 27, 2011, 5:28:25 PM11/27/11
to asci...@googlegroups.com

But the result is that the AsciiDoc User Guide cannot be converted
without failure to anything other than what code-filter supports.

I'll add that to the asciidoc-odf README.

Stuart Rackham

unread,
Nov 27, 2011, 5:46:05 PM11/27/11
to asci...@googlegroups.com

Ah, I now see your point, I've removed the code filter example from the manual:

http://code.google.com/p/asciidoc/source/detail?r=942a3d5cf64002e3bf34e5d27e3a1d5726a2cdfc

Cheers, Stuart

Reply all
Reply to author
Forward
0 new messages