Using references in GitHub wiki with restructured text - github

I'm trying to use internal references to link an index atop my wiki page with several sections within the document. Here's an example:
* `My index`_
+ Foreword_
+ `Technical details`_
My index
--------
Foreword
~~~~~~~~
Technical details
~~~~~~~~~~~~~~~~~
If I generate the HTML page via rest2html I get the right result. However, GitHub wiki inserts extra words in the references and the links do not work. for example:
https://github.com/myaccount/myproject/wiki/Page#wiki-my-index
https://github.com/myaccount/myproject/wiki/Page#wiki-foreword
https://github.com/myaccount/myproject/wiki/Page#wiki-technical-details
I couldn't find any relevant document in the GitHub page, so I'm kind of lost.

It looks like the class ids are missing from the generated divs. Check the page source to (not) see them. I think this is what it should look like:
<ul>
<li><dl class="first docutils">
<dt><a class="reference internal" href="#my-index">My index</a></dt>
<li><a class="reference internal" href="#foreword">Foreword</a></li>
<li><a class="reference internal" href="#technical-details">Technical details</a></li>
</ul>
<div class="section" id="my-index">
<h1>My index</h1>
</div>
<div class="section" id="foreword">
<h2>Foreword</h2>
</div>
<div class="section" id="technical-details">
<h2>Technical details</h2>
</div>
Edit: User intuited mentions the same issue in a GitHub markup issue
I've noticed this problem with README.rst files as well. As well as
headings, inline targets in .rst files, e.g. _some target, don't
work. The inline target text gets wrapped in a but doesn't get
made into any sort of link target. Should I file this as a separate
issue?

Related

wicket 9: Testing page rendering. How To find a path to a component, link, etc

I want to use wicket tester to test my web application, however I'm totally lost on
what is a path and how to come up with one while testing certain components and behaviour
i.e
public void executeAjaxEvent(final String componentPath, final String event);
How does one come up with a componentPath?
I'm trying to brute force the path of this piece code, so that I could click optionLink, but still no luck, testing seems to be pointless endeavor as there are no way to find a path
<ul class="dropdown-menu">
<li wicket:id="options">
<a href="#" wicket:id="optionLink">
</a>
</li>
</ul>
You could use wicketTester.debugComponentTrees() to print the Page's children paths.
A component path is a sequence of wicket:id separated by a colon and from the page to the specific component.
In your case:
options:0:optionLink
Note that repeaters add additional counters in between, thus the number for the n-th list item.
With DebugSettings#setComponentPathAttributeName() you can specify an HML attribute that should be used to write each component's path into the markup.

How to use onclick method inside AEM component

Am having a AEM6 html component, am getting the values from dialog and using it inside the component via the .js file and using the return properties.
I could able to get the authored values but it is getting null or empty when am using it inside the onclick method. Please find below the code snippet below.
<div data-sly-unwrap data-sly-use.test="test.js"></div>
<a href="#" class="${test.testId}" id="${test.testId}" onClick="toggleDraw('${test.testId}')" >
The content I authored is getting displayed in class and Id, but it is not displaying in the onClick method.
Below is the Output am getting after authoring.
<a href="#" class="get-a-quote" id="get-a-quote" onClick="toggleDraw('')" >
Output I needed is :
<a href="#" class="get-a-quote" id="get-a-quote" onClick="toggleDraw('get-a-quote')" >
This should do the trick:
<a data-sly-test.variable123="toggleDraw('${test.testId}')" href="#" class="${test.testId}" id="${test.testId}" onclick="${variable123 # context='attribute'}" >
You need to put the function call in a variable because of the nested single quotes. And you need to manually set the context in this case. If "attribute" does some escaping you do not like, you could use "unsafe" - this will end in all escaping mechanisms being disabled. That might or might not be a security issue for your application.
HTH

'itemListElement' not recognized in 'HowTo' schema

Based on the Microdata example in http://schema.org/HowTo and extrapolating syntax from the Microdata vs RDFa example in http://schema.org/hasOfferCatalog (there seem to be so few actual examples of RDFa to find?), I put together something like so:
<main vocab="http://schema.org/" typeof="HowTo">
<h1><span property="name">How to do the Hokey Pokey</span></h1>
<ol property="steps">
<li property="itemListElement" typeof="HowToStep">
<img alt="step 1" src="step1.jpg" align="left">
<p property="itemListElement" typeof="HowToDirection">
put your left hand in</p></li>
<li property="itemListElement" typeof="HowToStep">
<img alt="step 2" src="step2.jpg" align="left">
<p property="itemListElement" typeof="HowToDirection">
put your left hand out</p></li>
But, when put into Google's Structured Data Testing Tool, I get:
The property itemListElement is not recognized by Google for an object of type HowTo.
Yandex's validator also says:
WARNING: http://schema.org/itemListElement field not specified in http://schema.org/HowTo
What am I doing wrong?
You missed to specify the HowToSection (or HowToStep) type as value for the steps property.
The Microdata example uses:
<div id="steps" itemprop="steps" itemscope itemtype="http://schema.org/HowToSection">
The equivalent RDFa would be:
<div id="steps" property="steps" typeof="HowToSection">
If you aren’t providing an ItemList/CreativeWork value for the steps property, you are providing a Text value (this is what you are doing in your example markup). But you can’t add properties (like itemListElement) to a Text value.

Dashing - dynamically delete widgets

how can i dynamically delete widgets from a job(rb) in Dashing?
I am building the dashboard dynamically by sending a data to the erb file:
<div class="gridster">
<ul>
<% settings.servers.each do |data| %>
<li data-row="1" data-col="1" data-sizex="1" data-sizey="1">
<div data-id="<%=data['webHost']%>" data-title="<%=data['name']%>" data-version="<%=data['Version']%>" >
</li>
<% end %>
</div>
Yes. I wrote a simple example job that can do just that here:
http://www.mapledyne.com/ideas/2015/6/30/delete-a-dashing-dashboard-widget
You basically just want to manipulate the Sinatra::Application.settings.history variable, but the code in that link should get you most of the way to where you want to be.
Or skip the post and go right to the gist file:
https://gist.github.com/mapledyne/6fb671c17c3f865309f3#file-delete-widget-rb
You can also generate parts of the erb dynamically if you don't know the widgets in the first place (more complicated), but it starts with the same - leveraging that same history variable.

Does wicket lose hold of the HTML components after a rearrangement through JavaScript?

I have a repeating component in wicked which needs to be added and deleted as per the user requirement. The maximum number of component is predefined. So I am adding the components at start up and hiding and showing based on need. I am required to change the arrangement of the components in the HTML markup when there is any deletion of the component. I use JavaScript for this. I want to know if wicket would lose hold of the components if I do this.
<div wicket:id="borrowerTabs" id="borrowerTabs">
<span wicket:id="borrowerTab1" id="borrowerTab1" ></span>
<span wicket:id="borrowerTab2" id="borrowerTab2" ></span>
<span wicket:id="borrowerTab3" id="borrowerTab3" ></span>
<span wicket:id="borrowerTab4" id="borrowerTab4" ></span>
<button wicket:id="addBorrower" id="addBorrower" type="button"></button>
<button wicket:id="deleteBorrower" id="deleteBorrower" onclick="updateUIForDeleteBorrower()" type="button"></button>
</div>
If delete the borrowerTab3, contents inside borrowerTab4 will be replacing the contents inside borrowerTab3 and the model objects too will be swapped though I do not do a target.add(borrowerTab3). Now while form submission, I am not getting the values of the fields inside borrowerTab3.
I'm not sure if it helps but try component.setVisible(false) in your java code to hide it.