Git Product home page Git Product logo

dumper's Introduction

Dumper

Library for extracting attachments, notes and metadata out of formats used by popular note-taking apps.

Features

  • Markdown: all notes are converted to Markdown automatically, no matter what format each note uses.
  • Modular: each supported format is implemented by a "provider", additional providers can be implemented easily, learn more about implementing one yourself here.
  • Lightweight: extra care has been taken to ensure this library is lightweight, no external DOM implementation is loaded by default and the most lightweight dependencies are being used.

Install

npm install --save @notable/dumper

Providers

The following providers are currently implemented:

  • Enex: it can import notes exported via Evernote.
    • Extensions: .enex.
  • Boostnote: it can import notes written using Boostnote.
    • Extensions: .cson.
  • HTML: it can import HTML notes, most popular note-taking apps can export to HTML.
    • Extensions: .html, .htm.
  • Markdown: it can import plain Markdown notes.
    • Extensions: .md, .mkd, .mkdn, .mdwn, .mdown, .markdown, .markdn, .mdtxt, .mdtext, .txt.

Usage

The following interfaces are provided:

interface Dumper {
  isSupported ( source: string ): boolean,
  dump ( options: Options ): Promise<void>
}

interface Options {
  DOMParser?: DOMParser, // This option is only optional if you are in a browser-like environment, e.i. "window.DOMParser" exists
  source: string | string[],
  dump ( note: Note ): void | Promise<void>
}

interface Note {
  metadata: {
    title: string,
    tags: string[],
    attachments: {
      metadata: {
        name: string,
        created: Date,
        modified: Date
      },
      content: Uint8Array
    }[],
    deleted: boolean,
    favorited: boolean,
    pinned: boolean,
    created: Date,
    modified: Date
  },
  content: Uint8Array
}

You can use the library like so:

import * as path from 'path';
import Dumper from '@notable/dumper';

Dumper.dump ({
  source: path.join ( __dirname, 'source.html' ),
  dump ( note ) {
    // Do something with each given note object...
  }
});

Contributing

There are multiple ways to contribute to this project, read about them here.

Related

  • Notable: The Markdown-based note-taking app that doesn't suck.

License

MIT © Fabio Spampinato

dumper's People

Contributors

fabiospampinato avatar natlify avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dumper's Issues

An error occurred: e.trim is not a function

  • OS Version: win32 10.0.17134
  • Notable Version: v1.7.3
TypeError: e.trim is not a function
    at file:///C:/Users/sfrat/AppData/Local/Programs/notable/resources/app.asar/chunk.fba3d68ffab26c3d35e8.js:1:3424
    at Array.map (<anonymous>)
    at EnexNote.sanitizeMetadata (file:///C:/Users/sfrat/AppData/Local/Programs/notable/resources/app.asar/chunk.fba3d68ffab26c3d35e8.js:1:3415)
    at EnexNote.get (file:///C:/Users/sfrat/AppData/Local/Programs/notable/resources/app.asar/chunk.fba3d68ffab26c3d35e8.js:1:2798)
    at async EnexProvider.dump (file:///C:/Users/sfrat/AppData/Local/Programs/notable/resources/app.asar/chunk.fba3d68ffab26c3d35e8.js:1:2706)
    at async Object.dump (file:///C:/Users/sfrat/AppData/Local/Programs/notable/resources/app.asar/chunk.fba3d68ffab26c3d35e8.js:1:57993)
    at async import_Import.import (file:///C:/Users/sfrat/AppData/Local/Programs/notable/resources/app.asar/renderer.js:1:21799)

Support TextBundle

Support for importing TextBundle documents should be added, so that people can more easily switch.

Improper lists formatting

Transferred from notable/notable#494, @msbentley says:

Current behavior

Importing a simple ENEX note containing inline links and bullets doesn't reproduce the formatting in Notable.

Test.zip

Expected behavior

Inline links and bullets are correctly formatted. Also the justification is odd.

This is how it looks in Evernote/Nixnote:

image

and in Notable:

image

The generated MD in Notable is:

# Test

<p align="justify">This is testing [inline links](https://feedly.com/i/entry/Nt4fyhG21JbPujJtAXF21iv3D4YjLVs1hWXxg4HWlpY=_16922795307:ec771e:ad2b6584) first as normal</p>

- <p align="justify">Then [a link](https://feedly.com/i/entry/Nt4fyhG21JbPujJtAXF21iv3D4YjLVs1hWXxg4HWlpY=_16922795307:ec771e:ad2b6584) in a list</p>
    
- <p align="justify">etc.</p>

<p align="justify">Also testing different levels of bullets</p>

- <p align="justify">first</p>

- <p align="justify">second</p>

- <p align="justify">third</p>

- <p align="justify">second</p>

- <p align="justify">first</p>

Thanks!

Mark

An error occurred: Cannot create a string longer than 0x3fffffe7 characters

  • OS Version: win32 10.0.18362
  • Notable Version: v1.7.3
Error: Cannot create a string longer than 0x3fffffe7 characters
    at Buffer.toString (buffer.js:623:17)
    at EnexProvider.getNotesRaw (file:///C:/Users/%E6%88%BF%E5%AE%81/AppData/Local/Programs/notable/resources/app.asar/chunk.fba3d68ffab26c3d35e8.js:1:43949)
    at EnexProvider.dump (file:///C:/Users/%E6%88%BF%E5%AE%81/AppData/Local/Programs/notable/resources/app.asar/chunk.fba3d68ffab26c3d35e8.js:1:2667)
    at async Object.dump (file:///C:/Users/%E6%88%BF%E5%AE%81/AppData/Local/Programs/notable/resources/app.asar/chunk.fba3d68ffab26c3d35e8.js:1:57993)
    at async import_Import.import (file:///C:/Users/%E6%88%BF%E5%AE%81/AppData/Local/Programs/notable/resources/app.asar/renderer.js:1:21799)

Support Notion

Feature description

Enable to dump/export content from Notion.so.

Feature motivation

I started using Notion, but I just wanna go out of it now!
The export from them is a great Spaghetti because the files are just in a single directory with long names.

Error report: Expected "#", ":", "\n", "\r", or [ \t] but "s" found.

  • OS Version: linux 5.9.1-1-default
  • Notable Version: v1.8.4
SyntaxError: Expected "#", ":", "\n", "\r", or [ \t] but "s" found.
    at peg$buildStructuredError (file:///tmp/.mount_NotablmRRhdm/resources/app.asar/renderer/chunk.801f2cae377ea1944a34.js:2:17119)
    at Object.peg$parse [as parse] (file:///tmp/.mount_NotablmRRhdm/resources/app.asar/renderer/chunk.801f2cae377ea1944a34.js:2:31526)
    at Function.cson2json [as default] (file:///tmp/.mount_NotablmRRhdm/resources/app.asar/renderer/chunk.801f2cae377ea1944a34.js:2:11347)
    at BoostnoteProvider.getNotesRaw (file:///tmp/.mount_NotablmRRhdm/resources/app.asar/renderer/chunk.801f2cae377ea1944a34.js:2:10004)
    at BoostnoteProvider.dump (file:///tmp/.mount_NotablmRRhdm/resources/app.asar/renderer/chunk.801f2cae377ea1944a34.js:2:3430)
    at async Object.dump (file:///tmp/.mount_NotablmRRhdm/resources/app.asar/renderer/chunk.801f2cae377ea1944a34.js:2:201681)
    at async import_Import.import (file:///tmp/.mount_NotablmRRhdm/resources/app.asar/renderer/renderer.js:2:24287)

Support arbitrarily-sized files

If possible this library should support arbitrarily sized files. The structure contained within said files may not be parseable while streaming, so this may not be really solvable in the general case.

Currently the workaround for this is exporting not everything into a single giant file, but exporting exporting notes in reasonably-sized (under 1GB) chunks.

Support OneNote

Support for importing OneNote notes should be added, so that people can more easily switch.

Add script to dump and remove attachments?

Feature description

Currently, dumper fails on images with large attachments, likely because the contents are parsed into the DOM via minidom which creates very large documents that can become larger than the available memory, despite the file sizes being quite small.

Feature motivation

I have a series of notes from college that are gigabytes in size, which is almost entirely in attachments. However, I also have a few files of ~80MB which are mostly attachments also failing. I could export smaller notes, however, having a Python script (to handle files larger than a certain size) or similar to process each of the attachments would be very useful, and export the modified ENEX files (as well as adding support for other formats) and the attachments would be very helpful, and would solve many of the issues of large files.

If there's any interest, I'd be more than happy to provide it, under any license desired (including public domain, so you can do whatever you wish). Currently I only have access to Evernote ENEX files, but I could also use the test cases above to add support for other note file types.

I've got a simple version of the script here, and it reduces a 7MB file to ~150KB, while keeping everything but the resources present, and can then be processed by dumper.

Current issues with the script:

  1. Assumes base64 encoding of attachments.
  2. Only handles filename and contents.
  3. XML output currently doesn't preserve CDATA sections, which should be trivial to implement using text processing rather than dumping the tree.
  4. Only supports Evernote ENEX files.
  5. Doesn't store the attachment data when exporting, meaning the attachment names are lost in the header.

I'm working on fixing the 1), 3), and 5) currently, and would be more than willing to implement 4) if desired. 5) has been fixed by writing out the buffer to file, and creating a unique attachment (b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09'), since empty files are ignored by dumper, so any library users would need to know about this.

Import from .enex format loses formatting

  • OS Version: MacOS 11.2.1
  • Notable Version: 1.8.4

Current behavior

Attached in
evernote notable xfer.zip is my exported Evernote file, "If I Ever Need A Lady (I'll call you).enex"

Import it into Notable using Option:Evernote
The note is imported, but the format is incorrect. (See screen shot below.) Specifically:

  • Line spacing is uniform throughout, rather than separated into "paragraphs)
  • Toward the top of the document
    • Hash marks are added which are not in the original
    • A monospace font is used in the original, but not in the imported note
    • The monospace font is in a larger font size in the original note but the same size in the imported note.

Expected behavior

The note is imported with at least a good approximation to the existing format.

Comments

  • I wanted to try importing the same note exported to HTML, but Evernote no longer supports HTML export, apparently.
  • I noticed that in the .enex file, blank lines are inserted using <div><br /></div>.

image

Deeply nested lists rendered flat

First of all thanks for the tool. I'm in the process of migrating Evernote notes to markdown so your tool could be very helpful.

One thing I have problem with is that after doing enex-dump my note's nested lists are flat in markdown format. Is it a know problem or am I doing something wrong?

Thanks 🙇

Problems with ":" in note titles

Reason: creating files with ":" is not supported.

A simple Parse.title([...]).replace(":"," - ") was sufficient for me, but the bug should be fixed imho.

Error report: Cannot read property 'source-url' of undefined

  • OS Version: linux 5.3.0-40-generic
  • Notable Version: v1.8.4

I got this error while trying to import an evernote .enex file.

TypeError: Cannot read property 'source-url' of undefined
    at EnexNote.getMetadata (file:///snap/notable/1/resources/app.asar/renderer/chunk.801f2cae377ea1944a34.js:2:185842)
    at async EnexNote.get (file:///snap/notable/1/resources/app.asar/renderer/chunk.801f2cae377ea1944a34.js:2:3578)
    at async EnexProvider.dump (file:///snap/notable/1/resources/app.asar/renderer/chunk.801f2cae377ea1944a34.js:2:3469)
    at async Object.dump (file:///snap/notable/1/resources/app.asar/renderer/chunk.801f2cae377ea1944a34.js:2:201681)
    at async import_Import.import (file:///snap/notable/1/resources/app.asar/renderer/renderer.js:2:24287)

Error report: e.name.trim is not a function

  • OS Version: win32 10.0.17134
  • Notable Version: v1.8.4
TypeError: e.name.trim is not a function
    at EnexAttachment.sanitizeMetadata (file:///C:/Users/test/AppData/Local/Programs/notable/resources/app.asar/renderer/chunk.801f2cae377ea1944a34.js:2:5173)
    at file:///C:/Users/test/AppData/Local/Programs/notable/resources/app.asar/renderer/chunk.801f2cae377ea1944a34.js:2:4913
    at Array.map (<anonymous>)
    at EnexAttachment.get (file:///C:/Users/test/AppData/Local/Programs/notable/resources/app.asar/renderer/chunk.801f2cae377ea1944a34.js:2:4901)
    at async Promise.all (index 0)
    at async EnexNote.getMetadata (file:///C:/Users/test/AppData/Local/Programs/notable/resources/app.asar/renderer/chunk.801f2cae377ea1944a34.js:2:185659)
    at async EnexNote.get (file:///C:/Users/test/AppData/Local/Programs/notable/resources/app.asar/renderer/chunk.801f2cae377ea1944a34.js:2:3578)
    at async EnexProvider.dump (file:///C:/Users/test/AppData/Local/Programs/notable/resources/app.asar/renderer/chunk.801f2cae377ea1944a34.js:2:3469)
    at async Object.dump (file:///C:/Users/test/AppData/Local/Programs/notable/resources/app.asar/renderer/chunk.801f2cae377ea1944a34.js:2:201681)
    at async import_Import.import (file:///C:/Users/test/AppData/Local/Programs/notable/resources/app.asar/renderer/renderer.js:2:24287)

Error report: Cannot read property 'source-url' of undefined

  • OS Version: linux 5.3.0-28-generic
  • Notable Version: v1.8.4
TypeError: Cannot read property 'source-url' of undefined
    at EnexNote.getMetadata (file:///opt/Notable/resources/app.asar/renderer/chunk.801f2cae377ea1944a34.js:2:185842)
    at async EnexNote.get (file:///opt/Notable/resources/app.asar/renderer/chunk.801f2cae377ea1944a34.js:2:3578)
    at async EnexProvider.dump (file:///opt/Notable/resources/app.asar/renderer/chunk.801f2cae377ea1944a34.js:2:3469)
    at async Object.dump (file:///opt/Notable/resources/app.asar/renderer/chunk.801f2cae377ea1944a34.js:2:201681)
    at async import_Import.import (file:///opt/Notable/resources/app.asar/renderer/renderer.js:2:24287)

Error report: These sources are not supported: C:\Users\jolemay\AppData\Local\Microsoft\Windows\INetCache\IE\5P014WBE\SkySyncRedir[1].aspx

  • OS Version: win32 10.0.17763
  • Notable Version: v1.8.1
Error: These sources are not supported: C:\Users\jolemay\AppData\Local\Microsoft\Windows\INetCache\IE\5P014WBE\SkySyncRedir[1].aspx
    at Object.dump (file:///C:/Users/jolemay/AppData/Local/Programs/notable/resources/app.asar/renderer/chunk.c5d7fb991b1c794df244.js:1:58798)
    at import_Import.import (file:///C:/Users/jolemay/AppData/Local/Programs/notable/resources/app.asar/renderer/renderer.js:2:22122)

Improve support for non-UTF encodings

I tried to import a TXT-File that has "ANSI"-Encoding and the import does not import the file correctly.

I have an example-file here, that can be tested. The file is here in two versions:

  1. before-import.txt
  2. after-import.txt

The importer changes the "ANSI"-Encoding to "UTF8" but does not convert the special chars along the way. For example: Windows Notepad can convert this ansi-file without problems to utf8 without lossing the chars.

before-import.txt
after-import.txt

Support Joplin

Support for importing Joplin notes should be added, so that people can more easily switch.

Support Microsoft Word

Support for importing Word documents should be added, so that people can more easily switch.

JavaScript heap out of memory

I have just installed enex-dump (ubuntu 18.04) and tried to convert an ENEX file containing a few hundred notes (~373 MB, since it has quite a few attachments). The following is the output:

mbentley@bpcl03:~/Desktop$ enex-dump --src notes.enex --dst notes

<--- Last few GCs --->

[17938:0x55d3d37c3220]     1977 ms: Mark-sweep 762.3 (800.8) -> 760.6 (800.8) MB, 9.5 / 0.0 ms  allocation failure GC in old space requested
[17938:0x55d3d37c3220]     1991 ms: Mark-sweep 760.6 (800.8) -> 760.5 (765.8) MB, 14.3 / 0.0 ms  last resort GC in old space requested
[17938:0x55d3d37c3220]     2007 ms: Mark-sweep 760.5 (765.8) -> 760.5 (765.8) MB, 15.3 / 0.0 ms  last resort GC in old space requested


<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x22aaad598fe1 <JSObject>
    2: replace(this=0x79116f82201 <Very long string[390176708]>,0x1f5d1adc22d9 <JSRegExp <String[15]: <!--[\s\S]*?-->>>,0x22aaad582801 <String[0]: >)
    3: getTraversalObj [/usr/local/lib/node_modules/enex-dump/node_modules/fast-xml-parser/src/xmlstr2xmlnode.js:72] [bytecode=0x395c79c21b11 offset=45](this=0x3330a949851 <Object map = 0x32869ea758f9>,xmlData=0x79116f82201 <Very long string[390176...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [node]
 2: 0x55d3d16f8011 [node]
 3: v8::Utils::ReportOOMFailure(char const*, bool) [node]
 4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [node]
 5: v8::internal::Factory::NewRawTwoByteString(int, v8::internal::PretenureFlag) [node]
 6: 0x55d3d15adb54 [node]
 7: v8::internal::Runtime_StringReplaceGlobalRegExpWithString(int, v8::internal::Object**, v8::internal::Isolate*) [node]
 8: 0x5bab79040bd

Aborted (core dumped)

Any clues? Thanks!!

An error occurred: e.trim is not a function

  • OS Version: darwin 18.7.0
  • Notable Version: v1.7.3
TypeError: e.trim is not a function
    at file:///Users/mjdingee/Applications/Notable.app/Contents/Resources/app.asar/chunk.fba3d68ffab26c3d35e8.js:1:3424
    at Array.map (<anonymous>)
    at EnexNote.sanitizeMetadata (file:///Users/mjdingee/Applications/Notable.app/Contents/Resources/app.asar/chunk.fba3d68ffab26c3d35e8.js:1:3415)
    at EnexNote.get (file:///Users/mjdingee/Applications/Notable.app/Contents/Resources/app.asar/chunk.fba3d68ffab26c3d35e8.js:1:2798)
    at async EnexProvider.dump (file:///Users/mjdingee/Applications/Notable.app/Contents/Resources/app.asar/chunk.fba3d68ffab26c3d35e8.js:1:2706)
    at async Object.dump (file:///Users/mjdingee/Applications/Notable.app/Contents/Resources/app.asar/chunk.fba3d68ffab26c3d35e8.js:1:57993)
    at async import_Import.import (file:///Users/mjdingee/Applications/Notable.app/Contents/Resources/app.asar/renderer.js:1:21799)

`<script>` tags get leaked as plain text in markdown

  • File Extension: .html
  • Dumper Version: 2.0.1

Current behavior

When dumping an html file that contains inline <script> tags, those tags get leaked into the resulting markdown document as plain text.

For context: I am trying to dump recipes that I exported from Paprika in html format.

Expected behavior

<script> tags should remain as such when being dumped

Note: I converted the extension from html to txt in order to upload to github. Tomato and Onion Salad.txt

input html:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <style type="text/css">
            /* Shared styles */
            body {
                font-family: Helvetica, sans-serif;
                font-size: 16.0px;
                color: #34302e;
                margin: 0.25in;
            }
            .name {
                font-size: 18.0px;
                font-family: Helvetica, sans-serif;
                font-weight: normal;
                margin: 0 0 10px 0;
            }
            .categories {
                color: #605D5D;
                font-size: 14.0px;
                font-family: Helvetica, sans-serif;
                font-style: italic;
            }
            .rating {
                color: #d10505;
                font-size: 14.0px;
            }
            .metadata {
                font-size: 14.0px;
            }
            .infobox p {
                margin: 0;
                line-height: 150%;
            }
            .subhead {
                color: #d10505;
                font-weight: bold;
                font-size: 14.0px;
                text-transform: uppercase;
                margin: 10px 0;
            }

            .ingredients p {
                margin: 4px 0;
            }
            /* To prevent nutrition/directions from getting too close
               to ingredients */
            .ingredients {
                padding-bottom: 10px;
            }
            .clear {
                clear:both;
            }
            a {
                color: #4990E2;
                text-decoration: none;
            }
            /* Full page specific styles */
            .text {
                line-height: 130%;
            }
            .photobox {

                float: left;
                margin-right: 14px;


            }
            .photo {
                max-width: 140.0px;
                max-height: 140.0px;
                width: auto;
                height: auto;
            }

            .inline-image {
                max-width: 25%;
                max-height: 25%;
                width: auto;
                height: auto;
            }
            .photoswipe {
                border: 1px #dddddd solid;
                cursor: pointer;
            }
            .pswp__caption__center {
                text-align: center !important;
            }
            .recipe {

                page-break-after: always;


            }
            .recipe:first-child {
                border-top: 0 none;
                margin-top: 0;
                padding-top: 0;
            }
        </style>
    </head>
    <body>
        <!-- Recipe -->
<div class="recipe" itemscope itemtype="http://schema.org/Recipe" >

    <div class="infobox">

        <!-- Image -->

        <div class="photobox">

            <a href="#">
                <img src="Images/BFDBD8FA-5EC8-4660-B4F3-4AE5BA3E7F66-40234-000073E72DA33D42/04742637-7629-4B01-A754-F5B5030738D9-40234-000073FDC958E3E6.jpg" itemprop="image" class="photo photoswipe"/>
            </a>


        </div>


        <!-- Name -->
        <h1 itemprop="name" class="name">Tomato and Onion Salad</h1>

        <!-- Info -->


        <!-- Rating, categories -->
        <p itemprop="aggregateRating" class="rating" value="0"></p>

            <p itemprop="recipeCategory" class="categories">Salads</p>


        <p class="metadata">

            <!-- Cook time, prep time, servings, difficulty -->


            <!-- Source -->

        </p>



        <div class="clear"></div>


    </div>

    <div class="left-column">

        <!-- Ingredients -->

        <div class="ingredientsbox">
            <h3 class="subhead">Ingredients</h3>
            <div class="ingredients text">
                <p class="line" itemprop="recipeIngredient"><strong>5-6</strong> medium ripe tomatoes</p><p class="line" itemprop="recipeIngredient"><strong>1</strong> small red onion or sweet white onion 3 Tbls. olive oil</p><p class="line" itemprop="recipeIngredient"><strong>1</strong> Tbl. oregano</p><p class="line" itemprop="recipeIngredient">salt and pepper to taste</p>
            </div>
        </div>


        <!-- Nutrition (in two-column mode it goes below the ingredients) -->


    </div>

    <div class="right-column">

    <!-- Description -->

    <div class="descriptionbox">
        <h3 class="subhead">Description</h3>
        <div itemprop="description" class="description text">
            <p>When there is an abundance of fresh, ripe tomatoes from the garden this salad is a delicious summer side dish. Because of the mild acidity of the tomatoes, this salad needs no vinegar.</p>
        </div>
    </div>


    <!-- Directions -->

    <div class="directionsbox">
        <h3 class="subhead">Directions</h3>
        <div itemprop="recipeInstructions" class="directions text">
            <p class="line">Cut the tomatoes into bite-size pieces and place in a bowl. </p><p class="line">Cut the onion in half and slice thinly.</p><p class="line">Add onion to the tomatoes along with the olive oil, oregano and salt and pepper.</p><p class="line">Mix well.</p>
        </div>
    </div>


    <!-- Notes -->


    <!-- Nutrition (in regular mode it goes below the notes) -->

        <!-- Used in two different places depending on the recipe layout -->




    </div>

    <div class="clear"></div>

</div>


<!-- Photo gallery is only included when exporting. -->
<!-- PhotoSwipe gallery -->

<link rel="stylesheet" href="Resources/PhotoSwipe/photoswipe.css">
<link rel="stylesheet" href="Resources/PhotoSwipe/default-skin/default-skin.css">
<script src="Resources/PhotoSwipe/photoswipe.min.js"></script>
<script src="Resources/PhotoSwipe/photoswipe-ui-default.min.js"></script>

<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="pswp__bg"></div>
    <div class="pswp__scroll-wrap">
        <div class="pswp__container">
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
        </div>
        <div class="pswp__ui pswp__ui--hidden">
            <div class="pswp__top-bar">
                <div class="pswp__counter"></div>
                <button class="pswp__button pswp__button--close" title="Close"></button>
            </div>
            <button class="pswp__button pswp__button--arrow--left" title="Previous">
            </button>
            <button class="pswp__button pswp__button--arrow--right" title="Next">
            </button>
            <div class="pswp__caption">
                <div class="pswp__caption__center"></div>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">
    var openPhotoSwipe = function(event) {
        var pswp = document.querySelector('.pswp');

        var element = event.target;
        var src = element.getAttribute('src');

        // build items array
        var items = [

            {
                msrc: 'Images/BFDBD8FA-5EC8-4660-B4F3-4AE5BA3E7F66-40234-000073E72DA33D42/7964AAC3-6536-461B-9EDA-9F4B33F8E823-40234-000073ED0D1B8203.jpg',
                src: 'Images/BFDBD8FA-5EC8-4660-B4F3-4AE5BA3E7F66-40234-000073E72DA33D42/7964AAC3-6536-461B-9EDA-9F4B33F8E823-40234-000073ED0D1B8203.jpg',
                w: 742.0,
                h: 558.0,
                title: '1'
            },

        ];

        var index = 0;
        for (var i=0; i<items.length; i++) {
            var item = items[i];
            if (item.src == src) {
                index = i;
            }
        }

        var options = {
            index: index,
            history: false,
            focus: true,
            captionEl: true,
            fullscreenEl: false,
            zoomEl: false,
            shareEl: false,
            preloaderEl: false,
            bgOpacity: 0.9,
            showHideOpacity: true
        };

        var gallery = new PhotoSwipe(pswp, PhotoSwipeUI_Default, items, options);
        gallery.init();
    };

    var elements = document.querySelectorAll('.photoswipe');
    for (var i=0; i<elements.length; i++) {
        var element = elements[i];
        element.addEventListener('click', openPhotoSwipe);
    }
</script>





    </body>
</html>

Resulting content:

[![](Images/BFDBD8FA-5EC8-4660-B4F3-4AE5BA3E7F66-40234-000073E72DA33D42/04742637-7629-4B01-A754-F5B5030738D9-40234-000073FDC958E3E6.jpg)](#)

# Tomato and Onion Salad

Salads

### Ingredients

**5-6** medium ripe tomatoes

**1** small red onion or sweet white onion 3 Tbls. olive oil

**1** Tbl. oregano

salt and pepper to taste

### Description

When there is an abundance of fresh, ripe tomatoes from the garden this salad is a delicious summer side dish. Because of the mild acidity of the tomatoes, this salad needs no vinegar.

### Directions

Cut the tomatoes into bite-size pieces and place in a bowl.

Cut the onion in half and slice thinly.

Add onion to the tomatoes along with the olive oil, oregano and salt and pepper.

Mix well.

var openPhotoSwipe = function(event) { var pswp = document.querySelector('.pswp'); var element = event.target; var src = element.getAttribute('src'); // build items array var items = \[ { msrc: 'Images/BFDBD8FA-5EC8-4660-B4F3-4AE5BA3E7F66-40234-000073E72DA33D42/7964AAC3-6536-461B-9EDA-9F4B33F8E823-40234-000073ED0D1B8203.jpg', src: 'Images/BFDBD8FA-5EC8-4660-B4F3-4AE5BA3E7F66-40234-000073E72DA33D42/7964AAC3-6536-461B-9EDA-9F4B33F8E823-40234-000073ED0D1B8203.jpg', w: 742.0, h: 558.0, title: '1' }, \]; var index = 0; for (var i=0; i<items.length; i++) { var item = items\[i\]; if (item.src == src) { index = i; } } var options = { index: index, history: false, focus: true, captionEl: true, fullscreenEl: false, zoomEl: false, shareEl: false, preloaderEl: false, bgOpacity: 0.9, showHideOpacity: true }; var gallery = new PhotoSwipe(pswp, PhotoSwipeUI_Default, items, options); gallery.init(); }; var elements = document.querySelectorAll('.photoswipe'); for (var i=0; i<elements.length; i++) { var element = elements\[i\]; element.addEventListener('click', openPhotoSwipe); }

Expected Content:

[![](Images/BFDBD8FA-5EC8-4660-B4F3-4AE5BA3E7F66-40234-000073E72DA33D42/04742637-7629-4B01-A754-F5B5030738D9-40234-000073FDC958E3E6.jpg)](#)

# Tomato and Onion Salad

Salads

### Ingredients

**5-6** medium ripe tomatoes

**1** small red onion or sweet white onion 3 Tbls. olive oil

**1** Tbl. oregano

salt and pepper to taste

### Description

When there is an abundance of fresh, ripe tomatoes from the garden this salad is a delicious summer side dish. Because of the mild acidity of the tomatoes, this salad needs no vinegar.

### Directions

Cut the tomatoes into bite-size pieces and place in a bowl.

Cut the onion in half and slice thinly.

Add onion to the tomatoes along with the olive oil, oregano and salt and pepper.

Mix well.

<script type="text/javascript">
    var openPhotoSwipe = function(event) {
        var pswp = document.querySelector('.pswp');

        var element = event.target;
        var src = element.getAttribute('src');

        // build items array
        var items = [

            {
                msrc: 'Images/BFDBD8FA-5EC8-4660-B4F3-4AE5BA3E7F66-40234-000073E72DA33D42/7964AAC3-6536-461B-9EDA-9F4B33F8E823-40234-000073ED0D1B8203.jpg',
                src: 'Images/BFDBD8FA-5EC8-4660-B4F3-4AE5BA3E7F66-40234-000073E72DA33D42/7964AAC3-6536-461B-9EDA-9F4B33F8E823-40234-000073ED0D1B8203.jpg',
                w: 742.0,
                h: 558.0,
                title: '1'
            },

        ];

        var index = 0;
        for (var i=0; i<items.length; i++) {
            var item = items[i];
            if (item.src == src) {
                index = i;
            }
        }

        var options = {
            index: index,
            history: false,
            focus: true,
            captionEl: true,
            fullscreenEl: false,
            zoomEl: false,
            shareEl: false,
            preloaderEl: false,
            bgOpacity: 0.9,
            showHideOpacity: true
        };

        var gallery = new PhotoSwipe(pswp, PhotoSwipeUI_Default, items, options);
        gallery.init();
    };

    var elements = document.querySelectorAll('.photoswipe');
    for (var i=0; i<elements.length; i++) {
        var element = elements[i];
        element.addEventListener('click', openPhotoSwipe);
    }
</script>

options.DOMParser is not optional

  • File Extension: .html
  • Dumper Version: 2.0.1

Current behavior

const source: string[] = [
	...await glob.sync(`**/*.html`),
];
Dumper.dump ({
	source,
	async dump ( note: Note ): Promise<void> {
		console.log('note dumped', note);
		// Do something with each given note object...
	}
});

console error =>

(node:34069) UnhandledPromiseRejectionWarning: TypeError: options.parser is not a constructor
    at htmlParser (./build/server/index.js:1488:32)
(...stack redacted...)

Expected behavior

Expected to start getting some note dumped log outputs

per the readme, DOMParser should not be something I MUST override

interface Options {
  DOMParser?: DOMParser,
  source: string | string[],
  dump ( note: Note ): void | Promise<void>
}

This file exhibits the issue:

index.txt

(note I changed the extension from html to txti in order for github to allow me to upload it)

An error occurred: e.trim is not a function

  • OS Version: win32 10.0.18362
  • Notable Version: v1.7.3

This happened when importing a 370MiB Evernote archive.

TypeError: e.trim is not a function
    at file:///C:/Users/ezschemi/AppData/Local/Temp/1PkTDkRCSrHqYbS4UEWcXWoXKUw/resources/app.asar/chunk.fba3d68ffab26c3d35e8.js:1:3424
    at Array.map (<anonymous>)
    at EnexNote.sanitizeMetadata (file:///C:/Users/ezschemi/AppData/Local/Temp/1PkTDkRCSrHqYbS4UEWcXWoXKUw/resources/app.asar/chunk.fba3d68ffab26c3d35e8.js:1:3415)
    at EnexNote.get (file:///C:/Users/ezschemi/AppData/Local/Temp/1PkTDkRCSrHqYbS4UEWcXWoXKUw/resources/app.asar/chunk.fba3d68ffab26c3d35e8.js:1:2798)
    at async EnexProvider.dump (file:///C:/Users/ezschemi/AppData/Local/Temp/1PkTDkRCSrHqYbS4UEWcXWoXKUw/resources/app.asar/chunk.fba3d68ffab26c3d35e8.js:1:2706)
    at async Object.dump (file:///C:/Users/ezschemi/AppData/Local/Temp/1PkTDkRCSrHqYbS4UEWcXWoXKUw/resources/app.asar/chunk.fba3d68ffab26c3d35e8.js:1:57993)
    at async import_Import.import (file:///C:/Users/ezschemi/AppData/Local/Temp/1PkTDkRCSrHqYbS4UEWcXWoXKUw/resources/app.asar/renderer.js:1:21799)

Preserve web-clipper urls

Some attachments come from the web-clipper, and if the source url is present it should somehow be preserved.

Error report: e.replace is not a function

  • OS Version: linux 4.15.0-66-generic
  • Notable Version: v1.8.1
TypeError: e.replace is not a function
    at Function.decode [as default] (file:///tmp/.mount_NotabloQy14L/resources/app.asar/renderer/renderer.js:2:156894)
    at EnexNote.sanitizeMetadata (file:///tmp/.mount_NotabloQy14L/resources/app.asar/renderer/chunk.c5d7fb991b1c794df244.js:1:7328)
    at EnexNote.get (file:///tmp/.mount_NotabloQy14L/resources/app.asar/renderer/chunk.c5d7fb991b1c794df244.js:1:6782)
    at async EnexProvider.dump (file:///tmp/.mount_NotabloQy14L/resources/app.asar/renderer/chunk.c5d7fb991b1c794df244.js:1:6690)
    at async Object.dump (file:///tmp/.mount_NotabloQy14L/resources/app.asar/renderer/chunk.c5d7fb991b1c794df244.js:1:58984)
    at async import_Import.import (file:///tmp/.mount_NotabloQy14L/resources/app.asar/renderer/renderer.js:2:22114)

Support Scarlet Notes

Support for importing Scarlet Notes notes should be added, so that people can more easily switch.

There's actually a third-party Python tool for exporting Scarlet Notes notes to Markdown available here for doing just that.

Support Quiver

hi, I am a quiver user, is there a plan to import notes to notable from quiver ? thank you!

Support Tomboy

Is there a way to migrate / import from Tomboy / GNote?

path to file?

Trying to ditch evernote today.
Using the tool on osx Mojave and linux I get the following error

"Nothing to dump, is the path correct?"

when specifying both absolute and relative path to 4G enex file
eg.
enex-dump --src /Volumes/8TB/Dropbox/Evernote\ Export/My\ Notes.enex

Importing an Evernote *.enex export file does not import images

OK - this issue has been made already one year ago.
But I couldn't find a solution.
Without a full working evernote import notable unfortunately can't be used as an alternative for Evernote.

  • OS Version: Windows 10 but also Windows 7

  • Notable Version: 1.8.1

Current behavior

Only the last image seems to be saved in the attachments folder.
The name of this image file is "untitled". It has no extension like jpg or png.
And a number like "unititled-1", "untitled-2" is missing too.
That's probably the reason why only the last image of my imported note can be found.
In the markup of the imported note no markup can be found for all the images which are part of the original evernote note.

Expected behavior

Obviously all images should be saved to the attachments folder.
And the notable-markup for the whole note should contain markup for every image.

![](@attachment/Clipboard_2019-11-17-11-32-30.png)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.