1
0
This commit is contained in:
Deven Blake 2021-06-20 19:50:09 -04:00
parent b2c82520d3
commit 6076fc884e

View File

@ -19,41 +19,40 @@
<SCRIPT TYPE="application/javascript"> <SCRIPT TYPE="application/javascript">
/* Special thanks to wiresToGround and adamz01h for their help getting this /* Special thanks to wiresToGround and adamz01h for their help getting this
* JavaScript to work. */ * JavaScript to work. */
window.is_highlightjs_here = 0; window.is_highlightjs_here = false;
window.is_highlighted_languages = []; window.is_highlighted_languages = [];
window.to_be_highlighted = []; window.to_be_highlighted = [];
window.is_highlight_stylesheet_here = 0; window.is_highlight_stylesheet_here = false;
window.load_highlighting = function(language){ window.load_highlighting = function(language){
var element;
var script; var script;
if(!window.is_highlight_stylesheet_here){ if(!window.is_highlight_stylesheet_here){
document.getElementById("highlight").setAttribute("href", "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.0.1/styles/default.min.css"); document.getElementById("highlight").setAttribute("href", "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.0.1/styles/default.min.css");
window.is_highlight_stylesheet_here = 1; window.is_highlight_stylesheet_here = true;
} }
if(!window.is_highlightjs_here){ if(!window.is_highlightjs_here){
script = document.createElement('script'); script = document.createElement('script');
script.async = false; script.async = false;
script.src = "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.0.1/highlight.min.js"; script.src = "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.0.1/highlight.min.js";
document.body.appendChild(script); document.body.appendChild(script);
window.is_highlightjs_here = 1; window.is_highlightjs_here = true;
} }
if(window.is_highlighted_languages.indexOf(language) == -1){ if(window.is_highlighted_languages.indexOf(language) == -1){
window.to_be_highlighted.push(language); window.to_be_highlighted.push(language);
script = document.createElement('script'); script = document.createElement('script');
script.async = false; script.async = false;
script.src = "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.0.1/languages/" + language + ".min.js"; script.src = "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.0.1/languages/" + language + ".min.js";
script.onload = function(){ script.onload = function(){
document.querySelectorAll("pre code").forEach((element) => { var language = window.to_be_highlighted.shift()
worked = 0; var elements = document.getElementsByClassName("language-" + language);
language = window.to_be_highlighted.shift() for(var i = 0; i < elements.length; ++i)
if(element.className == "language-" + language){ try
hljs.highlightElement(element); hljs.highlightElement(element);
worked = 1; catch(err)
} console.log(err.message);
if(!worked)
console.log("Could not find any elements of lang " + language + " to be highlighted."); window.is_highlighted_languages.push(language);
else
window.is_highlighted_languages.push(language);
});
} }
document.body.appendChild(script); document.body.appendChild(script);
} }
@ -61,7 +60,7 @@ window.load_highlighting = function(language){
</SCRIPT> </SCRIPT>
<H1>POSIX cat(1) WIP ARTICLE</H1> <H1>POSIX cat(1) WIP ARTICLE</H1>
<H3>updated 2021-06-19</H3> <H3>updated 2021-06-20</H3>
<HR ALIGN="left" SIZE="1" WIDTH="25%" /> <HR ALIGN="left" SIZE="1" WIDTH="25%" />
<P> <P>
<CODE>cat</CODE> on a POSIX or otherwise UNIX-like system is a program that exists to concatenate files; to “join” one file at its end to another at its start, and output that resulting file to standard output. <CODE>cat</CODE> on a POSIX or otherwise UNIX-like system is a program that exists to concatenate files; to “join” one file at its end to another at its start, and output that resulting file to standard output.