wkhtmltopdf: Custom order TOC - wkhtmltopdf

I am using wkhtmktopdf to transform my sphinx documentation into PDF. My problem comes with the TOC that is generated, which due to the different HTML pages, is not in order.
My current situation is as follows:
root/index.html:
[Heading_1]
[content]
[Heading_2]
[content]
[Heading_3]
[content]
root/child/index.html:
[Subheading_1, child of Heading_2]
[content]
This basic example returns a TOC as follows:
[Heading_1] ------------------------ Page 1
[Heading_2] ------------------------ Page 2
[Heading_3] ------------------------ Page 3
[Subheading_1] --------------------- Page 4
But my expected result, because of the sphinx toctree is (for example):
[Heading_1] ------------------------ Page 1
[Heading_2] ------------------------ Page 2
[Subheading_1] ----------------- Page 4
[Heading_3] ------------------------ Page 3
Since it seems like I cannot generate this result using the default toc options, I have been thinking of generating dynamically my own HTML page with the Table of Contents, correctly ordered based on the sphinx toctree BUT I cannot figure out how to get dynamically the page number.
Any ideas how to achieve my expected result? I am using the python-pdfkit wrapper and I do have the toctree of the entire document.
Thanks!

Related

Include links in Sphinx table without extra whitespace

I'm trying to create a table of links using the simple table format in Sphinx, like the example below:
=================================== ======
Website Type
=================================== ======
`Google <https://www.google.com>`__ Search
`Yahoo <https://www.yahoo.com>`__ Search
`CNN <https://www.cnn.com>`__ News
=================================== ======
If I understand correctly, I have to stretch the header breaks to the width of the longest row in the table, including the links. However, when the table is rendered the website is rendered as a link, leading to a lot of empty whitespace in the Website column.
Is there a way to create a table where the column is only as wide as the longest rendered hyperlink?
Wrapping the table in a table directive with :widths: auto works for me (tested with Sphinx 4.2.0).
.. table::
:align: left
:widths: auto
================================== ======
Website Type
================================== ======
`Google <https://www.google.com>`_ Search
`Yahoo <https://www.yahoo.com>`_ Search
`CNN <https://www.cnn.com>`_ News
================================== ======

Dynamic navigation shows incorrect result count

When we filter result by Duplicate Snippet filter (filter=p) we receive incorrect result count in dynamic navigation.
E.g.
Picture with issue
Actual result count = 5
Result are shown for end-user = 3 (Two pages was filtered)
Dynamic navigation by content format(Web Pages) = 5
As I know GSA has some problems with determinating actual count for a large number of results.
Is it possible to set filtered result count in dynamic navigation (Web Pages)?
GSA System Version: 7.2.0.G.252

Lotus Notes 7 - Categorized column issue

There are 2 forms "fmA" and "fmB". In "fmA" I have to possibility to create "fmB", by taking a field value and the UNID from "fmA" into 2 fields in "fmB". eg: Company Name and txt_UNID ( which is computed ) in "fmA" goes into "fmB" in Company Name and txt_UNIDB.
There is a possibility to create "fmB" without being a connexion with "fmA": create "fmB" from a view action, outside the form of "fmA".
In my main view, I want to display all these documents ( fmA & fmB ) and I create a first column which is categorized and hidden, having the following formula:
#If(Form="fmA";txt_UNID;txt_UNIDB)
It displays OK, but is there any possibility to not show the 'invisible' twisty ( which in this case is invisible but I can collapse / expand any category of docs. ) ?
I got smth like this:
(invisible line in view, but still I can collapse/expand the categories )
1st doc from fmA
1st doc from fmB
2nd doc from fmB
(invisible line in view, but still I can collapse/expand the categories )
2nd doc from fmA
1st doc from fmB
(invisible line in view, but still I can collapse/expand the categories )
1st doc from fmB ( which doesn't depends on any fmA)
2nd doc from fmB ( which doesn't depends on any fmA)
3rd doc from fmB ( which doesn't depends on any fmA)
Thanks for your time and help! I appreciate it!
If you don't want categories... don't categorize the view. In your case it is enough to SORT with this hidden column, you don't need to categorize it.
Nevertheless there is an option called "Categorized is flat version 5 or greater" in the column properties that hides the categories, but I don't see the advantage of having such a column instead of a simple sorted one...

Wicket custom (data)table layout

Is there a way to customize the wicket DataTable layout?
I'd like to have a DataTable with a horizontal flow of data and multiple columns per row.
e.g.:
------------------------------
|prename| John| surname| Doe |
------------------------------
|city | NY | country| USA |
------------------------------
Unlike the normal use of the DataTable class this would be used for displaying just one object (respectively one dataset)
Don't use a DataTable for this.
For a simple case, just make a panel containing a Label for each data element and put the table layout in the corresponding html fragment.
To make it more dynamic, with parametrized size as noted in your comment, you might build your own structure using nested RepeatingView components, one for the rows and one for the columns, or perhaps use a DataGridView, which would do some of the layout work for you.
But DataTable is really meant for a table with meaningful columnar structure and includes alot of code for handling the column structure which won't make sense for your data and will get in your way.

Report Help: Crystal Reports

I am making one Crystal Report for bills.
Bills Table :
BillID(pk), PartyName, BillDate, Loading, Unloading.
BillDetails Table:
ID(pk),BillID(fk),Item, Quantity, Rate, Amount.
In the database expert I have joined the 2 tables.
I want the report like this:
BillID PartyName BillDate
SALE EXPENSES
ITEM QUANTITY RATE AMOUNT LOADING 10
toy 2 2 4 UNLOADING 20
doll 7 6 42
ball 8 6 48
cell 5 6 30
TOTAL : 160 30
NET: 160
- 30
130
The problem is that the loading and unloading appear only once per bill while the biil contains multiple items.
How I can mix details section with items that appear only once(loading and unloading) ?
You have at least two options for presented layout:
Use subreport for displaying loading/unloading values (link with bill ID)
Put your loading/unloading fields into special group header section (group by bill ID) and make that section "underlay following sections"
If you can dispaly loading/unloading values on separate row, then place them into appropriate group header/footer and you're done.
I think you'd need to use both of the options in Arvo's answer together to get what you are wanting.
I'd first create your subreport for "Loading and Unloading" and place it in the header with Item, QTY, etc and then set that header to "underlay following sections". This will get you the details of the subreport, but then you need to capture the total to send back to the main report.
To get this info you'll need to create a shared variable in the subreport for the total and then you can reference it in your formula in the main report's "Net" footer section.
Hope this helps.

Resources