Convert tabs to spaces in docbook
ClosedPublic

Authored by rkflx on Feb 15 2018, 9:11 AM.

Details

Summary

Tabs in the docbook often cause contributor's editors to introduce
accidental whitespace changes. It was agreed to change to spaces like in
most other files.

This also corrects a problem where there were tabs inside the content.

Thanks to @gregormi for the initial version of the patch.

Test Plan

checkXML5 index.docbook

Diff Detail

Repository
R166 Spectacle
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
gregormi requested review of this revision.Feb 15 2018, 9:11 AM
gregormi updated this revision to Diff 27216.
gregormi created this revision.
  • remove odd spaces
gregormi retitled this revision from convert tabs to spaces to docbook file: convert tabs to spaces.
rkflx added subscribers: ngraham, lueck, rkflx.

@lueck Any tips on what's the preferred way to format a docbook? Or should we just keep the tabs and watch out for accidental changes?

(Note you have to set Revision ContentsHistoryWhitespace Changes to "Show All" to see all changes.)

FWIW, @ngraham also suggested to convert tabs to spaces in D10469#inline-49361.

However, I looked around and there are vastly different styles:

  • Okular: tabs
  • Gwenview, Dolphin: no indentation at all
  • Proposed Spectacle patch: spaces

I think tabs -> spaces seems sensible enough. We might as well follow what the rest of Spectacle and KDE's code does (mostly spaces). And if Dolphin's docbook has no indentation, that's just weird and wrong.

doc/index.docbook
323

Was the change to break this up onto multiple lines intentional?

I don't think that we have specific guidelines for spaces vs tabs in docbook files, but I think that @lueck and @yurchor may remember better.

I don't think that we have specific guidelines for spaces vs tabs in docbook files, but I think that @lueck and @yurchor may remember better.

Do not remember this either. However, consistently formatted docbooks look very nice to me. :)

I don't think that we have specific guidelines for spaces vs tabs in docbook files, but I think that @lueck and @yurchor may remember better.

We never had guidelines wrt indentation with tabs / spaces or no indentation.
But please keep the style consistent in each documentation.

Okay, let's go for spaces then. We are not the only one.

doc/index.docbook
323

@gregormi This should be fixed, i.e. remove the linebreaks. Looks like if there were some inline tabs too, those could be removed as well.

Other than that, I think you've catched all tabs.

ngraham requested changes to this revision.Feb 17 2018, 3:26 PM

Once you fix the unnecessary line break issue, this can land.

This revision now requires changes to proceed.Feb 17 2018, 3:26 PM
rkflx updated this revision to Diff 29047.Mar 8 2018, 10:18 PM
rkflx retitled this revision from docbook file: convert tabs to spaces to Convert tabs to spaces in docbook.
rkflx edited the summary of this revision. (Show Details)
rkflx edited the test plan for this revision. (Show Details)
rkflx added a subscriber: gregormi.
  • Rebase (actually I redid the whole thing, because XML merge conflicts over the whole file are horrible...)
  • Correct inline tabs
  • Reword commit message
rkflx commandeered this revision.Mar 8 2018, 10:19 PM
rkflx added a reviewer: gregormi.
rkflx added a comment.EditedMar 8 2018, 10:23 PM

@ngraham Looks good on Phab to me now (with "Show All" in the whitespace settings).

ngraham accepted this revision.Mar 8 2018, 10:27 PM

Me too!

This revision is now accepted and ready to land.Mar 8 2018, 10:27 PM
This revision was automatically updated to reflect the committed changes.
Restricted Application added a subscriber: kde-doc-english. · View Herald TranscriptMar 14 2018, 12:15 AM