Also show org-mode link code for badges

See #2099
This commit is contained in:
Steve Purcell 2014-10-26 20:14:26 +00:00
parent ac4ac3dc47
commit 9e65b507aa

View file

@ -299,6 +299,9 @@
var depPkg = ctrl.packageWithName(dep.name);
return depPkg ? packageLink(depPkg, dep.name) : dep.name;
};
var badgeURL = melpa.rootURL + pkg.badgeURL;
var fullURL = melpa.rootURL + packagePath(pkg);
return m("section", [
m("h1", [
pkg.name,
@ -347,10 +350,12 @@
m(".well", [
packageLink(pkg, m("img", {alt: ctrl.archivename.archiveName(), src: melpa.rootURL + pkg.badgeURL})),
m("dl", [
m("dt", "Markdown"),
m("dd", m("pre", "[![" + ctrl.archivename.archiveName() + "](" + melpa.rootURL + pkg.badgeURL + ")](" + melpa.rootURL + packagePath(pkg) + ")")),
m("dt", "HTML"),
m("dd", m("pre", '<a href="' + melpa.rootURL + packagePath(pkg) + '"><img alt="' + ctrl.archivename.archiveName() + '" src="' + melpa.rootURL + pkg.badgeURL + '"/></a>'))
m("dd", m("pre", '<a href="' + fullURL + '"><img alt="' + ctrl.archivename.archiveName() + '" src="' + badgeURL + '"/></a>')),
m("dt", "Markdown"),
m("dd", m("pre", "[![" + ctrl.archivename.archiveName() + "](" + badgeURL + ")](" + fullURL + ")")),
m("dt", "Org"),
m("dd", m("pre", '[[' + fullURL + '][file:' + badgeURL + ']]'))
])
]))
]);