Closed vincenzobaz closed 3 years ago
According to spec title is mandatory:
The sidebar key is mandatory, as well as title for each element.
I know there is a bug that actually ignored the title property and if there was not header inside markdown file itself, it took its name as title.
I can either:
title
property in sidebar.yml
to be optional and set hierarchy to:
sidebar.yml
title
property in sidebar.yml
to be optional and set hierarchy to:
sidebar.yml
The second option seems doable, but I'm not sure if we have all the data at the right moment, will confirm that.
@vincenzobaz @pikinier20 @romanowski what do you think about that?
I do not like sidebar.yaml in first place:) I lean towards 1st option.
As the title can be specified in the frontmatter or derived by the filename, I think that the title
property in sidebar.yml
should not be mandatory. Thus, the first 2 proposals seem viable.
I prefer the second option because I believe that the title the closest to content (in the frontmatter) should have priority over the one defined in sidebar.yml
. This file should contain information about the position of the page and the order of the pages in the sidebar, but using it to rename pages does not feel very natural to me. In other words sidebar.yml
is about structure, not content.
There is a third option which does not rely on scaladoc to make a decision and which consists in throwing an error if the title is specified in both locations, which I could endorse as well.
Similarly to @romanowski, I am not particularly fond of sidebar.yml
first of all because it is yaml and then because of how url are specified in it: in the spec it looks like we are giving urls to the generated html, while I would prefer giving paths to the source markdowns.
However I think that a configuration file is necessary and useful and could contain more information used to generate the site like the JSON versions location, markdown-accessible variables, scaladoc version as well as structure of the sidebar
Compiler version
3.0.0
Description
Given the problem in #12969 , I use the
title
frontmatter property to specify the label appearing in the sidebar. Therefore I do not need thetitle
property in sidebar.yml anymore. However if I only useurl
s in sidebar.yml (which I need to specify the order of elements in the sidebar), the documentation generation error fails withExpectation
If no
title
is specified in sidebar.yml, scaladoc shouldtitle
is present in the frontmatter of the markdown file specified inurl
and use thattitle
is not present in the frontmatter of the markdown specified inurl
, generate a title from the filename