serlo / serlo-export

Export Serlo.org and Mathe für Nicht-Freaks articles into various output formats
https://de.serlo.org/
Apache License 2.0
5 stars 1 forks source link

How to deal with empty environments? #136

Open vroland opened 6 years ago

vroland commented 6 years ago

What shall we do if additional elements are present but empty, like example=|exercise=|...? Should we just ignore these or leave them and leave it to the author to use the template correctly? My point here is mostly that deleting empty template parameters is more implicit magic which might surprise us in other contexts.

kulla commented 6 years ago

This is due to using the visual editor with templates since some parameters are added as "possible parameters". Not filled in, they are left empty. My ideas:

1) Create a lint for them 2) Delete them in a sprint (here we need a statistic showing pages with these parameters)

Afterwards we can show empty exercises, examples, ... so that authors correct this in the source code (Maybe we can define the online templates in a way they show the same behavior).

vroland commented 6 years ago

Ah, so exporting empty parameters would be surprising / unexpected for users of the visual editor, right? I went for deleting them for now, to not deviate too much from wiki semantics. In MediaWiki, leaving them out and not giving them a value is the same (afaik).

There should definitely a lint for that, but I'm not quite sure if deleting them is better or worse...

kulla commented 6 years ago

I changed the template specs so that these empty parameteres shouldn't reoccur by using the visual editor. We only have carryovers from the past...