This commit is contained in:
Tutur33
2023-11-24 22:35:41 +01:00
parent 3c0b507a93
commit 7644b2a0f7
45165 changed files with 4803356 additions and 3 deletions
@@ -0,0 +1,9 @@
My Amazing Library
==================
image:https://badges.gitter.im/Join%20Chat.svg[link="https://gitter.im/myorg/myrepo?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge"]
Features
--------
It does amazing things!
@@ -0,0 +1,7 @@
My Amazing Library
==================
Features
--------
It does amazing things!
+2
View File
@@ -0,0 +1,2 @@
[![Join the chat at https://gitter.im/myorg/myrepo](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/myorg/myrepo?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
View File
+7
View File
@@ -0,0 +1,7 @@
# My Amazing Library
[![Join the chat at https://gitter.im/myorg/myrepo](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/myorg/myrepo?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
## Features
It does amazing things!
+5
View File
@@ -0,0 +1,5 @@
# My Amazing Library
## Features
It does amazing things!
@@ -0,0 +1,7 @@
# My Amazing Library
[![]()]() [![Join the chat at https://gitter.im/myorg/myrepo](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/myorg/myrepo?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
## Features
It does amazing things!
@@ -0,0 +1,7 @@
# My Amazing Library
[![]()]()
## Features
It does amazing things!
@@ -0,0 +1,7 @@
# My Amazing Library
[![npm version](https://img.shields.io/npm/v/vue.svg?style=flat)](https://www.npmjs.com/package/vue) [![Join the chat at https://gitter.im/myorg/myrepo](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/myorg/myrepo?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
## Features
It does amazing things!
@@ -0,0 +1,7 @@
# My Amazing Library
[![npm version](https://img.shields.io/npm/v/vue.svg?style=flat)](https://www.npmjs.com/package/vue)
## Features
It does amazing things!
@@ -0,0 +1,7 @@
# My Amazing Library
Inline [![npm version](https://img.shields.io/npm/v/vue.svg?style=flat)](https://www.npmjs.com/package/vue) [![some badge](https://badges.gitter.im/Join%20Chat.svg)](https://en.wikipedia.org/wiki/Saw_(disambiguation)) [![Join the chat at https://gitter.im/myorg/myrepo](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/myorg/myrepo?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) test
## Features
It does amazing things!
@@ -0,0 +1,7 @@
# My Amazing Library
Inline [![npm version](https://img.shields.io/npm/v/vue.svg?style=flat)](https://www.npmjs.com/package/vue) [![some badge](https://badges.gitter.im/Join%20Chat.svg)](https://en.wikipedia.org/wiki/Saw_(disambiguation)) test
## Features
It does amazing things!
@@ -0,0 +1,7 @@
# My Amazing Library
[![Some badge](badge.svg)](https://en.wikipedia.org/wiki/Saw_(disambiguation)) [![Join the chat at https://gitter.im/myorg/myrepo](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/myorg/myrepo?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
## Features
It does amazing things!
@@ -0,0 +1,7 @@
# My Amazing Library
[![Some badge](badge.svg)](https://en.wikipedia.org/wiki/Saw_(disambiguation))
## Features
It does amazing things!
@@ -0,0 +1,9 @@
# My Amazing Library
[![Join the chat at https://gitter.im/myorg/myrepo](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/myorg/myrepo?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
My line-break is very expensive.
## Features
It does amazing things!
@@ -0,0 +1,6 @@
# My Amazing Library
My line-break is very expensive.
## Features
It does amazing things!
@@ -0,0 +1,7 @@
= My Amazing Library =
<a href="https://gitter.im/myorg/myrepo?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge"><img src="https://badges.gitter.im/Join%20Chat.svg" alt="Join the chat at https://gitter.im/myorg/myrepo"/></a>
== Features ==
It does amazing things!
@@ -0,0 +1,5 @@
= My Amazing Library =
== Features ==
It does amazing things!
+7
View File
@@ -0,0 +1,7 @@
* My Awesome Library
#+ATTR_HTML: title="Join the chat at https://gitter.im/myorg/myrepo"
[[https://gitter.im/myorg/myrepo?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge][file:https://badges.gitter.im/Join%20Chat.svg]]
** Features
It does amazing things!
+4
View File
@@ -0,0 +1,4 @@
* My Awesome Library
** Features
It does amazing things!
+5
View File
@@ -0,0 +1,5 @@
My Library
I use some weird standard!
Join the chat at https://gitter.im/myorg/myrepo
+3
View File
@@ -0,0 +1,3 @@
My Library
I use some weird standard!
+11
View File
@@ -0,0 +1,11 @@
=head1 My Amazing Library
=begin HTML
<p><a href="https://gitter.im/myorg/myrepo?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge"><img src="https://badges.gitter.im/Join%20Chat.svg" alt="Join the chat at https://gitter.im/myorg/myrepo"></a></p>
=end HTML
=head2 Features
It does amazing things!
+5
View File
@@ -0,0 +1,5 @@
=head1 My Amazing Library
=head2 Features
It does amazing things!
+7
View File
@@ -0,0 +1,7 @@
= My Amazing Library
{<img src="https://badges.gitter.im/Join%20Chat.svg" alt="Join the chat at https://gitter.im/myorg/myrepo">}[https://gitter.im/myorg/myrepo?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge]
== Features
It does amazing things!
+5
View File
@@ -0,0 +1,5 @@
= My Amazing Library
== Features
It does amazing things!
+7
View File
@@ -0,0 +1,7 @@
h1. My Amazing Library
!https://badges.gitter.im/Join%20Chat.svg(Join the chat at https://gitter.im/myorg/myrepo)!:https://gitter.im/myorg/myrepo?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
h2. Features
It does amazing things!
@@ -0,0 +1,5 @@
h1. My Amazing Library
h2. Features
It does amazing things!
+147
View File
@@ -0,0 +1,147 @@
/* jshint node:true, unused:strict */
/* global describe:true, it:true */
"use strict";
var assert = require('assert');
var fs = require('fs');
var badger = require('..');
describe('readme-badger', function() {
var imageUrl = 'https://badges.gitter.im/Join%20Chat.svg';
var linkUrl = 'https://gitter.im/myorg/myrepo?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge';
var altText = 'Join the chat at https://gitter.im/myorg/myrepo';
it('inserts into markdown', function() {
var before = fs.readFileSync(__dirname + '/examples/markdown-before.md', { encoding: 'utf8' });
var after = fs.readFileSync(__dirname + '/examples/markdown-after.md', { encoding: 'utf8' });
var result = badger.addBadge(before, 'md', imageUrl, linkUrl, altText);
assert.equal(result, after);
});
it('inserts into markdown that already has a badge', function() {
var before = fs.readFileSync(__dirname + '/examples/markdown-hasbadge-before.md', { encoding: 'utf8' });
var after = fs.readFileSync(__dirname + '/examples/markdown-hasbadge-after.md', { encoding: 'utf8' });
var result = badger.addBadge(before, 'md', imageUrl, linkUrl, altText);
assert.equal(result, after);
});
it('inserts into markdown that already has a badge with parenthesis link', function() {
var before = fs.readFileSync(__dirname + '/examples/markdown-hasbadge-parenthesis-link-before.md', { encoding: 'utf8' });
var after = fs.readFileSync(__dirname + '/examples/markdown-hasbadge-parenthesis-link-after.md', { encoding: 'utf8' });
var result = badger.addBadge(before, 'md', imageUrl, linkUrl, altText);
assert.equal(result, after);
});
it('inserts into markdown that has empty badge', function() {
var before = fs.readFileSync(__dirname + '/examples/markdown-empty-badge-before.md', { encoding: 'utf8' });
var after = fs.readFileSync(__dirname + '/examples/markdown-empty-badge-after.md', { encoding: 'utf8' });
var result = badger.addBadge(before, 'md', imageUrl, linkUrl, altText);
assert.equal(result, after);
});
it('inserts into markdown that has inline badge', function() {
var before = fs.readFileSync(__dirname + '/examples/markdown-hasbadge-inline-before.md', { encoding: 'utf8' });
var after = fs.readFileSync(__dirname + '/examples/markdown-hasbadge-inline-after.md', { encoding: 'utf8' });
var result = badger.addBadge(before, 'md', imageUrl, linkUrl, altText);
assert.equal(result, after);
});
it('inserts into markdown that content follows the title without empty line', function() {
var before = fs.readFileSync(__dirname + '/examples/markdown-tense-title-before.md', { encoding: 'utf8' });
var after = fs.readFileSync(__dirname + '/examples/markdown-tense-title-after.md', { encoding: 'utf8' });
var result = badger.addBadge(before, 'md', imageUrl, linkUrl, altText);
assert.equal(result, after);
});
it('inserts into textile', function() {
var before = fs.readFileSync(__dirname + '/examples/textile-before.textile', { encoding: 'utf8' });
var after = fs.readFileSync(__dirname + '/examples/textile-after.textile', { encoding: 'utf8' });
var result = badger.addBadge(before, 'textile', imageUrl, linkUrl, altText);
assert.equal(result, after);
});
it('inserts into rdoc', function() {
var before = fs.readFileSync(__dirname + '/examples/rdoc-before.rdoc', { encoding: 'utf8' });
var after = fs.readFileSync(__dirname + '/examples/rdoc-after.rdoc', { encoding: 'utf8' });
var result = badger.addBadge(before, 'rdoc', imageUrl, linkUrl, altText);
assert.equal(result, after);
});
it('inserts into orgmode', function() {
var before = fs.readFileSync(__dirname + '/examples/orgmode-before.org', { encoding: 'utf8' });
var after = fs.readFileSync(__dirname + '/examples/orgmode-after.org', { encoding: 'utf8' });
var result = badger.addBadge(before, 'org', imageUrl, linkUrl, altText);
assert.equal(result, after);
});
it('inserts into mediawiki', function() {
var before = fs.readFileSync(__dirname + '/examples/mediawiki-before.mediawiki', { encoding: 'utf8' });
var after = fs.readFileSync(__dirname + '/examples/mediawiki-after.mediawiki', { encoding: 'utf8' });
var result = badger.addBadge(before, 'mediawiki', imageUrl, linkUrl, altText);
assert.equal(result, after);
});
it('inserts into asciidoc', function() {
var before = fs.readFileSync(__dirname + '/examples/asciidoc-before.asciidoc', { encoding: 'utf8' });
var after = fs.readFileSync(__dirname + '/examples/asciidoc-after.asciidoc', { encoding: 'utf8' });
var result = badger.addBadge(before, 'asciidoc', imageUrl, linkUrl, altText);
assert.equal(result, after);
});
it('inserts into pod', function() {
var before = fs.readFileSync(__dirname + '/examples/pod-before.pod', { encoding: 'utf8' });
var after = fs.readFileSync(__dirname + '/examples/pod-after.pod', { encoding: 'utf8' });
var result = badger.addBadge(before, 'pod', imageUrl, linkUrl, altText);
assert.equal(result, after);
});
it('inserts into plaintext', function() {
var before = fs.readFileSync(__dirname + '/examples/plaintext-before.txt', { encoding: 'utf8' });
var after = fs.readFileSync(__dirname + '/examples/plaintext-after.txt', { encoding: 'utf8' });
var result = badger.addBadge(before, 'txt', imageUrl, linkUrl, altText);
assert.equal(result, after);
});
it('inserts into unsupported filetypes', function() {
var before = fs.readFileSync(__dirname + '/examples/plaintext-before.txt', { encoding: 'utf8' });
var after = fs.readFileSync(__dirname + '/examples/plaintext-after.txt', { encoding: 'utf8' });
var result = badger.addBadge(before, null, imageUrl, linkUrl, altText);
assert.equal(result, after);
});
it('inserts into empty files', function () {
var before = fs.readFileSync(__dirname + '/examples/empty-before.md', { encoding: 'utf8' });
var after = fs.readFileSync(__dirname + '/examples/empty-after.md', { encoding: 'utf8' });
var result = badger.addBadge(before, 'md', imageUrl, linkUrl, altText);
assert.equal(result, after)
})
});
+12
View File
@@ -0,0 +1,12 @@
####################
My Amazing Library
####################
.. image:: https://badges.gitter.im/badge.svg
:alt: Badgers are great!
:target: https://gitter.im
Features
--------
It does amazing things!
+8
View File
@@ -0,0 +1,8 @@
####################
My Amazing Library
####################
Features
--------
It does amazing things!
+33
View File
@@ -0,0 +1,33 @@
/* jshint node:true, unused:strict */
/* global describe:true, it:true */
"use strict";
var assert = require('assert');
var fs = require('fs');
var badger = require('../..');
describe('reStructuredText', function() {
var imageUrl = 'https://badges.gitter.im/badge.svg';
var linkUrl = 'https://gitter.im';
var altText = 'Badgers are great!';
it('inserts below double hash header', function() {
var before = fs.readFileSync(__dirname + '/hash-header-before.rst', { encoding: 'utf8' });
var after = fs.readFileSync(__dirname + '/hash-header-after.rst', { encoding: 'utf8' });
var result = badger.addBadge(before, 'rst', imageUrl, linkUrl, altText);
assert.equal(result, after);
});
it('inserts below double tilde header', function() {
var before = fs.readFileSync(__dirname + '/tilde-header-before.rst', { encoding: 'utf8' });
var after = fs.readFileSync(__dirname + '/tilde-header-after.rst', { encoding: 'utf8' });
var result = badger.addBadge(before, 'rst', imageUrl, linkUrl, altText);
assert.equal(result, after);
});
});
+12
View File
@@ -0,0 +1,12 @@
~~~~~~~~~~~~~~~~~~~~
My Amazing Library
~~~~~~~~~~~~~~~~~~~~
.. image:: https://badges.gitter.im/badge.svg
:alt: Badgers are great!
:target: https://gitter.im
Features
--------
It does amazing things!
+8
View File
@@ -0,0 +1,8 @@
~~~~~~~~~~~~~~~~~~~~
My Amazing Library
~~~~~~~~~~~~~~~~~~~~
Features
--------
It does amazing things!