How to create doubly-nested tabs in R Markdown? - tabs

I would like to create an R Markdown HTML document with doubly-nested tabs.
I have tried to extend the method given as an answer for the question RMarkdown can't seem to produce Tabs in Tabs with the following code:
---
output:
html_document:
theme: paper
highlight: tango
number_sections: false
toc: false
toc_float: false
---
# Result Discussion {.tabset}
We will discuss results here
## Quarterly Results {.tabset}
This content pertains to Quarterly Results
<div id="quarterly-product" class="section level3">
### By Product
Quarterly perfomance by Products
<div id="quarterly-product-a" class="section level4">
#### Case A
Quarterly perfomance by Products in Case A
</div>
<div id="quarterly-product-b" class="section level4">
#### Case B
Quarterly perfomance by Products in Case B
</div>
End of section quarterly perfomance by Products
</div>
<div id="quarterly-region" class="section level3">
### By Region
Quarterly perfomance by Region
<div id="quarterly-region-a" class="section level4">
#### Case A
Quarterly perfomance by Region in Case A
</div>
<div id="quarterly-region-b" class="section level4">
#### Case B
Quarterly perfomance by Region in Case B
</div>
End of section quarterly perfomance by Region
</div>
Final Words about Quarterly Results
## Yearly Results {.tabset}
This content pertains to Yearly Results
<div id="yearly-product" class="section level3">
### By Product
Yearly perfomance by Products
</div>
<div id="yearly-region" class="section level3">
### By Region
Yearly perfomance by Region
</div>
Final Words about Yearly Results
Here, I added subsections Case A and Case B in the sections Quarterly results by Product and Quarterly results by Region. However, adding level4 sections using the < div> tags doesn't seem to work. Is it possible to have a third layer of tabs in this way?

Related

(Odoo Report) How to past field values at the start of the page for every product

I want to print a custom-made purchase order where I list the products that have been purchased. Every product needs to have a separate page where information such as bar code, name, description, etc will be added. So what I am actually struggling with is how can I insert the information of a product right at the start of a new page.
Example
The information for the first product is shown at the start of page number 1.
The information for the second product is shown at the start of page number 2.
Thanks
You could do a page break in qweb using something like this:
<div style="page-break-before: always;">
...
</div>
More options are:
<p style="page-break-before:always;"> </p> (mostly reports used this type)
<p style="page-break-after:always"></p>
<div style="page-break-after: auto;"><span style="display: none;"> </span></div>
<p style="page-break-inside: avoid">
<div style="page-break-inside: auto"></div>

Schema Error - Multiple Reviews should be accompanied by Aggregate Rating

I have this schema set up, it is one rating for one product but I am getting an error asking for an aggregate rating.
As you can see from the image there are multiple products, but each one is enclosed with the code below. Is my code wrong?
<div itemprop="review" itemscope itemtype="http://schema.org/Review">
<div class="col-sm-8 no-justify"><p>
<span itemprop="author" itemscope itemtype="http://schema.org/Person"> Thats Insurance</span> Rating for
<span itemprop="reviewAspect">Single Trip Gold Plus: </p></span></div>
<div class="col-sm-4 ">
<span itemprop="reviewRating" itemscope="" itemtype="http://schema.org/Rating"><p>
<span itemprop="ratingValue" content="3"></span></span></div></p></div>
Unfortunately at this time Schema does not allow for a review that has sub items that are of different types.
In this case we have a main rating
Single Trip Policy Ratings
and within this - Sub Ratings
Gold and
Gold Plus Policies
Schema presently counts each sub rating as a review of the the main rating. For things like Customer Reviews this would be correct, but in this circumstance it will not work as you will be asked to enter an Aggregate Rating - when there is no aggregate rating as these are separate items.
Having spent the entire day trying different combinations of Schema I am confident that this is the case for my circumstance.
Hopefully my answer will save someone wasted time searching.

Loop based on tag in HTML document

I'm trying to extract certain details from articles which are combined in an html file. The html file will consist of 1000s of articles so trying to automate the extraction using BeautifulSoup. For the first article I can get it to extract but do not seem to get it to automatically move on to the next article. This is how the html looks like:
<DOCFULL> -->
<br/>
<div class="c0">
<p class="c1">
<span class="c2">
2 of 4 DOCUMENTS
</span>
</p>
</div>
<br/>
<div class="c0">
<br/>
<p class="c1">
<span class="c2">
The New York Times
<br/>
</span>
...
</DOCFULL>
...
<DOCFULL> -->
<br/>
<div class="c0">
<p class="c1">
<span class="c2">
1 of 4 DOCUMENTS
So, somehow I need the following commands, once fulfilled, to again apply to the next article, that will start again will -->. But I just cannot get it to work the way needed. For example to extract 'The New York Times' in the partial html above I use, and it should automatically also been done to the 2nd/3rd/4th etc article.
journal = soup.find_all('span', class_='c2')[1].getText()
If anyone can point me in the direction I should start thinking it would be really appreciated!
EDIT:
Just to put more into perspective what I am trying to achieve. I can get the latter parts to work, but do not get it to check each article after the former.
For Each Article:
* Determine Newspaper
* If newspaper = x
.
.
.
* Else
Continue

Jsoup traverse one by one

I have to iterate over the html content of each div one by one.
<div class="category"> 1 </div>
<div class="category"> 2 </div>
<div class="sub-category"> <ul><li></li>....</ul> </div>
<div class="category"> 4 </div>
<div class="sub-category"> <ul><li></li>....</ul> </div>
<div class="category"> 6 </div>
I have tried
element.select("div.category")
element.select("div.sub-category")
it fetches data but not in sequence.
I just want to fetch one category then its sub-category. Also note that some category don't have sub-categories.
Kindly suggest anyone, the proper way to do this. Thanks.
You can use these syntaxes:
[attr^=value]: for elements with attributes that start with value
[attr$=value]: end with value
[attr*=value]: contain the value
In your case: "category" & "sub-category" both contain the substring "category" and end with "category" therefore you can use:
.select("div[class*=category]") or
.select("div[class$=category]")

Create Table Loop to display records Web2Py / SQLFORM

I am a recent college grad trying to build a bigger portfolio so I am building a fake e-commerce site. I want to build a html table that takes in data from SQLFORM query.
For example, if I have 8 entries / and i want 3 columns - it displays as so.
X X X
X X X
X X
And if i have only 4 entries / and i want 3 columns - it displays as so..
X X X
X
I am having trouble figuring this out... I could not find any resources on web2py online that demonstrate this. Here is my current code to display 1 column... and 1 record per row. In my code the =thenumber is the number of records that are generated by the query.
{{extend 'layout.html'}}
<h1>Disc Golf Post</h1>
</hr>
{{=thenumber}}
{{ for x in rows: }}
<div class='row'>
<img class='col col-lg-4 col-md-6 col-sm-6 col-xs-12' src='http://127.0.0.1:8000/pluralsight/static{{=x.products_image}}' alt='blog image' />
<div class='col col-lg-8 col-md-6 col-sm-6 col-xs-12'>
<p class='lead'>
<b>{{=x.products_title}}</b>
</p>
<p>
<b>Category: </b>{{=x.products_manufacturer}}
</p>
<p>
{{=x.products_price}}
</p>
<p>
{{=x.products_capacity}}
</p>
</div>
</div>
{{pass}}
I am aware I need to do some formatting issues on size of columns and such. Any advice would be greatly appreciated or a link to a site that details this in web2py would also be fantastic. Thanks in advance.