Why clicking on sidebar links takes to raw content page on github wiki? - github

I have created a github Wiki page Introduction.md and sidebar file _Sidebar.md in the same directory in a private repo. When I click on sidebar link I'm redirected to raw page, although the link shows appropriate url.
page Introduction.md has below content
# Introduction <a name="heading--1">
This is a web application.
And the _Sidebar.md has below content:
# Table of contents
**[1. Introduction](Introduction.md#heading--1)**
On hovering the link on sidebar it shows correct url as:
https://github.com/testorg/ecom/wiki/Introduction.md#heading--1
But on clicking the link it redirects to raw page and shows the raw content for Introduction.md above
https://raw.githubusercontent.com/wiki/testorg/ecom/Introduction.md?token=GHSAT0AAAAAATESTINGTOKENAZG2ZMAQ33POCYYHFSBQ#heading--1
Why this type of behavior, What I'm missing here?

Almost there, however, is one small issue in your URL. Instead of
**[1. Introduction](Introduction.md#heading--1)**
Remove .md from the URL.
**[1. Introduction](Introduction#heading--1)**

Related

How do I replace "View page source" with "Edit on GitHub" links in sphinx_rtd_theme?

How can I replace the View page source hyperlink at the top of my docs pages with a Edit on GitHub link when building a Sphinx site using the sphinx_rtd_theme theme?
I'm manually building a readthedocs.io-like site using GitHub Pages, but the link in the top-right of all my doc's pages still says "View page source" instead of "Edit on GitHub."
The theme's documentation lists a few relevant options (display_github, vcs_pageview_mode, and github_url), but it provides no examples. I've tried setting them at the root of conf.py and in html_theme_options to no avail.
How can I tell the sphinx_rtd_theme theme to change the View page source link to an Edit on GitHub link on all my docs' pages?
Use should set the display_github, github_user, github_repo, and github_version variables inside the html_context dict in conf.py. For example:
html_context = {
'display_github': True,
'github_user': 'buskill',
'github_repo': 'buskill-app',
'github_version': 'master/docs/',
}
These variables are intended to be set directly in the .rst files rather than in html_theme_options or conf.py in general. To make this actually apply site-wide as if it were defined in every .rst file, just put it in html_context.
See also:
https://github.com/readthedocs/sphinx_rtd_theme/issues/529
https://github.com/readthedocs/sphinx_rtd_theme/blob/master/sphinx_rtd_theme/breadcrumbs.html

How can I publish old html commits in my gh-pages branch online?

I'm writing a blog post and want my readers to see several old commits (of html) in my gh-pages branch.
In my blog post, I want to say, here's how the code looked in the browser, at this commit.
For example, this is one of the old commits that I want to show: as an html page that someone could view in their browser as the HTML would look in a browser; I don't want to just show them that raw page on github because the code on that old commit is broken and want the reader to see the error that the browser's console would give.
I'm thinking of something like: skorasaurus.github.io/reponame/commithash/index.html ?
Does this exist?
If you click on the "View" button of the index.html file listed on https://github.com/skorasaurus/dtparking/commit/945fae4e059fb12090a8dc22c6cd22e665ebeea2, you will get the exact reference for that file:
https://github.com/skorasaurus/dtparking/blob/945fae4e059fb12090a8dc22c6cd22e665ebeea2/index.html
You can then use the service from htmlpreview.github.io to visualize that specific version:
http://htmlpreview.github.io/?https://github.com/skorasaurus/dtparking/blob/945fae4e059fb12090a8dc22c6cd22e665ebeea2/index.html
(with the console of the browser including: Error: Map container is already initialized.)
See other alternatives at "Can I run HTML files directly from GitHub, instead of just viewing their source?".
You can then try and embed that rendered page in your gh-branch source. For instance (How to embed a “live” web page in WordPress blog posts)
<object data=http://www.example.com width=”650″ height=”500″>
<embed src=http://www.example.com width=”650″ height=”500″ />
</object>
(replace example.com with the full htmlpreview url above)

Left-clicking a PDF in GitHub should display it in the browser or download it?

I have a PDF hosted in a GitHub directory. I have a link to this PDF in my README.md as follows -
[foo](https://github.com/me/bar_repo/foo.pdf)
so that users can find it easily when they access the repository. However when they click the link instead of opening the PDF in the browser or downloading it, the users is brought to the github page with url - https://github.com/me/bar_repo/foo.pdf - and here they have options to "View Raw", "Open", etc...(and the Open command requires installation of GitHub for windows...sigh).
I simply want to let users view the PDF in the browser or be given the option to download it if they left-click this link, as is usually the case when people click on links for PDFs on the net.
Does anyone know how I can make this happen?
You need to link to the raw version. So on the resulting page, context click the Raw button, and choose Copy link address and use that URL in your README.
A simpler option should be available since March 17th, 2015:
"PDF Viewing"
Simply browse to a PDF document and we'll render it in your browser like any other file.
From presentations to papers, we've got you covered.
Many thanks to Mozilla and every contributor to PDF.js.
Try https://rawgit.com
Copy paste your pdf path in https://rawgit.com which gives you an URL which can be viewed on a browser.

Share dialog posts do not include query string of deep link to facebook iframe page tab

I am attempting to use the standard Facebook share button to share a deep link into my iframe page tab of the form:
https://www.facebook.com/YourPage?v=app_1234567890&app_data=any_string_here
where app_data content is a deep link relative path into my iframe page tab app content
(e.g. /path/to/page_that_I_shared_from).
Just to be clear, there is a Share button on my iframe app page, and I am trying to generate the link back to that page to be shared.
I place the absolute URL above into the data-href parameter per the Share Dialog documentation, and when I click the Share button, the url in the share dialog is of the form:
https://www.facebook.com/sharer/sharer.php?app_id=my_app_id&sdk=joey&u=url_encoded_version_of_the_absolute_url_above&display=popup
but when the post is rendered, the query string is stripped completely.
Note that if I use a non-Facebook URL, the query string is preserved.
I do notice that app_id parameter in the share dialog URL - perhaps the fact that this is coming from inside the page tab iframe makes a difference.
Initial testing with the feed dialog looks promising, but I'd like to use the share button since it provides more flexibility as to the destination of the post.
The final solution was to generate the link like so:
https://www.facebook.com/pages/<page id>/<page id>?id=<page_id>&sk=app_<FB_app_ id>&app_data=<deep link>
where deep_link is a relative URL with a query string that starts with a '?' and has the '&' characters replaced with '|' characters (poor man's encoding that I decode on the way in).
I saw several suggestions (mostly here on SO) to double or even triple encode the app_data URL - none of these worked, and usually they resulted in links that could not be posted by the sharer.php script.

Facebook "Like" button encoding

I've put like button on joomla site with cyrillic text:
http://womanew.kz/index.php/2011-10-22-01-42-12/2011-11-01-05-34-04/147-2011-11-07-06-22-02
When I push like button facebook's scraper incorrectly encodes the page.
Also I've created static test html page equal to this URL (http://womanew.kz/test.html), and it scrapes well.
All two pages have equal content, but the problem page is generated from Joomla PHP script.
Also I've noticed that scraper reencodes not full document (it keeps head block unchanged), please see its "See exactly what our scraper sees for your URL" debuging page on facebook.
What can I do to struggle this problem?
When I did this I use this manual and didn't have such problem. This is for Joomla website:
1.Go to the Facebook developer page here: http://developers.facebook.com/docs/reference/plugins/like-box
2.Enter the page number (found in your Facebook page URL) of your Facebook page.
3.If you don't have one, go to Facebook Create Page wizard and create a Brand >> Website page for your site.
4.Enter the height (typically 400 pixels) that you want for the Like widget
5.Click the Get Code button to generate the Facebook Code.
6.Open the Joomla Administrator on your site
7.Navigate to the Module Manager
8.Click the New button
9.Select Custom HTML
10.Paste the code into the HTML box (make sure the editor is turned off).
11.Give the module a name
12.Click the Hide Title radio button
13.Select the Module Position where you want the widget to appear
14.Click Save
Also, take a look at http://www.abolkog.com/portal/tutorials-how-to/100-how-to-add-a-facebook-like-box-to-your-joomla-site
Hope, it will help you!
I've found a bug in the site. One of joomla's modules was truncating UTF-8 strings in byte boundaries and this was created one-byte bug character in the page, after this character scraper starts using incorrect encoding.