An open API service indexing awesome lists of open source software.

https://github.com/cee-studio/cee-std

Simple and Minimum C container Lib
https://github.com/cee-studio/cee-std

Last synced: 10 months ago
JSON representation

Simple and Minimum C container Lib

Awesome Lists containing this project

README

          








const get_url_record = function () {
const host = window.location.host;
const url = window.location.href;
const matched = url.match(/^(https|http):\/\/([^\/]+)\/(.*)/);

if (matched != null) {
const r = {protocol: matched[1], host: matched[2], path_name: matched[3]};
return r;
}
else
return null;
};
function run() {
const url_record = get_url_record();
var md_path_name = "index.md";
if (url_record.path_name)
md_path_name = url_record.path_name.replace(".html", ".md");
const url = url_record.protocol + "://" + url_record.host + "/" + md_path_name;

const fp = fetch(url, {method: 'GET'});
fp.then (function (r) { return r.text(); })
.then(function (text) {
console.log(text);
target = document.getElementById('html-content');
converter = new showdown.Converter({parseImgDimension: true
, strikethrough: true
});

converter.addExtension(function () {
return [{
type: 'output',
regex: /<a\shref[^>]+>/g,
replace : function (text) {
var url = text.match(/"(.*?)"/)[1]
if(url.includes(window.location.hostname) || url[0] == '/' || url[0] == '.' || url[0] == '#'){
return text
}
return '<a href="' + url + '" target="_blank">'
}
}]
}, 'externalLink')

html = converter.makeHtml(text);
target.innerHTML = html;
});
}
run();



window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-134662929-1');