3

I was trying to edit a topic, and to condense two examples that existed for two separate versions into the same one, differentiating between versions inline. However, I got this message:

enter image description here

Am I doing it wrong (I also noticed inline versioning is not showing up in the preview), or is this a bug?

2

1 Answer 1

4

According to the Markdown help article:

For Documentation with multiple groups of versions (ie. .NET, which has Core and Micro Frameworks), you must include the group name in the HTML comment before the conditional.

<!-- if version <Named Framework> [gte 2.0] -->
Content relevant to Named Framework versions 2.0 and greater.
<!-- end version if -->

Since Python has 3.x and 2.x version groups, you need to add the group:

<!-- if version <Python 2.x> [gte 2.3] -->

print('Hello, world')

<!-- end version if -->

Hello Python 2.x

I don't think ranges work with version groups, however.


The other thing to note is that the version has to match the list of versions in the introductory topic at the time the topic is submitted. Since many minor versions were removed from the Python tag, it may be necessary to edit versions that already exist in an example even if that's not the edit you'd planned to make.

2
  • I added a link to some stuff outside of any version groups and I received this error. Commented Jul 23, 2016 at 22:17
  • Yes, made a trivial edit to a page but had to change someone else's <!-- if version --> tag from 2.7.11 (which was valid at some point) to 2.7 which is now the Python tag. Similarly, changed 3.0.0 to 3.0 and it worked without this annoying pop-up.
    – rajah9
    Commented Jul 25, 2016 at 14:44

Not the answer you're looking for? Browse other questions tagged .