Page MenuHomePhabricator

Make section_heading part of the reference_list
Closed, ResolvedPublic

Description

Move section_heading to the corresponding reference_list object.
Only add reference_list if the section is empty after the heading and reference_list content are removed.
We still want to keep all the references_by_id entries, regardless of whether they show up in a reference list or not since we need that quick lookup still to work.

Previously we had separate objects for section_heading, like this:

"reference_lists": [
  {
    "type": "section_heading",
    "id": "References",
    "html": "References"
  },
  {
    "type": "reference_list",
    "id": "#mwt4",
    "order": [
      "ref2-1"
    ]
  }
],

Now we want to make the section_heading part of the reference_list, like that:

"reference_lists": [
  {
    "type": "reference_list",
    "id": "#mwt4",
    "section_heading": {
      "id": "References",
      "html": "References"
    },
    "order": [
      "ref2-1"
    ]
  }
]

Event Timeline

Change 420846 had a related patch set uploaded (by BearND; owner: BearND):
[mediawiki/services/mobileapps@master] References: make section_heading part of reference_list

https://gerrit.wikimedia.org/r/420846

@Fjalapeno Occasionally there's more content after the {{reflist}} template usage but not a new section. Scroll to end of https://en.wikipedia.org/w/index.php?title=List_of_highest-grossing_Indian_films&action=edit. You'll see a couple of navlist templates used. I think the categories at the end should be fine since they are invisible.

Since there is only one type left, reference_list, I think we could remove the type altogether. Thoughts?

Removing type seems fine to me. For the content at the bottom of the page (categories and navlist) are you suggesting we just leave them in becuase they are invisible?

Ok, I'm going to remove the type field.

About the other comment: I guess the reason why on this page the navbox is still considered visible it because the transform to remove it hasn't run by then. I can look into that. Longer-term I'm not sure that we'd want to keep removing navboxes, though.

Change 421092 had a related patch set uploaded (by BearND; owner: BearND):
[mediawiki/services/mobileapps@master] References: remove type in reference_lists

https://gerrit.wikimedia.org/r/421092

Change 420846 merged by jenkins-bot:
[mediawiki/services/mobileapps@master] References: make section_heading part of reference_list

https://gerrit.wikimedia.org/r/420846

Change 421092 merged by jenkins-bot:
[mediawiki/services/mobileapps@master] References: remove type in reference_lists

https://gerrit.wikimedia.org/r/421092