Introducing Sapphire Plugins
The first iteration of the sapphire plugin was on 11/24/2003 and was intended to be used exclusively with MicroSoft Word, that is, only working with unix-like operating systems. It didn’t last long before proprietary software developers looked into creating their own formats that would work in the same document as you were writing. This was not only problematic because of this tendency to encroach on what they thought was their domain, but also because the proprietary plugins provided absolutely no help in creating an easier to maintain code base.
How Sapphire Plugins can help you build better websites
The other benefit of using a plugin, like the one for rdoc, is that it provides you with a single point of contact for your code. If you know how to use the rdoc plugin you are building on your own website, then all you need to do is go to your website’s plugins area and install the rdoc plugin . This is like installing any other type of plugin on a WordPress install.
Setting Up Your Project
I’ve chosen to use RDoc Lite as my ruby-to-html converter. I only have a few directories. Here is the skeleton of my directory structure.
My index.html file uses a plugin to convert my markdown document into html and then uses another plugin to convert the html into a kramdown document with the original markdown converted as well.
The benefits of using Sapphire Plugins
A ruby developer can create a conversion plugin that will take in a file that simply contains ruby code. Then, this plugin will convert this code into many formats. For example, syntax highlighting is common on the web and I have several plugins available for me to use on my website(s). The benefits of using these plugins are that I can write the same code twice and have it work exactly the same on my website. I can use any terminal or editor to run my scripts without having to jump through hoops to make them work on every computer I use. It also lets me write in a programming language that is easier for my eyes to read. When I am at work, I can use my laptop and run my scripts. When I am at home, I can use my desktop and run them. It makes things easier in general to make sure that multiple computers have the same version of the plugins.
With that said, here is a simple rundown on “Ruby Gems ( rubygems )” and “RubyGems.”
RUBYGEMS: RubyGems is a project to manage Ruby libraries. It’s designed to automate and provide standard ways to install, manage, and work with Ruby libraries. It’s not a Ruby package manager in the sense of yum or apt-get , it’s a higher-level library that provides these functions.
A look at some of the most popular Sapphire Plugins
I mentioned the markdown plugin already. My favorite, however, is the sapphire syntax highlighting plugin. The reason I love it so much is because it allows me to see my code in a much different color way. It also allows me to keep more of my code in the same file without it being overly verbose. I have also created a few plugins that you can find on my GitHub under the username of mholt6/sapphire-plugins.
One of my favorites is a plugin to use docker-compose in the terminal. I also made a plugin for creating, editing, and running Ansible playbooks that you can find on my GitHub under mholt6/sapphire-ansible. Both of these plugins have been published to the sapphire-plugins organization on GitHub.
You can install these plugins and any other sapphire plugins from the Advanced tab in VS Code after you install sapphire from the marketplace. If you use the full-page search feature and scroll down, you will find some other plugins there to install as well.