My First Post      My Facebook Profile      My MeOnShow Profile      W3LC Facebook Page      Learners Consortium Group      Job Portal      Shopping @Yeyhi.com









Sunday, May 14, 2017

Using Github ReadMe opened programatically : How to open and read the ReadMe.md file dynamically

It is noteworthy to understand that HTML does work in the ReadMe.md file. With this clear understanding, I guess many of such questions would be automatically answered like - how to make bold font in ReadMe file, or how to insert image etc. Also note that it depends a lot on what application/ text editor you are using and also lot on the OS. 

Recently I had trouble in inserting blank line character in the Readme.md file of Github. I personally preferred < br /> tag there, and i have a full post describing the same: http://www.w3lc.com/2017/05/new-line-in-readme-file-github-fixing.html. I have demonstrated the change in a git commit in the Github repository explained in the post. See: https://github.com/Anwar-Faiz/Simple-Java-Unicode/commit/85bd54531067ff4055c5e8801aba5324221d5ae3

This understanding was much needed to handle the question and also to find many other uses of why you would probably need to do it!

Further, to answer the question straight, you need two steps: 
1. Find the Url for the ReadMe.md file in Raw version. For example see one: https://raw.githubusercontent.com/Anwar-Faiz/forkrap/master/README.md 
How to open Raw view of ReadMe.md file: ( See screenshot )


2. Now if you want to use server side the using file_gets_content etc of php you can load the url. Or, if you want to use jquery, you can use the Load().

** Do, also notice that if you do View Source of the Raw URL page, you just see, plain text. So, you don't need to do much text parsing stuffs as well :) This is a good news.
** Next you can use unescape functions or tools like codebeautify to unescape the characters that can alter with the look and feel of your HTML like ' <   " etc etc.

Have a great Day dear :)
@Anwar Jamal Faiz

No comments:

Post a Comment