github link to wiki page from README - github

How do I create a link from a README.md file to a Wiki page in github? Every example seems to show linking from one wiki page to another wiki page, or from one README file to another file in the repository. But none that show linking from one to the other

I just came across this question and saw that this was impossible, but stubbornly kept trying anyway. Good news, because this actually can be done with relative links!
If you look at the documentation for relative links on GitHub, you can see that it supports ./ and ../ operands.
Given that your README is located at:
https://github.com/<user-name>/<repo-name>/blob/master/README.md
... and the wiki is located at:
https://github.com/<user-name>/<repo-name>/wiki
... that means you can just crawl back from the README to the wiki, like so:
[My Awesome Wiki](../../wiki)
Update: As some people have pointed out in the comments (thanks!), please be aware that these relative links will break on clones and forks, so be sure to weigh that into your decision!

You would have to use an absolute URL as opposed to a relative one.
For example:
[Sites Using React](https://github.com/facebook/react/wiki/Sites-Using-React)

I found that I needed to crawl back 3 levels versus 2 levels as descreibed in jmar777's approach.
When I used
../../wiki
The link generated was https://github.com/<username>/blob/wiki
I needed to use:
../../../wiki
This generated https://github.com/<username>/wiki

I am using GitLab. My link to my Wiki page looks like this.
Checkout the [Wiki page](/%2E%2E/wikis/Welcome)
I tried the other recommendations that are posted here but it kept changing the URL with re-writes that broke the link.

Just to add on this one, if you want to refer to your repo file from inside wiki use ../../blob/master/. Combined with the answer from jmar777 this allows to completely integrate code and wiki and remove a need for bloated readme.md.
To make it work locally as well as your file structure would have to be
./Wiki/YourWikiRepo
./blob/master/YourCodeRepo

Related

How can I use markdown files on a (different) GitHub repo as source for a static Next JS site?

I'm trying to get a small blog up and running using Next JS. I'd like to keep the markdown (and .mdx) files on a different repo from the site itself. With Gatsby this was no issue using gatsby-source-git, is there a similar way of doing things for Next JS?
If someone could point me to the right docs that would be awesome too, my google-fu isn't working. All the official docs for next-mdx-remote just use const source = 'Some **mdx** text' and don't go into detail about how to get that source into Next JS.

How to quote code in a Mardkown GitHub Gist

In a markdown file in a Gist, how do you quote some lines of code that are in a GitHub project?
If I was writing a Gist to try and explain how something works, I might have a block of text, then quote some code. I don't want to cut and paste the code in, I just want to quote some lines of code in a GitHub project. I am sure I have seen this done, but can't find an explanation of how to do it.
For example:
This algorithm makes use of Dijkstra's topological sort algorithm:
100: Result myFancyPantsAlgorithm(Blah blah) {
101: youGetTheIdea();
102: }
It is not possible to embed GitHub code snippets from Repositories.
What you might have seen is having a gist embedded in a "normal" website which is possible because GitHub provides a script to embed gists.
The script tag is (un)fortunately not whitelisted to be used in GitHub Flavored Markdown, so it is not possible to embed a gist in markdown.
A way to get around this would be to set a gh-page up, where you are able to embed a Gist as this SO-question shows. But then you're still not referencing to any live codebase.
So the answer to your question is: this is not possible, wether by embedding code from a repository nor by taking a detour via using gists.

How to use GitHub to make a public gist? What is the procedure?

I want to create a public gist in GitHub. I've been on YouTube and in Google search but have not found an answer to this question. And I don't see an answer in Stackoverflow to this question. This my seem trivial to some of you but I'm not so savvy in the tech world. I have a GitHub account. I did the tutorial in the Read Me Guide where I learned about repositories, branch, commit and pull request. I was in StackExchange chat room where someone asked me to make a public gist of my code that I was asking help with. Now I want to create a public gist of my code. On the Gist page I see a place to where I think the code is suppose to go. I see an Add File tab. But nothing happens when I click on it.The app won't let me just paste in my code. I see a place for a gist description. And I see a place for a file name including extension. But how do I place my code to create a public gist? Where does it go? Somebody help, please. After some more searching I think I got an answer. A Gist is just a repository. Am I right or wrong?
Assuming that you are logged in on GitHub:
Visit the Gist page
Paste your code in the text box directly underneath where it lets you set a file name;
Then press 'create public gist' in the bottom right.
For more information on this, visit the official docs.
If you want to create public gist repository on github then following steps are there,
There is a GithubHist(https://gist.github.com/) available to share you code publicly over the internet.
One of the advantage to use this is that when you create repository in GithubHist, one same repository will be created on https://bl.ocks.org
This will run your code and show output to the user.
Steps to use GithubHist
Login on Github.
There is a Gist option on top of then menu. Click on this.
It will redirect you on https://gist.github.com/
Here in Gist description give Title of your project.
Now create index.html file. This file runs by default when you go on https://bl.ocks.org with your repository location.
Now you can add as many files that you need in your project here.Just click on add file.
To add License,you need to add license.txt file and add contents of the license.
At last click on “Create public gist” or “Create Secret gist” option at bottom.
To add Background image of your project on https://bl.ocks.org
Get git clone of project to your local machine.
Create file with name “thumbnail.png” with dimension 230px * 120px.
Add this file to your project.
Commit and Push changes.
It’s Done now.
Check your Project with links
https://gist.github.com/yourName/ProjectId Source of project
https://bl.ocks.org/yourName/ProjectId output of project with source
Please see my blog on medium
https://medium.com/#thakkarchintu5/using-githubgist-on-github-f4f0944bbc80
also check gist repository that I have created
https://bl.ocks.org/ChandrakantThakkarDigiCorp

How to set up multiple Sphinx documents in one project in ReadTheDocs?

I would like to use ReadTheDocs to host my Sphinx documentation. The project is hosted on github. I can connect to it just fine.
The particularity that I have is that the project contains 2 Sphinx documents (e.g. a programmer's manual and a user's manual). ReadTheDocs appears to be detecting both (there are two conf.py) and building both. However when it comes to displaying them, it displays the html for only one of them, as far as I can make it, the first one alphabetically.
So my questions are:
If both have been built, how do you get to see the other one?
Is there a way to use "subprojects" to specify the path to each conf.py and hence have clear URL to each document/manual? That would be the ideal solution.
Read the Docs does not support building two different sets of documentation from the same repository and same Read the Docs project. However, you could use sphinx-multiproject extension to achieve this.
You will need to define this extension in your requirements (see https://docs.readthedocs.io/en/stable/guides/specifying-dependencies.html) and then import your repository twice under Read the Docs --one time per set of documentation you want to host: mydocs-users and mydocs-developers, for example.
Note that this is the exact pattern that Read the Docs itself uses for its documentation:
User's documentation: https://docs.readthedocs.io/
Developer's documentation: https://dev.readthedocs.io/
The repository for both sets of documentation is the same (https://github.com/readthedocs/readthedocs.org/) but documentation generated on each of the projects is defined by that sphinx-multiproject extension. See https://github.com/readthedocs/readthedocs.org/blob/6bf0bede7b757f1e9458e29ba89b591389cae4d5/docs/conf.py#L48-L63
Be sure you follow the tutorial.
Usually you need an index (in conf.py it is referred as master_doc).
Then each file must be referenced, either in a toctree or a include, or a link, etc.
Look at examples on github (ie: the Sphinx-doc repository).

GitHub link from Issue to Wiki

I want link wiki-page to issue text.
[]() syntax links into issues pool.
[[text|page]] doesn't work.
How to do it?
You can also use relative paths. Here's an example from one of my projects:
[Using-a-Shell-Configuration-File](../wikis/Using-a-Shell-Configuration-File)
I prefer this approach to full paths, since it's not impossible that you might rename a project or transfer ownership to someone else, and so break any absolute references to parts of the repo.
Use [text](link_to_wiki_page) where link_to_wiki_page is the full URL of the wiki page you want to link to. Just navigate to the page and copy/paste the URL from the URL bar.