On Thu, 14 Jun 2018 08:53:19 +1000
Peter Hutterer <peter.hutte...@who-t.net> wrote:

> On Wed, Jun 13, 2018 at 04:32:24PM +0300, Pekka Paalanen wrote:
> > From: Pekka Paalanen <pekka.paala...@collabora.co.uk>
> > 
> > Before, the code examples looked good in the file, but a hard tab was
> > rendered as 4 spaces by Gitlab.
> > 
> > Now, Gitlab renders the code examples like they should look, with 8-wide
> > tabs, but the file looks awful.
> > 
> > Signed-off-by: Pekka Paalanen <pekka.paala...@collabora.co.uk>
> > ---
> > 
> > Is it better with or without this patch?  
> 
> IMO it's worse, it makes the source file unreadable.
> 
> Depends who you consider the main reference, the .md file itself or the
> online rendered one. I don't know if there's a clear preference for either.
> fwiw, I opted for replacing all tabs with spaces in the libinput
> CODING_STYLE document (i.e. make the rendered one look correct), with this
> warning at the top:
> 
> **Note: this file uses spaces due to markdown rendering issues for tabs.
>   Code must be implemented using tabs.**

Hi Peter,

I like that idea, I'll go for it.

Also, I used the <pre> tags because &#9; at least worked with them. I
didn't try &#9; with ``` if it'd work, but I do like ``` more than
<pre>.


Thanks,
pq

> 
> Cheers,
>    Peter
> 
> > 
> > You can see the result in:
> > https://gitlab.freedesktop.org/pq/wayland/blob/61f169d24af699643708d22f728890151994d05e/CONTRIBUTING.md
> > 
> >  CONTRIBUTING.md | 36 ++++++++++++++++++------------------
> >  1 file changed, 18 insertions(+), 18 deletions(-)
> > 
> > diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
> > index b22fdef..0c2990e 100644
> > --- a/CONTRIBUTING.md
> > +++ b/CONTRIBUTING.md
> > @@ -134,19 +134,19 @@ try to follow the rules below.
> >  static int
> >  my_function(void)
> >  {
> > -   int a = 0;
> > -
> > -   if (a)
> > -           b();
> > -   else
> > -           c();
> > -
> > -   if (a) {
> > -           b();
> > -           c();
> > -   } else {
> > -           d();
> > -   }
> > +&#9;int a = 0;
> > +
> > +&#9;if (a)
> > +&#9;&#9;b();
> > +&#9;else
> > +&#9;&#9;c();
> > +
> > +&#9;if (a) {
> > +&#9;&#9;b();
> > +&#9;&#9;c();
> > +&#9;} else {
> > +&#9;&#9;d();
> > +&#9;}
> >  }
> >  </pre>
> >  
> > @@ -158,12 +158,12 @@ my_function(void)
> >    sense;
> >  
> >  <pre>
> > -   long_variable_name =
> > -           function_with_a_really_long_name(parameter1, parameter2,
> > -                                            parameter3, parameter4);
> > +&#9;long_variable_name =
> > +&#9;&#9;function_with_a_really_long_name(parameter1, parameter2,
> > +&#9;&#9;&#9;&#9;&#9;&#9; parameter3, parameter4);
> >  
> > -   x = function_with_a_really_long_name(parameter1, parameter2,
> > -                                        parameter3, parameter4);
> > +&#9;x = function_with_a_really_long_name(parameter1, parameter2,
> > +&#9;&#9;&#9;&#9;&#9;     parameter3, parameter4);
> >  </pre>
> >  
> >  Conduct
> > -- 
> > 2.16.4
> > 
> > _______________________________________________
> > wayland-devel mailing list
> > wayland-devel@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/wayland-devel
> >   

Attachment: pgpY4JV77Feqh.pgp
Description: OpenPGP digital signature

_______________________________________________
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to