How to write arabic in github README file? - github

I need to write arabic (rtl) language in README.md file in github.
So how could I do this?

You can't do this with markdown but you can surely do this with HTML.
<div dir="rtl">
## عنوان
### قائمة
<ul>
<li>١. البند 1</li>
<li>٢.البند 2</li>
<li>٣.البند 3</li>
</ul>
</div>
If just some parts of the document need to be right-to-left:
## <div dir="rtl">عنوان</div>
### <div dir="rtl">قائمة</div>
<div dir="rtl"><ul>
<li>١. البند 1</li>
<li>٢.البند 2</li>
<li>٣.البند 3</li>
</ul></div>

You could consider using ahmadajmi/markdown-arabic which includes a right-to-left markdown editor.
Online version is also available at arabicmarkdown.netlify.com

Related

Can tinyMCE editor or Jsoup fix html markup errors?

I am using tinymce editor in my project. HTML markup generated by editor is parsed using Jsoup (v.1.7.2) and is used to generate pdf using Apache FOP.
When user uses features of editor itself it generates valid html markup but if some user uses tool to include source code from other source directly and let's say he enters,
<ul>
<ul>
<ul>
<li>
one
</li>
<li>
two
</li>
<li>
three
</li>
<li>
four
</li>
</ul>
</ul></ul>
the edior is not fixing markup to,
<ul>
<li>
one
</li>
<li>
two
</li>
<li>
three
</li>
<li>
four
</li>
</ul>
As per https://validator.w3.org/nu/#textarea
the first markup is not valid,
Error: Element ul not allowed as child of element ul in this context.
Is fixing html markup possible in tinymce editor or with Jsoup parser, If not any other approach?
You can try using JTidy,
Tidy tidy = new Tidy();
tidy.setXHTML(true);
final InputStream inputStream = new FileInputStream("input.html");
tidy.parse(inputStream, System.out);

Breadcrumb Microdata markup valid both for Google and Bing

I want to create a breadcrumb navigation with the Microdata format.
So I'm using following BreadcrumbList markup and Google Structured Data Testing Tool recognized it:
<ol itemscope itemtype="http://schema.org/BreadcrumbList">
<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
<a itemprop="item" href="https://example.com/home">
<span itemprop="name">Home</span>
</a>
<meta itemprop="position" content="1" />
</li>
<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
<a itemprop="item" href="https://example.com/home/fashionn">
<span itemprop="name">Fashion</span>
</a>
<meta itemprop="position" content="2" />
</li>
<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
<span itemprop="name">Coats</span>
<meta itemprop="position" content="3">
</li>
</ol>
But from Bing Markup Validator I receved following message:
We are not seeing any markup on this page. Please ensure the markup has been implemented correctly.
Regarding Bing documentation the following markup is correct for breadcrumb:
<ol>
<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<a itemprop="url" href="https://example.com/home">
<span itemprop="title">Home</span>
</a>
</li>
<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<a itemprop="url" href="https://example.com/home/fashion">
<span itemprop="title">Fashion</span>
</a>
</li>
<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<span itemprop="title">Coats</span>
</li>
</ol>
So is there a way to create a breadcrumb navigation with Microdata format which would be valid both for Google and Bing?
To rephrase your goal, as far as I understand it: You want to markup your breadcrumbs
with Microdata
using two vocabularies (Schema.org and Data-Vocabulary.org)
without duplicating your content
so that Bing’s and Google’s testing tool still validate it.
Microdata makes it hard to mix vocabularies:
In itemtype, you can only use types from the same vocabulary.
In itemprop, you can mix properties from different vocabularies, but only the properties from one vocabulary can be specified in the shorter string form, while the properties from all other vocabularies have to be specified as absolute URIs.
(This isn’t a problem if consumers support the absolute URI form for the properties they recognize.)
(By the way, RDFa supports mixing vocabularies way better, so you might want to consider using RDFa instead of Microdata.)
A way to avoid the problem, maybe.
Use Data-Vocabulary.org for Bing and Google.
While the vocabulary Data-Vocabulary.org is deprecated and deleted (I wonder why Bing is still recommending it), Google still seems to support it, too (probably because it’s still used on many websites from back then, when Google recommended it, too).
I don’t know if it really works, but at least Google’s SDTT doesn’t give any warnings/errors for your Data-Vocabulary.org snippet.
Solutions, maybe.
Unfortunately, I can’t test it in Bing’s tool (because an account is required), so the following snippets don’t necessarily work.
itemref + absolute URIs for Data-Vocabulary.org’s title
This snippet uses Schema.org as primary vocabulary. An empty div outside of Schema.org’s BreadcrumbList is used to create the item for Data-Vocabulary.org’s Breadcrumb. This item references the a elements via itemref. It reuses the url property (because it’s named the same in both vocabularies) and provides Data-Vocabulary.org’s title property as absolute URI.
<div itemscope itemtype="http://data-vocabulary.org/Breadcrumb" itemref="b1 b2">
</div>
<ol itemscope itemtype="http://schema.org/BreadcrumbList">
<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
<span itemprop="item" itemscope itemtype="http://schema.org/WebPage">
<span itemprop="name">
<a itemprop="url" href="https://example.com/" id="b1">
<span itemprop="http://data-vocabulary.org/Breadcrumb/title">Home</span>
</a>
</span>
</span>
<meta itemprop="position" content="1" />
</li>
<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
<span itemprop="item" itemscope itemtype="http://schema.org/WebPage">
<span itemprop="name">
<a itemprop="url" href="https://example.com/fashion" id="b2">
<span itemprop="http://data-vocabulary.org/Breadcrumb/title">Fashion</span>
</a>
</span>
</span>
<meta itemprop="position" content="2" />
</li>
</ol>
It works in Google’s SDTT (it should be fine to ignore the warning that Breadcrumb/title is not recognized; it’s specified as absolute URI, so it can be used everywhere).
Whether it works in Bing’s testing tool depends on if Bing recognizes http://data-vocabulary.org/Breadcrumb/title as title property.
As the vocabulary is deleted, I’m not sure if it really was http://data-vocabulary.org/Breadcrumb/title instead of http://data-vocabulary.org/title, but if I remember it correctly, it should have been the first one.
itemref + absolute URIs for Schema.org’s name
Same idea like in the snippet above, but this time Data-Vocabulary.org would be the primary vocabulary, while Schema.org’s BreadcrumbList gets created in an empty div.
This is harder, because Schema.org’s structure requires more properties, so you have to create more empty elements.
<div itemscope itemtype="http://schema.org/BreadcrumbList">
<div itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
<span itemprop="item" itemscope itemtype="http://schema.org/WebPage" itemref="b1">
</span>
<meta itemprop="position" content="1" />
</div>
<div itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
<span itemprop="item" itemscope itemtype="http://schema.org/WebPage" itemref="b2">
</span>
<meta itemprop="position" content="2" />
</div>
</div>
<ol itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<li itemprop="title">
<a itemprop="url" href="https://example.com/" id="b1">
<span itemprop="http://schema.org/name">Home</span>
</a>
</li>
<li itemprop="title">
<a itemprop="url" href="https://example.com/fashion" id="b2">
<span itemprop="http://schema.org/name">Fashion</span>
</a>
</li>
</ol>
It works in Google’s SDTT (it should be fine to ignore the warning that name is not recognized; it’s specified as absolute URI, so it can be used everywhere).

CMS theme. "404 not found" on any link click

Well, this is the code included in Header.html on my site. Whenever I click on Topics, Home, or any link that leads to (www.mywebsite/THElink) I get a 404 page not found. However, on the demo of the CMS theme, those links give information taken from MySQL Db which also I have configured right.
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li {if isset($is_home) AND $is_home eq 1}class="active" {/if}>Home</li>
<li {if isset($is_topics) AND $is_topics eq 1}class="active"{/if}>Topics</li>
<li {if isset($is_authors) AND $is_authors eq 1}class="active"{/if}>Authors</li>
</ul>
<ul class="nav navbar-nav navbar-right search-nav">
<li class="search-form">
<form method="GET" action="./search/">
<div class="input-group">
<input type="text" name="q" class="form-control" placeholder="Search Quotes" {if isset($is_search) AND $is_search eq 1}value="{$q}"{/if} />
<span class="input-group-addon"><button type="submit" class="btn-link"><span class="fa fa-search"></span></button></span>
</div>
</form>
</li>
</ul>
</div>
it's just an issue of .htaccess file. This particular file has huge impact on the whole site.

Which Schema.org property should I use for popular posts item list?

Example markup of what I have:
<body itemscope='itemscope' itemtype='http://schema.org/WebPage'>
<div id="main" itemprop='mainContentOfPage' itemscope='itemscope' itemtype="http://schema.org/Blog">
<article itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'>
blah blah blah
</article>
<div>
<aside>
<ul>
<li><article><img/>popular post article</article></li>
<li><article><img/>popular post article</article></li>
</ul>
</aside>
</body>
What should I use for the articles within each list item? I thought of articleSection, but that doesn't make sense because it's not within an article schema. So I'm trying to wrap my around the best way to add Microdata here.
Moving the aside within the article isn't really a viable option either. This is Blogger, so doing that would be tricky, especially on the admin widget-management side of things.
Update (2016): In the meantime Schema.org introduced a property to denote that an item is the main/primary one for a page: mainEntity (see details). So the below answer is somewhat out of date.
If they are also blog posts, you would use BlogPosting, too.
Microdata is not only for the main content of a page. However, the Schema.org vocabulary currently lacks a property to mark an item as the main content item of a page (the property mainContentOfPage is only allowed for WebPage).
By using articleBody for the main BlogPosting, capable consumers should be able to deduce that the other BlogPosting items on the page (which naturally don’t have the articleBody property) are only linked/related posts.
So it could look like:
<div itemscope itemtype="http://schema.org/Blog">
<article itemprop="blogPost" itemscope itemtype="http://schema.org/BlogPosting">
<div itemprop="articleBody">…</div>
</article>
<aside>
<ul>
<li>
<article itemprop="blogPost" itemscope itemtype="http://schema.org/BlogPosting">
<span itemprop="name">Post 4</span>
</article>
</li>
<li>
<article itemprop="blogPost" itemscope itemtype="http://schema.org/BlogPosting">
<span itemprop="name">Post 5</span>
</article>
</li>
</ul>
</aside>
</div>

Add Microdata/Schema.org autocompletion suport to PHPStorm

Exist way add schema.org autocompletion to PHPStorm ?
For example I want autocompletion for
itemscope itemtype="http://schema.org/Article"
yes. For the code like
<div itemscope itemtype="http://data-vocabulary.org/Person">
My name is <span itemprop="name">Smith</span>
<span itemprop="<ctrl+space here>" itemscope itemtype="http://data-vocabulary.org/Address">
<span itemprop="locality">Albuquerque</span>
<span itemprop="region">NM</span>
</span>
</div>
completion suggests the corresponding properties. But you need to fetch the resource to make it work - hit Alt+Enter on the URL and choose 'Fetch external resource'