GitHub: Linking to an issue from a wiki page - github

On GitHub, is there a simple way to reference an issue (eg: #1234) from within a markdown file such that it is displayed as a hyperlink?
I don't want to write out the full form each time, as in:
[#1234](//github.com/user/project/issues/1234)
In commit messages, issue numbers are automatically hyperlinked. Can this happen in wiki documents too?
(This is not a duplicate of this question which is simply asking about markdown hyperlink syntax.)

It doesn't happen in wiki documents.
You can use a relative url but it isn't that much of a shortcut. It also depends on where you are in the project.
For example in the Readme.md in the master branch of the project:
[#1](../../issues/1)
On the github wikis:
[#1](../issues/1)
Anywhere:
[#1](/user/project/issues/1)
(h/t to VertigoRay for suggesting this)

Related

How can I rename a Page/Topic on GitHub wiki without renaming the file?

I want to update Topic/page titles on my GitHub wiki (which is currently using Markdown syntax). When I do that using the GUI it renames the Markdown files, and breaks all of the links.
I know that I can rename the Topic files in the Git repository and push the changes, but that doesn't help the broken links.
Is there a way to avoid this, and make GitHub Wiki's behave more like other Wiki products? I could not find an better way on GitHub documentation.
Welcome to StackOverflow. As best I can determine you cannot rename a GitHub Wiki page without its markdown file also being updated to the new name. The two are tightly coupled.
This Web Applications (StackExchange) Question has some alternatives you may consider, i.e. instead of renaming the page, create a copy. Then edit the original page so that it directs visitors to the new page via a link. This way the original page link remains valid but directs visitors to the new page.

GitHub changelog links to commits

Some projects have a CHANGELOG.md file where each version links to the range of commits that were made for that version. For example, this one. It looks like these links are automatically generated somehow, because the markdown only contains [1.0.0] where the rendered document has a link to https://github.com/olivierlacan/keep-a-changelog/compare/v0.3.0...v1.0.0.
How does that work? I've tried to do something like this on my own project, but the rendered document just said [1.0.0]; no link was generated.
Presumably it has something to do with the tags, which follow a similar pattern (v1.0.0), but when I tried to create similar tags in my project, it still didn't work.
I also could find no reference to this on the GitHub help, or anywhere else for that matter.
Is this indeed an (undocumented?) feature of GitHub? If yes, how does it work? If no, how do these projects do it?
Note, I'm not interested in automatically generating a changelog from commits like this project does. I'm just interested in the mechanics of these hyperlinks.
You need to look beneath the surface of the Markdown, it's a simple trick he done by using the file compare feature to compare tags.
If you look at the RAW file, you should notice at the bottom he added links to each version number that has a compare link assigned to it.
## [1.0.0] - 2017-06-20
[1.0.0]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.3.0...v1.0.0
With pretty mode, you would see the link to the compare page.

how to embed github file to a github pages blog post

I am creating a blog using github pages and jekyll. I wonder if there is a way to embed code snippets from a github file (i.e., a file in a repo) in a blog post. I can find a solution on this page about embedding gists: https://gist.github.com/benbalter/5555251.
No direct solution for github files, though.
Jekyll has a pretty nifty syntax-highlighting system (provides _sass/sytax-highlighting.scss is present and correct), so it would be possible to just copy the code over into a blogpost, using `s to wrap the code.
As per actually embedding from a Github repo, there is a pretty nifty project here, if you want to check it out.

GitHub Markdown - Add current branch name

Just a short question:
Is it possible to show the current branch name in e.g. README.md automatically with a placeholder or something like that using GitHub Flavored Markdown?
No, I'm not aware of anything like that within READMEs or any other markdown documents when browsing through the source of your project. And nothing turns up when searching their help page either.
However, GitHub Pages offers all sorts of info about the repo the document is associated with. Of course, GitHub Pages is a very different thing than a README file, so that may or may not be helpful to you.

Viewing .rst within a "github pages" site

I'm moving an open source project's documentation over to Github Pages but I'm stuck on moving the .rst files.
We have a ReadMe.rst which you can see here in the code. I'd like to link to that page from our main documentation page but GitHub doesn't render the .rst as HTML so the browser simply downloads the text of the .rst file when you click the link).
There are of course tools to render .rst as HTML but that's a serious extra step. The whole reason we started using .rst was entirely because GitHub renders it automatically in code pages. You'd think there'd be some way to get this authomatic rendering happening for Github Pages...
GitHub Pages does not have support for .rst/RestructuredText. It only supports Markdown and Textile conversion to HTML.
GitHub Pages does not have support for reStructuredText directly, but Anne Gentle has created a nice demo of how you can get something working with reasonably simple steps:
https://github.com/annegentle/create-demo
Especially useful to look at the github workflow for how to automatically generate the needed HTML from reStructuredText sources on every commit.