Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support transclusions #72

Open
zverok opened this issue Oct 1, 2016 · 0 comments
Open

Support transclusions #72

zverok opened this issue Oct 1, 2016 · 0 comments

Comments

@zverok
Copy link
Contributor

zverok commented Oct 1, 2016

page = Infoboxer.wp.get('List_of_The_Simpsons_episodes_(seasons_1–20)')
page.sections('Episodes').sections.first.templates
# => [#<Template[main article](1: "The Simpsons (season 1)")>, #<Template[](1: "The Simpsons (season 1)")>]

The last one is understood as nameless template, with first vairable eq to "The Simpsons (season 1)". In fact, if you look in the page code, you'll see {{:The Simpsons (season 1)}}, which is "transclude page named The Simpsons (season 1)", and should be represented somewhat like #<TranscludedTemplate[The Simpsons (season 1)]>

And, in any case, nameless templates is not a thing and should fail early if found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant