Title page and automated lists with deck.js and web-2.0 in slidify - slidify

I'm diving into slidify and have two problems that I cannot get solved. I've included a wee bit of example code so show where it goes wrong (example.Rmd file):
---
title : My funny title
subtitle :
author : Claus
job :
framework : deck.js
theme : web-2.0
transition : fade
highlighter : highlight.js # {highlight.js, prettify, highlight}
hitheme : tomorrow #
widgets : [] # {mathjax, quiz, bootstrap}
mode : selfcontained # {selfcontained, standalone, draft}
---
## Slide 2
Some text
* Item 1
* Item 2
* Item 3
If I use the deck.js framework with the web-2.0 theme then I get no title page. I have been unable to figure out if that is because there is no title page for that framework or if I'm doing something wrong. A simple example code is provided below. If I change the framework to io2012 then the title page appears
I would like the unordered list on page two to be automated such that not all items appear at once. I read here on this link that adding the build class to the ul tag should do the trick but I simply cannot get that to work.
Cheers,
Claus

Related

Show header permalink on hover (pelican)

How do I get a clickable "permalink" to show on hover (for e.g. h2 headers) similar to this.
I'm using the pelican framework and am writing in restructuredText. I can't figure out where in the stack to tweak to enable this (pelican? rst? jinja2?)
It's called a label. Usage is documented under the ref role.
To support cross-referencing to arbitrary locations in any document, the standard reST labels are used. For this to work label names must be unique throughout the entire documentation. There are two ways in which you can refer to labels:
If you place a label directly before a section title, you can reference to it with :ref:label-name. For example:
.. _my-reference-label:
Section to cross-reference
--------------------------
This is the text of the section.
It refers to the section itself, see :ref:`my-reference-label`.
Edit
For Pelican, there is a plugin called headerid that will render permalinks.
You can get that through the options of the Markdown TOC extension.
Just set the permalink option to True in your pelicanconf.py:
MARKDOWN = {
'extension_configs': {
'markdown.extensions.toc': {'permalink': 'True'}
}
}

How to name twig files by the region they are in?

I am using Drupal with the Commerce Module to build a webshop. I am using the Commerce Cart Block to display a cart icon with the amount of items in the cart, in the navigation bar.
Now I would also like to display the Cart Block on the Cart page, but with a different template than being used in the navigation bar.
I am using the debug mode, which let me see what I could call the file names to use them like I would like to. But above both Cart Blocks it says the same file name, so I can't output two different templates. I tried putting primary_menu-- before the navigation cart block and content-- (the region the cart block is going to be in), but they don't work.
<!-- THEME DEBUG -->
<!-- THEME HOOK: 'commerce_cart_block' -->
<!-- BEGIN OUTPUT from 'themes/custom/verdamigo/templates/commerce-cart-block.html.twig' -->
This is shown above both cart blocks (which are on the same page). So how can I use two different templates for both blocks.
primary_menu--commerce-cart-block.html.twig
is not working.
I would like to be able to edit both the block in the primary_menu and the block in the content-region. But both carts get output with the same template.
In an effort to decouple Blocks from Displays, Drupal 8 renders a block independently of which display it's in and what region/weight it has in that display (see Twig Template naming conventions) :
Region-specific block templates are not available in Drupal 8.
This removes the ability to override block.tpl.php by region, and for hook_preprocess_block() to adjust variables based on it. Instead, core developers recommend to manage block template overrides with CSS or using additional blocks.
But you can still work around this by implementing hook_theme_suggestions_HOOK_alter() :
function SOME_theme_suggestions_block_alter(array &$suggestions, array $variables) {
if (!empty($variables['elements']['#id'])) {
$block_id = $variables['elements']['#id'];
$block = Drupal\block\Entity\Block::load(block_id);
$region = $block->getRegion();
// Allow per-region block templating.
$suggestions[] = 'block__' . $region . '__' . $block_id;
}
return $suggestions;
}
Note : the template name should begin with "block" since you override a block template, so in your case the override file should be named block--primary_menu--commerce-cart-block.html.twig.

Retrieve an image from a website using Ruby and Nokogiri

I am trying to get an image from this website using Ruby.
https://steamcommunity.com/market/listings/730/M4A1-S%20%7C%20Cyrex%20(Minimal%20Wear)
So far, I have successful code to get the name of the item listed on the website:
html = Nokogiri::HTML.parse(open('https://steamcommunity.com/market/listings/730/'+url2))
title = html.css('title').text
titles = title.sub(/^Steam Community Market :: Listings for / , '')
Which results in "M4A1-S | Cyrex (Minimal Wear)"
(The "url2" comes from an input box on the html page that I made)
The image on the Steam Website has a class of "market_listing_largeimage".
Is there a way to also use Nokogiri to get the image src so that I can then input it into Html?
The image does not have that class; the div that the image is wrapped in does. That said,
html.at_css('.market_listing_largeimage img')['src']

Is it possible to let few page have the same customized TOC in dokuwiki?

I'd like to make the database of famous musicians using dokuwiki.
Musician has their own Biography, Discography, Members, and Live Concert Info.
For example, Aero Smith. They have many CD released. and historical events.
So does Live Concert Info.
That's why basically I'd like to make all the page separated something like this.
Aero Smith (Main Page of Aero Smith)
Biography
Discograhy
Members
Live Concert Info
I was talking about only Aero Smith. But there will be other famous musicians, too just like this.
Red Hot Chilli Peppers (Main Page of Red Hot Chilli Peppers)
Biography
Discograhy
Members
Live Concert Info
So each band should have 5 pages for total including Main Page.
Then here's my question.
Is it possible to let these 5 pages have the same menu which has links to other pages?
For example, I want the Table of Contents(or Side Menu) which has link to these
Main Page(of Aero Smith)
Biography(of Aero Smith)
Discograhy(of Aero Smith)
Members(of Aero Smith)
Live Concert Info(of Aero Smith)
Of course, this will be shown only in Aero Smith's content page.
In other musician's page, their menu will be shown up just like "Main Page(of Red Hot Chilli Peppers)"
and one more thing. I want this "Table of Contents(or Side Menu)" just as menu for links to the other pages.
I don't need the same name header in a page. All I want it is only for the links to the other pages.
I just want it as menu that indicates links.
Are they possible with dokuwiki? or Is there any other wiki that can make all of these possible?
HUSTEN, you can certainly do this following the guidelines for creating Namespace Templates and placing 'relative' links in the template in order to link to the sub-pages. (See the 'aside' below in regard to namespace/page naming.)
Place the following markup into your page named: bands:aerosmith:main
Menu: [[.:main | Main Page]] [[.:discography | Discography]] [[.:members | Members]] [[.:live | Live Concerts]]
Note the use of .: in the links to create 'relative' links to the current namespace. See DokuWiki Namespaces
You may also want to add any common headings or sections into this page as well as the menu links (as this will be your template).
Now follow the instructions on the Namespace Templates page to copy /bands/aerosmith/main.txt to /bands/__template.txt (note the double underscores which will make the template apply to all sub-namespaces within the 'bands' namespace).
Now, whenever you create another band page, such as bands:red-hot-chilli-peppers:main, it will automatically be populated with this menu of links to the other pages (and you have the benefit of just clicking the link in order to create the page).
A brief 'aside' in regards to DokuWiki pages and namespaces:
If you create a new 'page' named bands:aerosmith
then you end up with a Namespace named 'bands' which contains a Page named 'aerosmith.txt'
But if you create a new 'page' named (note the trailing colon) bands:aerosmith:
then you end up with a Namespace named 'bands' containing another Namespace named 'aerosmith' which contains a Page named 'start.txt' (if you haven't changed the default page name in the configmanager).
So, if you use my instructions above, you will end up with a Namespace named 'bands' and a Namespace named 'aerosmith' and a Page named 'main.txt'. BUT you do not have a page named 'start.txt' so if you attempt to browse to /bands/aerosmith then you won't see the 'main' page as it will (by default) attempt to show you the 'start' page in that namespace.

Choosing 'selected' menu item in WP collapsible mobile menu

Someone was able to so quickly help me with a problem I'd spent hours and hours on, that I'm hoping I'll get lucky and someone can point me in the right direction on this one, too.
I didn't see anyone else with quite my issue here - and I'm new to working with WP templates instead of plain old HTML/CSS/JS stuff.
Basically - on a site we did (www.opted.org) with a purchased WP theme - I can't get the mobile version collapsible menu to stop defaulting on page load to the last item in the Main Menu.
So instead of something that makes sense - like About ASCO, or even being able to add "Select Page" - the drop down shows "-- past issues"
I don't care how I fix it really, but the client just doesn't want that page to be the default. I tried adding an extra menu item at the end called "Select Page" with an href='#' and using CSS to hide it on screens above 480px - but I couldn't get it to work no matter how I tried to refer to it.
I feel like this should be easy - but I don't know where to set the selected LI among the many WP files.
Thanks!!
I had a look at the plugin.js file on the site www.opted.org.
On line 22, there is 'header' : false // Boolean: Show header instead of the active item
and on line 41 there is jQuery('<option/>').text('Navigation')
Try setting line 22 to true, and text('Navigation') to your 'Select Page' if you prefer that over the text 'Navigation'
Or, according to the tinynav.js page (http://tinynav.viljamis.com/), you can customize that as an option like this:
$("#nav").tinyNav({
active: 'selected', // String: Set the "active" class
header: 'Navigation', // String: Specify text for "header" and show header instead of the active item
label: '' // String: Sets the <label> text for the <select> (if not set, no label will be added)
});
In your main.js file, your calling it on line 14. You should add that header: 'Navigation', option there.
It's hard to answer this question without knowing how the theme you are using works. However, you can certainly change the selected attribute using javascript.
Here's the code you would use to set it to 'About Asco' using jQuery:
jQuery('.tinynav').val('/about-asco/')
alternatively (a little clearer, but more verbose):
jQuery('.tinynav option:first').prop('selected', true);