[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250613174203.1bcdf4bc@sal.lan>
Date: Fri, 13 Jun 2025 17:42:03 +0200
From: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
To: Donald Hunter <donald.hunter@...il.com>
Cc: Linux Doc Mailing List <linux-doc@...r.kernel.org>, Jonathan Corbet
<corbet@....net>, "Akira Yokosawa" <akiyks@...il.com>, "Breno Leitao"
<leitao@...ian.org>, "David S. Miller" <davem@...emloft.net>, "Eric
Dumazet" <edumazet@...gle.com>, "Ignacio Encinas Rubio"
<ignacio@...cinas.com>, "Jan Stancek" <jstancek@...hat.com>, "Marco Elver"
<elver@...gle.com>, "Paolo Abeni" <pabeni@...hat.com>, "Ruben Wauters"
<rubenru09@....com>, "Shuah Khan" <skhan@...uxfoundation.org>,
joel@...lfernandes.org, linux-kernel-mentees@...ts.linux.dev,
linux-kernel@...r.kernel.org, lkmm@...ts.linux.dev, netdev@...r.kernel.org,
peterz@...radead.org, stern@...land.harvard.edu
Subject: Re: [PATCH v2 09/12] docs: sphinx: add a parser template for yaml
files
Em Fri, 13 Jun 2025 14:26:44 +0200
Mauro Carvalho Chehab <mchehab+huawei@...nel.org> escreveu:
> > > +
> > > + supported = ('yaml', 'yml')
> >
> > I don't think we need to support the .yml extension.
>
> Ok, will drop "yml".
"supported" is not just extensions. It is a list of aliases for the
supported standard (*), like:
supported = ('rst', 'restructuredtext', 'rest', 'restx', 'rtxt', 'rstx')
"""Aliases this parser supports."""
(*) see: https://www.sphinx-doc.org/en/master/_modules/docutils/parsers/rst.html
Anyway, I tried with:
supported = ('yaml')
but it crashed with:
sphinx.errors.SphinxError: Source parser for yaml not registered
On my tests, if "supported" set has just one element, it crashes.
On this specific case, this, for instance, works:
supported = ('yaml', 'foobar')
Anyway, not worth spending too much time on it, as it could be
a bug or a feature at either docutils or sphinx. As we want it to
work with existing versions, I'll keep it as:
supported = ('yaml', 'yml')
at the next version.
> > > +def setup(app):
> > > + """Setup function for the Sphinx extension."""
> > > +
> > > + # Add YAML parser
> > > + app.add_source_parser(YamlParser)
> > > + app.add_source_suffix('.yaml', 'yaml')
> > > + app.add_source_suffix('.yml', 'yaml')
> >
> > No need to support the .yml extension.
Dropping .yml works here. So, here I'll keep just:
# Add YAML parser
app.add_source_parser(YamlParser)
app.add_source_suffix('.yaml', 'yaml')
Regards,
Mauro
Powered by blists - more mailing lists