Transclude a mediawiki page's content list to another page - mediawiki

I wrote a simple book using Mediawiki. It has 10 chapters and a chapter in a page.
I want to create a page named index, and make every page's content list in this index page.
example: Python document
what should I do?

If you put all chapters in subpages, i.e., "Book name/chapter name", then you can transclude Special:Prefixindex: {{Special:Prefixindex/Book name/}}

Related

how to show a Shopify's page text in a customized product tab

I have created custom tabs on my products page in Shopify.
How can I insert a code that basically says: the content that goes here is = to the html content of this Shopify page?
With custom tabs, I'm basically adding the text one-by-one in each product. However, if I ever changed something to my shipping policy, I would have to go back into each product one-by-one, to update the shipping tabs.
I would like to have the content on a shopify page, so when I edit that content, all the custom tabs on each product will copy the same content.
Thank you!
So You want to create one area for all products if edit in that area then content will automatically updated for all products? If Yes then you have to do custom code in your product template.
First of all You have to create a section in your product template using shopify schema and get this section value in product template.
After that when you update content in your created area it will automatically for your all products.
It will be more easy for you if you having knowledge about Shopify Liquid code, Html etc.
If you don't know about liquid code then you can hire person which know about liquid code.
Also Please let me know if you have any other query. I am happy to help you. Thanks !!!!
Basically you need to go into your product section and in the schema code you need define a new area page (https://shopify.dev/docs/themes/settings#page) like this
{
"type": "page",
"id": "id",
"label": "Text",
"info": "Text"
}
After this in the TAB call this schema by its id and add the content.
Thanks

MediaWiki API: Linked pages for a given page

Using the MediaWiki API, is it possible to retrieve a list of page titles associated with a page of a given name via outlinks? For instance, assume that there is a page called "Cat" in my MediaWiki installation which has the contents
Cats hate dogs, but love mice.
where links to to other pages are in bold. Is there an API call which would return a list of titles of the linked pages (i.e. "Dog" and "Mouse")?
You want prop=links, eg: https://en.wikipedia.org/w/api.php?action=query&prop=links&titles=Dog
docs: https://www.mediawiki.org/wiki/API:Properties#links_.2F_pl

mediawiki api. how to chose page from response

When I make api query sometimes I have list with few pages. For example
http://en.wikipedia.org/wiki/Ask gives a lot of pages, I need website "Ask.com, a web search engine, formerly Ask Jeeves"
can I make query only for some category ("websites")?
How I can check category for each page in response?
Thanks
There is no trivial way to do what you're asking. You could do something like this:
Get the list of pages the disambiguation page list. You could do this by listing the links on that page (action=query&prop=links).
Get the categories of all the pages from the previous step and use that to decide which one is the one you're looking for. This is not that simple, because Ask.com is not directly in Category:Websites, it's in one of its subcategories.
I have list with few pages, for example http://en.wikipedia.org/wiki/Ask
The problem is that you're not getting a list of pages, you just are getting an ordinary page which is in the disambiguation pages category. To get the list, you need to get the links in that page.
can I make query only for some category ("websites")?
No, mediawiki does not support that.
How I can check category for each page in response?
Use the links property as a title list generator and get the categories of each page in the response. In your case, that would be http://en.wikipedia.org/w/api.php?action=query&titles=Ask&generator=links&prop=categories (don't forget to continue the query).
If you are OK with "full-text search" for "ask",
you can do that like this:
http://en.wikipedia.org/w/api.php?format=json&action=query&generator=search&gsrsearch=ask%20incategory:%22Online%20companies%22&prop=info
As you can see, "search" text is [ask incategory:"Online companies"]
The same solution also can be seen at:
Wikipedia API: how to search for a term in a specific category

How to create a PDF in reStructuredText?

The documentation for the uncertainties Python package is written in reStructuredText, for the Sphinx documentation system. The HTML looks fine. I would like to create a PDF version. The goal is to have a "chapter" for each of the web page.
However, what happens is that the PDF generated by the ReST files transforms the (HTML) sections of index.html into individual chapters (which I don't want: the PDF should have them as sections too). Another problem is that all HTML pages after the main page appear in the PDF as subsections of the section where the toctree directive appears (i.e., in the Acknowledgment section of the main page).
So, how should the ReST file be structured so that (1) the web documents look the same as they are now, and (2) each web page corresponds to a PDF chapter. Any help would be much appreciated!
There is a solution. If I remember correctly, the key points were:
Use a special Table of Contents as the master document (I used index_TOC.rst instead of the default index.rst): in conf.py
master_doc = 'index_TOC'
latex_documents = [('index_TOC', 'uncertaintiesPythonpackage.tex',…]
The new Table of Contents file index_TOC.rst contains a ToC like
TOC
===
.. toctree::
:hidden:
:maxdepth: 1
index
user_guide
numpy_guide
tech_guide
Thus, the web version still opens onto the main index.rst text, and the PDF (LaTeX) version has each ReST file in a separate chapter.

Transclude a category in MediaWiki

I'm not quite sure if this is possible in MediaWiki.
I've got several categories, each containing a few pages. If you open a category page you'll see the contents of the category that usualy consists of these three parts:
A user defined text (which can be edited by using the edit link).
All subcategories that are attached to this category.
All pages that are attached to this category.
My goal is to create a page that includes at least part #3 of several categories. A page that shows me all page names that are attached to multiple categories of my choosing, grouped by their category.
My first approach was to use the standard transclude syntax of MediaWiki:
Category A contains these pages:
{{:Category:A}}
Category B contains these pages:
{{:Category:B}}
Category C contains these pages:
{{:Category:C}}
...
Unfortunatly, this only transcluded part #1 of a category: the user defined text. The page name listing was missing.
My second idea was to have a look at the parser functions. Perhaps there are some functions that offer enumerating through the pages of a category. But I didn't find any.
Perhaps there is a MediaWiki extension out there...
Is there a clever way to realize this?
Try http://www.mediawiki.org/wiki/Extension:CategoryTree, with the following syntax:
Category A contains these pages:
<categorytree hideroot="true" namespaces="-">Category A</categorytree>
If you want more control over how the results are displayed, you may want to give Semantic Mediawiki a try.
The syntax would look something like:
Pages in Category A:
{{#ask:[[Category:A]]
|format=ul
}}
Even if you are not using semantic properties, you can use the query mechanism to display pages based on categories.
The MediaWiki extension Dynamic Page List (http://www.mediawiki.org/wiki/Extension:DynamicPageList_(third-party)) does this with ease, producing bulleted lists of articles in a category:
Pages in Category A:
<dpl>
category=A
</dpl>
without a heavyweight solution like Semantic MediaWiki. Just install and go.
DPL has a rich syntax for more powerful dynamic lists. For example, to produce a numbered list in 3 columns:
<dpl>
category=A
mode=ordered
columns=3
</dpl>