Sphinx rtd docs dropdown only works post click - documentation

I have created an rtd themed documentation for my package using sphinx and sphinx_rtd_theme. The index.rst is as follows:
Welcome!
.. toctree::
:maxdepth: 1
:glob:
src
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
And the src file is roughly following this idea:
================
Template Project
================
.. automodule:: src
:members:
:undoc-members:
:show-inheritance:
.. toctree::
:maxdepth: 4
features
io
model
utilities
The html_theme_options is also as follows in conf.py:
html_theme_options = {
"analytics_anonymize_ip": False,
"logo_only": False,
"display_version": True,
"prev_next_buttons_location": "bottom",
"style_external_links": False,
"vcs_pageview_mode": "",
# Toc options
"collapse_navigation": True,
"sticky_navigation": True,
"navigation_depth": 4,
"includehidden": True,
"titles_only": False,
"globaltoc_collapse": True,
"globaltoc_maxdepth": None,
}
The problem I'm expericing right now is that, the drop down's are not working correctly. They don't show up in the sidebar, unless I click on an item that should have a dropdown button near it.
And after I click on the sidebar link, I will go to the next file which is an opened dropdown.
What I would like to do is that, I want to have the dropdown option since the first item. This is clunky and unintuitive.

According to the docs for the theme, you can set collapse_navigation = False.

Related

How to duplicate slick slides?

I'm using slick-list to build an element where people can insert their own slides.
The slider is supposed to show 4 slides, but sometimes the number of slides doesn't reach that much and the slider bugs, making slides smaller (in width) than they were supposed to be.
I've tried to use infinite:true but it didn't go as I expected.
Here's how my slick is:
`
$('.el-lista-slider-orcamento .itens').each(function(){
$(this).slick({
slidesToShow: 4
,infinite: true
,slidesToScroll: 1
,autoplay: false
,autoplaySpeed: 4000
,speed: 500
,easing: 'swing'
,swipeToSlide: true
,pauseOnHover: false
,pauseOnFocus: false
,adaptiveHeight: true
,prevArrow: $(".el-lista-slider-orcamento .setas .seta-anterior")
,nextArrow: $(".el-lista-slider-orcamento .setas .seta-proximo")
,responsive: [
{
breakpoint: 1280
,settings: {
slidesToShow: 2
}
},
{
breakpoint: 768
,settings: {
slidesToShow: 1
}
}
]
});
})
`
Is there a way to automatically duplicate the slides so I can reach the minimum of 5 (4+1) slides?
Thank you.
I've tried to set 'infinite' to 'true', expecting the slick-list to automatically duplicate the slides. I've seen some poeple complaining about this 'feature' (how they wish it didn't duplicate) but nothing happened.
Change slidesToShow: 4 in 3.99.
Learn more here.

Google Docs API for creating invoice containing table of variable number of rows

I have a template file for my invoice with a table with sample row, but I want to add more rows dynamically based on a given array size, and write the cell values from the array...
Template's photo
I've been struggling for almost 3 days now.
Is there any easy way to accomplish that?
Here's the template file: Link to the Docs file(template)
And here's a few sample arrays of input data to be replaced in the Template file:
[
[
"Sample item 1s",
"Sample Quantity 1",
"Sample price 1",
"Sample total 1"
],
[
"Sample item 2",
"Sample Quantity 2",
"Sample price 2",
"Sample total 2"
],
[
"Sample item 3",
"Sample Quantity 3",
"Sample price 3",
"Sample total 3"
],
]
Now, the length of the parent array can vary depending on the number of items in the invoice, and that's the only problem that I'm struggling with.
And... Yeah, this is a duplicate question, I've found another question on the same topic, but looking at the answers and comments, everyone is commenting that they don't understand the question whereas it looks perfectly clear for me.
Google Docs Invoice template with dynamically items row from Google Sheets
I think the person who asked the question have already quit from it. :(
By the way I am using the API for PHP (Google API Client Library for PHP), and code for replacing dummy text a Google Docs Document by the actual data is given below:
public function replaceTexts(array $replacements, string $document_id) {
# code...
$req = new Docs\BatchUpdateDocumentRequest();
// var_dump($replacements);
// die();
foreach ($replacements as $replacement) {
$target = new Docs\SubstringMatchCriteria();
$target->text = "{{" . $replacement["targetText"] . "}}";
$target->setMatchCase(false);
$req->setRequests([
...$req->getRequests(),
new Docs\Request([
"replaceAllText" => [
"replaceText" => $replacement["newText"],
"containsText" => $target
]
]),
]);
}
return $this->docs_service->documents->batchUpdate(
$document_id,
$req
);
}
A possible solution would be the following
First prep the document by removing every row from the table apart from the title.
Get the full document tree from the Google Docs API.
This would be a simple call with the document id
$doc = $service->documents->get($documentId);
Traverse the document object returned to get to the table and then find the location of the right cell. This could be done by looping through the elements in the body object until one with the right table field is found. Note that this may not necessarily be the first one since in your template, the section with the {{CustomerName}} placeholder is also a table. So you may have to find a table that has the first cell with a text value of "Item".
Add a new row to the table. This is done by creating a request with the shape:
[
'insertTableRow' => [
'tableCellLocation' => [
'rowIndex' => 1,
'columnIndex' => 1,
'tableStartLocation' => [
'index' => 177
]
]
]
]
The tableStartLocation->index element is the paragraph index of the cell to be entered, i.e. body->content[i]->table->startIndex. Send the request.
Repeat steps 2 and 3 to get the updated $doc object, and then access the newly created cell i.e. body->content[i]->table->tableRows[j]->tableCells[k]->content->paragraph->elements[l]->startIndex.
Send a request to update the text content of the cell at the location of the startIndex from 5 above, i.e.
[
'insertText' => [
'location' => [
'index' => 206,
]
],
'text' => 'item_1'
]
]
Repeat step 5 but access the next cell. Note that after each update you need to fetch an updated version of the document object because the indexes change after inserts.
To be honest, this approach is pretty cumbersome, and it's probably more efficient to insert all the data into a spreadsheet and then embed the spreadsheet into your word document. Information on that can be found here How to insert an embedded sheet via Google Docs API?.
As a final note, I created a copy of your template and used the "Try this method" feature in the API documentation to validate my approach so some of the PHP syntax may be a bit off, but I hope you get the general idea.

How to Save the search inputs and page number(state Save) of all of the tables in CoreUI data table

How to Save the search inputs and page number(state Save) of all of the tables in CoreUI data table
Eg. I search for a postcode, and go onto page 2. When I go back to the table after going onto the customers page, it should take me back to exactly where I left off, which is the search inputs and the page.
First Picture shows when I click on page No. 3 and move to another page or home page and then come back to customers it should return back to page No 3 not page No 1
Use Datatables as reference.
This is how it works on the CRM which uses Datatables JS plugin:
https://gyazo.com/13152d149f26792a87c9a8e38b0159ab
data: () => {
return {
pageSizes: [10, 50, 100],
items: store,
fields: ['company_name', 'name', 'postal_code', 'phone1', 'phone2', 'email', 'created_at'],
currentPage: 1,
perPage: true,
stateSave: true,
totalRows: 0,
you: null,
message: '',
showMessage: false,
dismissSecs: 7,
dismissCountDown: 0,
showDismissibleAlert: false,
customerModal: false
}
},

How do you preselect the options when loading the q-select?

I'm new to vue and quasar so i haven't done this yet. I'm building the ability to edit a record and I want to be able to pre select the options for a q-select element. The pre selected options are what the user saved when they first created the record. Currently I have:
<q-select
v-model="products"
label="Products *"
:options="products"
option-label="title"
option-value="id"
multiple
use-chips
:rules="[val => val || 'A product is required']"
/>
Chris, You just need to set the model value in your case products and it will work.
Example -
model: 'Twitter',
options: [
'Google', 'Facebook', 'Twitter', 'Apple', 'Oracle'
]
codepen - https://codepen.io/Pratik__007/pen/QWNBxWz

Check box "ticked" on page 1 is reflected in page 2 in EnhancedGrid

I have a enhancedgrid and used on two pages. When check box (component of data enhanced grid) is checked on page1, the equivalent row(s) on pg 2 are then ticked. My enhancedgrid code is
grid = new dojox.grid.EnhancedGrid({
loadingMessage:"Please wait",
store:newStore,
structure:layoutQL,
autoWidth:false,
autoHeight:true,
columnReordering:false,
rowsPerPage:3,
indirectSelection: true,
//noDataMessage:"No transactions have been processed for posting.",
//selectionMode:'single',
plugins: {
pagination: {
description: true,
sizeSwitch: false,
pageStepper: true,
gotoButton: true,
/*page step to be displayed*/
maxPageStep: 6,
/*position of the pagination bar*/
position: "bottom",
indirectSelection: true
},
filter : {
// Show the closeFilterbarButton at the filter bar
closeFilterbarButton: true,
// Set the maximum rule count to 5
ruleCount: 5,
// Set the name of the items
itemsName: "records"
}
}
I am using EnhancedDataGrid as in dojo framework. Any help will be appreciated.
Try "grid.selection.deselectAll()" when you move from one page to the next.