Hello, I’m The Silent King.
Today to introduce you to a GitHub SAO operation, it is!
As we all know, GitHub is a hosting platform for open source and private software projects. It is named GitHub because it only supports Git as the only version library format for hosting.
GitHub’s social coding philosophy has made it a sacred and inviolable object in the eyes of developers at home and abroad. Numerous high-quality open source projects rely on GitHub and flourish with the joint participation of developers around the world.
But, seriously, have you read the source code properly on GitHub?
Don’t be modest, I suspect most people don’t have this habit (including me). GitHub, as good as it is, is not as convenient as an IDE. I’ve tried to install help add-ons like Octotree and Sourcegraph for Chrome, but still don’t find them enjoyable enough to use.
Before I met the pig’s foot that I shared today, the most I used was to clone the warehouse locally and then browse it after opening it through the IDE. While I’m not a tech geek, I’ve always found this approach a bit lackluster.
Wouldn’t it be nice to be able to read GitHub’s source code in a browser like an IDE?
The GitHub repository domain name should be added 1s (within 1 second), for example:
Github1s.com/itwanger/Te…
You can use the VS Code environment in your browser to read the source Code for the repository!
It was a real eye-opener!
Just add 1s after the domain name of the repository, and you can read the source Code with VS Code, which supports syntax highlighting and refactoring.
Why is that? What’s going on behind the scenes?
The answer is simple and depends on GitHub’s 15.3K repository called Github1s, which is based on VS Code 1.52.1, a version that works directly in the browser.
Github1s takes its inspiration from code-Server, an excellent open source project with a star of 46.6K that runs VS Code on any browser-enabled machine. Github1s stands on the shoulders of giants, so to speak.
Thanks to VS Code’s powerful and flexible extensibility, we can implement custom file IO extensions with its FileSystemProvider interface.
On the other hand, GitHub also provides a powerful REST API that allows us to read the repository’s directories and files freely.
That said, VS Code’s extensibility and GitHub’s REST API make Github1s powerful.
Because Github1s is deployed on GitHub Pages, it is a purely static Web application, meaning that it does not require a dedicated server to serve it. It’s naked, and it’s very reliable, because GitHub Pages are very reliable, and my personal blog is also deployed on GitHub Pages.
The fly in the ointment is that you can only read the source code, not edit it, and the files are read-only – it’s not too comfortable to hope that Github1s authors will be able to do that in the future.
If you are interested in this operation, you might as well try it. If you have time, you can read the source code of Github1s to learn.
At the end of the article, recommend a GitHub warehouse to everyone again, treasure is general, do not believe you to open look, 51 holiday will certainly have a big gain.
Github.com/itwanger/Ja…