You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The let fields = doc.infobox(0).json() returns a json where the infobox keys are exactly those in the wikitext (coach: { text: 'Darko Rajaković', links: [ [Object] ] },).
Also trying wtf-plugin-html it seems the rendered keys are the same capitalized and cleaned.
But looking at the wikipedia page the coach entry is actually Head Coach.
The step missing is the one that looks at the infobox template and adjust key names for rendering.
Is this feature missing or I did something wrong?
The text was updated successfully, but these errors were encountered:
You know what, I find this very confusing too.
You can see this library simply grabs whatever's in the wikitext, and the names of the keys are speced in the template documentation.
But yeah, there seems to be a ton of formatting that is done by wikipedia at render-time. These formatting rules don't appear to be anywhere in wikipedia-land, and must be in the source-code of the parsoid Html renderer. I've looked around before, and come up with nothing. Please let me know if you can find where this logic is stored, and if it is available to be re-used in projects like this one.
yeah, as you found, the wtf-plugin-html doesn't do anything clever, but really should.
cheers
out of curiosity I took a look at this and being a noob in all of this it seems to me that wikipedia is a cascade of templates in templates and the specifically mentioned key is coming from a "sub-template"
I was trying the
Toronto Raptors
example.The
let fields = doc.infobox(0).json()
returns a json where the infobox keys are exactly those in the wikitext (coach: { text: 'Darko Rajaković', links: [ [Object] ] },
).Also trying
wtf-plugin-html
it seems the rendered keys are the same capitalized and cleaned.But looking at the wikipedia page the
coach
entry is actually Head Coach.The step missing is the one that looks at the infobox template and adjust key names for rendering.
Is this feature missing or I did something wrong?
The text was updated successfully, but these errors were encountered: