odf2xhtml (and other xslt filters) - tabs or spaces?

classic Classic list List threaded Threaded
12 messages Options
Samuel Mehrbrodt-3 Samuel Mehrbrodt-3
Reply | Threaded
Open this post in threaded view
|

odf2xhtml (and other xslt filters) - tabs or spaces?

Hi,

our xhtml export originally used tabs for indentation. Over time some
changes were made which were indented with spaces.
So currently it's a mix of both. I'd like to unify it and as the
majority was tabs, I converted all to tabs:
https://gerrit.libreoffice.org/#/c/41009/

Miklos suggested to convert all to 4 spaces instead as we do in C++
code.The downside is that converting to spaces touches almost all lines,
while this touches only a few.

Are there any opinions on this?

Thedecision should then be applied to all xslt filters in
filter/source/xslt. The situation looks to be the same for othersthere
(mainly tabs, mixed with a few spaces).

Thanks
Samuel

--
Samuel Mehrbrodt
Softwareentwickler LibreOffice
–––
CIB software GmbH
Geschäftsstelle Hamburg
Flachsland 10
22083 Hamburg
–––
T +49 (40) / 28 48 42 -224
F +49 (40) / 28 48 42 -100

[hidden email]
www.cib.de
–––
Sitz: München
Registergericht München, HRB 123286
Geschäftsführer: Dipl.-Ing. Ulrich Brandner
_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
sberg sberg
Reply | Threaded
Open this post in threaded view
|

Re: odf2xhtml (and other xslt filters) - tabs or spaces?

On 09/06/2017 04:16 PM, Samuel Mehrbrodt wrote:
> our xhtml export originally used tabs for indentation. Over time some
> changes were made which were indented with spaces.
> So currently it's a mix of both. I'd like to unify it and as the
> majority was tabs, I converted all to tabs:
> https://gerrit.libreoffice.org/#/c/41009/
>
> Miklos suggested to convert all to 4 spaces instead as we do in C++
> code.The downside is that converting to spaces touches almost all lines,
> while this touches only a few.

So this is about tabs in the XSLT source code, not in the generated
XHTML?  I'd agree with Miklos that it's better to clean up such source
code to use spaces instead of tabs.
_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
Samuel Mehrbrodt-3 Samuel Mehrbrodt-3
Reply | Threaded
Open this post in threaded view
|

Re: odf2xhtml (and other xslt filters) - tabs or spaces?


> So this is about tabs in the XSLT source code, not in the generated
> XHTML?
Correct.
_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
Thorsten Behrens-6 Thorsten Behrens-6
Reply | Threaded
Open this post in threaded view
|

Re: odf2xhtml (and other xslt filters) - tabs or spaces?

In reply to this post by Samuel Mehrbrodt-3
Samuel Mehrbrodt wrote:
> Are there any opinions on this?
>
Your call I'd say. I see disadvantages for both ways - just that the
status quo inconsistency is a real irritation.

Personally I value working git blame & history over tree-wide
consistency (that we don't have anyway). Note that the original
tab2space conversion was done as a silent git rewrite, so not losing
history. In conclusion: no clear winner for me, doers decide.

Cheers,

-- Thorsten

_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice

signature.asc (968 bytes) Download Attachment
sberg sberg
Reply | Threaded
Open this post in threaded view
|

Re: odf2xhtml (and other xslt filters) - tabs or spaces?

On 09/06/2017 06:34 PM, Thorsten Behrens wrote:
> consistency (that we don't have anyway). Note that the original
> tab2space conversion was done as a silent git rewrite, so not losing

Ah, that's a good point.  Shame we missed some types of source files
back then...
_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
Jan Holesovsky-4 Jan Holesovsky-4
Reply | Threaded
Open this post in threaded view
|

Re: odf2xhtml (and other xslt filters) - tabs or spaces?

In reply to this post by Samuel Mehrbrodt-3
Hi Samuel,

Samuel Mehrbrodt píše v St 06. 09. 2017 v 14:16 +0000:

> Miklos suggested to convert all to 4 spaces instead as we do in C++
> code.The downside is that converting to spaces touches almost all
> lines,
> while this touches only a few.
>
> Are there any opinions on this?

I'd agree with Miklos.  It's true that git blame is less useful then,
but we are doing large cleanups all over the place anyway, so I don't
think a larger diff is a huge problem.

But about the filter in general - please, what are the features that
the xhtml export filter can do that our 'normal' html filter cannot?

I wonder, rather than debugging / writing xslt, wouldn't it be better
to extend our html export so that it can generate xhtml if asked to (we
already fulfill many of the requirements there anyway - seems to me),
and kill the xslt filter? ;-)

All the best,
Kendy
_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
Miklos Vajna-4 Miklos Vajna-4
Reply | Threaded
Open this post in threaded view
|

Re: odf2xhtml (and other xslt filters) - tabs or spaces?

Hi,

On Tue, Sep 12, 2017 at 05:44:04PM +0200, Jan Holesovsky <[hidden email]> wrote:
> I'd agree with Miklos.  It's true that git blame is less useful then,

As long as the changes are really just whitespace, you can use 'git
blame -w' to ignore those.

Regards,

Miklos

_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice

signature.asc (188 bytes) Download Attachment
Samuel Mehrbrodt-3 Samuel Mehrbrodt-3
Reply | Threaded
Open this post in threaded view
|

Re: odf2xhtml (and other xslt filters) - tabs or spaces?

In reply to this post by Jan Holesovsky-4
Am 12.09.2017 um 17:44 schrieb Jan Holesovsky:
But about the filter in general - please, what are the features that
the xhtml export filter can do that our 'normal' html filter cannot?

I wonder, rather than debugging / writing xslt, wouldn't it be better
to extend our html export so that it can generate xhtml if asked to (we
already fulfill many of the requirements there anyway - seems to me),
and kill the xslt filter? ;-)

I don't know in detail what the differences are, but notice that odf2xhtml is not our only xslt filter.
There is also UOF import/export and some other smaller pieces.

But sure, "we" can maybe teach the html export to also handle xhtml. But in this case "we" means anyone but me ;)

Regards
Samuel

_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
Samuel Mehrbrodt-3 Samuel Mehrbrodt-3
Reply | Threaded
Open this post in threaded view
|

Re: odf2xhtml (and other xslt filters) - tabs or spaces?

In reply to this post by Samuel Mehrbrodt-3
So it seems the general consent is to move ahead with spaces instead of
tabs.

I updated the patch accordingly, and applied it to all XSLT files:
https://gerrit.libreoffice.org/#/c/41009/

I wonder whether we should credit such patches to a virtual "Cleanup"
author, so we don't spoil the stats with such commits?

Regards
Samuel


Am 06.09.2017 um 16:35 schrieb Samuel Mehrbrodt:

> Hi,
>
> our xhtml export originally used tabs for indentation. Over time some
> changes were made which were indented with spaces.
> So currently it's a mix of both. I'd like to unify it and as the
> majority was tabs, I converted all to tabs:
> https://gerrit.libreoffice.org/#/c/41009/
>
> Miklos suggested to convert all to 4 spaces instead as we do in C++
> code.The downside is that converting to spaces touches almost all lines,
> while this touches only a few.
>
> Are there any opinions on this?
>
> Thedecision should then be applied to all xslt filters in
> filter/source/xslt. The situation looks to be the same for othersthere
> (mainly tabs, mixed with a few spaces).
>
> Thanks
> Samuel
>

_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
Jan Holesovsky-4 Jan Holesovsky-4
Reply | Threaded
Open this post in threaded view
|

Re: odf2xhtml (and other xslt filters) - tabs or spaces?

In reply to this post by Samuel Mehrbrodt-3
Hi Samuel,

Samuel Mehrbrodt píše v Čt 14. 09. 2017 v 14:17 +0000:

> > I wonder, rather than debugging / writing xslt, wouldn't it be
> > better
> > to extend our html export so that it can generate xhtml if asked to
> > (we
> > already fulfill many of the requirements there anyway - seems to
> > me),
> > and kill the xslt filter? ;-)
>  
> I don't know in detail what the differences are, but notice that
> odf2xhtml is not our only xslt filter.
> There is also UOF import/export and some other smaller pieces.
>
> But sure, "we" can maybe teach the html export to also handle xhtml.
> But in this case "we" means anyone but me ;)

That's fine; as long as you don't object the direction of 'kill the
xhtml xslt export filter at some stage' I'm happy :-)

All the best,
Kendy
_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
sberg sberg
Reply | Threaded
Open this post in threaded view
|

Re: odf2xhtml (and other xslt filters) - tabs or spaces?

In reply to this post by Samuel Mehrbrodt-3
On 09/14/2017 04:24 PM, Samuel Mehrbrodt wrote:
> I wonder whether we should credit such patches to a virtual "Cleanup"
> author, so we don't spoil the stats with such commits?

I would not do so.  When you do a change, whatever change, you're
responsible for that, with all consequences, positive and negative.  :)
_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
Samuel Mehrbrodt-3 Samuel Mehrbrodt-3
Reply | Threaded
Open this post in threaded view
|

Re: odf2xhtml (and other xslt filters) - tabs or spaces?

Am 14.09.2017 um 17:29 schrieb Stephan Bergmann:
I would not do so.  When you do a change, whatever change, you're 
responsible for that, with all consequences, positive and negative.  :)
Ok :)

So if I see no veto either here or in Gerrit until monday, I'll merge the patch.

Thanks
Samuel

_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice