Index talk:The Kama Sutra of Vatsyayana.djvu

From Wikisource
Latest comment: 3 years ago by Rajasekhar1961 in topic Table of contents
Jump to navigation Jump to search

Missing pages[edit]

Table of contents[edit]

{{helpme}} Is it O.K. like the Part I of this book; I have done here. If not, please create a TOC page in standard format.--Rajasekhar1961 (talk) 18:34, 18 July 2020 (UTC)Reply

@Rajasekhar1961: Your approach here wasn't wrong, per se, but neither was it a particularly faithful representation of the original work, and it falls below the level we generally aim for.
Tables of contents are, in terms of layout, rather complex beasts, so it is almost inevitable that you will have to use similarly complex markup to reproduce them. Generally this will mean using the wikimarkup for generating HTML tables, and applying relevant formatting (alignment, font effects, etc.) to its cells. And for most works the table of contents will continue across multiple pages, so you'll need to know the syntax tricks for making a single wiki table span multiple wikipages. The three most central documents for this are:
I have updated the first page of the table of contents for this work to use recommended wikimarkup (minus the links for the chapters in Part II). With the documentation linked above it should be possible for you to do the rest of this yourself. It is complicated to begin with, but once you figure out how it works it's mostly just a bit tedious and fiddly, but not difficult, to do. I'll also include an explanation of the key aspects here:
It is using table wikimarkup to start a table ({|) at the top of the page body (not the header or footer text fields) on the first page. It puts the wikimarkup to end a table (|}) in the footer section on the first page, because we only need it in the Page: namespace (and the header and footer fields aren't included when we transclude pages for presentation). On the pages in the middle (i.e. not the first or last page of the table of contents) we put table start markup ({|) in the header and table end markup (|}) in the footer. And on the final page of the table of contents we put table start markup ({|) in the header as before, but table end markup (|}) at the end of the page body. The end result when we transclude all these pages together is that Mediawiki ignores all the table start and table end markup that we put inside the header and footer fields, leaving only one table start before the table and one table end at the end of the table.
Between the start and end are the rows of our table, each indicated by one line containing the table row wikimarkup (|-) and one line containing the cells of that row (separated by various combinations of | and formatting attributes), one cell for each column of the table. You'll need to decide at the outset how many columns the table should have, and that judgement comes with experience. In this case I've used three columns, mainly because each row contains three parts that we need to control the formatting and alignment of (alignment is often the deciding factor: the text "Chapter" and the ditto marks, the roman numeral chapter number, and the chapter title. For the headings and other rows that span multiple columns we use the colspan= attribute on the cell that contains it (it makes a single cell take up multiple columns so all the rows are equal).
For the cells in each row the structure is something like this: | formatting | Chapter/ditto || formatting | VII. || formatting | chapter title. There's lots of arcane and complicated rules for the syntax, but if you just use the placement of the | characters as is and modify the formatting and cell contents you should be able to muddle through.
Finally, for the formatting of each cell (the stuff marked as "formatting" above) we use the {{ts}} template. It takes various shortcut codes as parameters and transforms them into CSS style rules of the type font-size: larger; color: green; text-align: right;. You could add that directly using style="…", but that gets unwieldy fast. So instead we use pre-defined shortcuts in the {{ts}} template like this: {{ts|ar|vtp}}. The shortcut codes and what they mean is listed on the template's documentation page. In this case, ar means text-align: right and vtp means vertical-align: top. So, for example, the roman numeral chapter numbers should be aligned to the right in their column, and when rows are too long and have to be wrapped the chapter numbers should be aligned to the top of the cell to stay aligned with the chapter title. There are a lot of such formatting shortcut codes and more can be added if needed.
The final bit of magic here is the {{ditto}} template used for the chapter column. It takes a template string as input (in this case, the text "Chapter") and returns an invisible text that has the same width as that string, but displays only the "ditto mark" character (looks like a lower double quotation mark: „). That way it will align properly the same way the actual text "Chapter" in the first row does.
Hope this was helpful, and please let me know if you get stuck. --Xover (talk) 10:58, 27 August 2020 (UTC)Reply
@Xover: Thank you very much for taking pain in explaining in detail the procedure of Wiki markup in creating the ToC here in this important work. I will start creating the chapters for this important book. In case of any mistakes happen please donot hesitate to correct and tell my errors. I am trying to learn; since my background is Medical; I might not do full justice here where much is technology.--Rajasekhar1961 (talk) 14:46, 10 September 2020 (UTC)Reply
@Xover: I have created the next page of ToC. Please check.Rajasekhar1961 (talk) 10:05, 12 September 2020 (UTC)Reply
@Rajasekhar1961: Great job! It looks very nice.
The only remaining bit is that since all these individual wikipages will be concatenated together when we transclude the work for presentation, we need to make sure that the individual tables end up as one large table. Otherwise they will have different widths and alignment. The way we do that is by putting the start and end markup for the table into the header and footer fields on continuation pages. These text fields are shown only in the Page: namespace and are left out when transcluded for presentation. So on the first page we put the table start markup in the main text field (so it will be included), but the table end markup in the footer field (so it will not be included). On the pages in the middle we put both the start and end table markup in the header and footer fields (respectively) so they will both be left out. And on the last page of the ToC we put the start table markup in the header field (so it will not be included) but the end table markup in the main text field (so it will be included).
When we transclude this for presentation the effect will be that the start table markup on the first page will be included, and the end table markup on the last page will be included, but all the other start and end markup on the intervening pages will not be included. That way we we can have one table per wikipage in the Page: namespace, but one continuous table in the main namespace for final presentation.
There are some quirks about MediaWiki's handling of whitespace that come into play here, so you'll see some {{nop}} and {{nopt}} templates in there. Understanding how these work is very obscure technical stuff so I suggest you just treat them as "magical" for now: there is a logic to them, but it's so obscure and intertwined with implementation details of the software that I think they'll just be confusing when you're trying to get to grips with the tables and transclusion. Feel free to ask if you want to dig into it, or if you need help.
And I can't stress enough: this is a very technical area and we know it is not user friendly. I'm pretty technical and I struggled for a long time to understand how it worked, and I still sometimes have problems getting the software to do what I want. It is absolutely worth figuring out, and once you do you can make most tables of contents yourself with the same knowledge, but even technical people struggle with this to begin with. Please don't be discouraged, and don't hesitate to ask for help! --Xover (talk) 08:49, 13 September 2020 (UTC)Reply
@Xover: Thank you for the patience in explaining the methods in a simple way. What I understand by this is we need to link these three pages of ToC with the Page:The Kama Sutra of Vatsyayana.djvu/9 Table. Then there are Images at the beginning of each Part along with a detailed description about each in the beginning. Can you suggest me some method.--Rajasekhar1961 (talk) 18:37, 15 September 2020 (UTC)Reply