Utilisader:Alex brollo/Interproject visualization
The idea
modifitgarWikisource has a double nature, a "typography" and a "library". While the former is very complex and intriguing, and it needs extensions, templates, scripts and some not so banal user skills, the latter can be seen simply as a repository of html pages, that can be exported and visualized by an ajax call.
It is possible to import html by an ajax API interproject call, then to append it to the html code of current page, so visualizing its contents.
To automatyze the whole thing something is needed, just to give an appropriate signal to a background script:
- a "trigger", t.i. something that the script can recognize; it could be simply a special prefix of page name;
- a "target", t.i. the name of the page to import;
- an optional "placeholder", t.i. a containter where to append imported html.
An old and time-honoured script is running into wikisource projects and it allows "interwiki transclusion", t.i. visualization pf pages coming from another wikisource project. In that case, all the tree signals (trigger, target and placeholder) are built partially or completely inside some special templates.
Test
modifitgarSome test is running here, using these signals:
- trigger: page name prefix; presently
Itwikisource:
, a "pseudonamespace); - target: what follows page name prefix; presently source project defaults to it.wikisource;
- placeholder: none.
To browse into itwikisource romansh texts you can start from here: Lista di testi in romancio
How to run test script
modifitgarSimply add to your personal common.js or vector.js this row of code:
importScript("Utilisader:Alex_brollo/common.js");
Then click Lista di testi in romancio and follow any link.
Please note:
- links don't create any page into rmwikipedia; what you'll see following a link is an unexistent page, filled of contents by transclusion from itwikisource;
- any "blue" link into transcluded pages will open new Itwikisource: self-transcluding pages;
- any "red" link will bring you back to it.wikisource;
- optionally you can create an empty, better: an almost empty Itwikisource: page, trasclusion will be added to page code display if any.