Skip to content

Commit

Permalink
Add dokuwiki syntax support
Browse files Browse the repository at this point in the history
See #16
  • Loading branch information
aledeg committed Oct 11, 2018
1 parent 7738a2e commit 7fe82b3
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 7 deletions.
7 changes: 7 additions & 0 deletions background.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const bookmarkAddId = 'bookmark-add';
const textReducer = (carry, item) => `${carry + item.url}\n`;
const markdownReducer = (carry, item) => `${carry}[${item.title}](${item.url})\n`;
const htmlReducer = (carry, item) => `${carry}<a href="${item.url}">${item.title}</a><br/>\n`;
const dokuwikiReducer = (carry, item) => `${carry}[[${item.url}|${item.title}]]\n`;
let downloadId = 0;

function notification(message) {
Expand Down Expand Up @@ -53,6 +54,12 @@ function getDownloadOptions(format) {
filename: 'linkdump.html',
type: 'text/html'
};
case 'dokuwiki':
return {
reducer: dokuwikiReducer,
filename: 'linkdump.dk',
type: 'text/plain'
};
default:
return {
reducer: textReducer,
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

"manifest_version": 2,
"name": "LinkDump",
"version": "1.5",
"version": "1.6",
"description": "__MSG_extensionDescription__",
"icons": {
"48": "icons/linkdump-48.png"
Expand Down
5 changes: 3 additions & 2 deletions options/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
<form>
<div>
<label for="defaultFormat">Default format</label>
<label><input type="radio" name="defaultFormat" value="text">TXT</label>
<label><input type="radio" name="defaultFormat" value="markdown">MD</label>
<label><input type="radio" name="defaultFormat" value="text">Text</label>
<label><input type="radio" name="defaultFormat" value="markdown">Markdown</label>
<label><input type="radio" name="defaultFormat" value="html">HTML</label>
<label><input type="radio" name="defaultFormat" value="dokuwiki">Dokuwiki</label>
</div>
<div>
<label for="clearAfterDownload">Clear after download</label>
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "linkdump",
"version": "1.5.0",
"version": "1.6.0",
"description": "Store links and dump them",
"main": "background.js",
"scripts": {
Expand Down
7 changes: 5 additions & 2 deletions popup/load.content.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@
</div>
<div class="btn-group btn-group-toggle" data-toggle="buttons">
<label class="btn btn-secondary btn-sm active">
<input type="radio" name="formats" id="text" autocomplete="off" data-format="text" checked> TXT
<input type="radio" name="formats" id="text" autocomplete="off" data-format="text" checked> Text
</label>
<label class="btn btn-secondary btn-sm">
<input type="radio" name="formats" id="markdown" autocomplete="off" data-format="markdown"> MD
<input type="radio" name="formats" id="markdown" autocomplete="off" data-format="markdown"> Markdown
</label>
<label class="btn btn-secondary btn-sm">
<input type="radio" name="formats" id="html" autocomplete="off" data-format="html"> HTML
</label>
<label class="btn btn-secondary btn-sm">
<input type="radio" name="formats" id="html" autocomplete="off" data-format="dokuwiki"> Dokuwiki
</label>
</div>
<div>
<button id="clear" class="btn btn-outline-primary btn-sm"></button>
Expand Down

0 comments on commit 7fe82b3

Please sign in to comment.