Giter Club home page Giter Club logo

converter's Introduction

converter's People

Contributors

integral avatar michael avatar obuchtala avatar oliver7654 avatar vectorsize avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

converter's Issues

Tutorial does not run on fresh install

tutorial/001-convert-md-to-substance [master] » node convert.js lorem_ipsum.md
/home/joel/Repositories/tutorial/001-convert-md-to-substance/node_modules/substance-converter/src/pandoc_importer.js:196:15 (topLevelNode )
/home/joel/Repositories/tutorial/001-convert-md-to-substance/node_modules/substance-converter/src/pandoc_importer.js:146:23 (document )
/home/joel/Repositories/tutorial/001-convert-md-to-substance/node_modules/substance-converter/src/pandoc_importer.js:116:17 (import )
/home/joel/Repositories/tutorial/001-convert-md-to-substance/node_modules/substance-converter/src/converter.js:81:34 (convert )
/home/joel/Repositories/tutorial/001-convert-md-to-substance/node_modules/substance-converter/src/converter.js:60:9 (ChildProcess. )
events.js:98:17 (ChildProcess.EventEmitter.emit )
child_process.js:789:12 (Process.ChildProcess._handle.onexit )
{ message: 'Node not supported: t',
  name: 'ImporterError',
  code: -1,
  __stack: 
   [ { func: 'topLevelNode ',
       file: '/home/joel/Repositories/tutorial/001-convert-md-to-substance/node_modules/substance-converter/src/pandoc_importer.js',
       line: '196',
       col: '15' },
     { func: 'document ',
       file: '/home/joel/Repositories/tutorial/001-convert-md-to-substance/node_modules/substance-converter/src/pandoc_importer.js',
       line: '146',
       col: '23' },
     { func: 'import ',
       file: '/home/joel/Repositories/tutorial/001-convert-md-to-substance/node_modules/substance-converter/src/pandoc_importer.js',
       line: '116',
       col: '17' },
     { func: 'convert ',
       file: '/home/joel/Repositories/tutorial/001-convert-md-to-substance/node_modules/substance-converter/src/converter.js',
       line: '81',
       col: '34' },
     { func: 'ChildProcess. ',
       file: '/home/joel/Repositories/tutorial/001-convert-md-to-substance/node_modules/substance-converter/src/converter.js',
       line: '60',
       col: '9' },
     { func: 'ChildProcess.EventEmitter.emit ',
       file: 'events.js',
       line: '98',
       col: '17' },
     { func: 'Process.ChildProcess._handle.onexit ',
       file: 'child_process.js',
       line: '789',
       col: '12' } ] }

Weird error related to ChildProcess that only *sometimes* occur

When doing conversion within node, sometimes i get this little weird error.

/Users/michael/io/node_modules/substance-converter/src/converter.js:81:40 (convert )
/Users/michael/io/node_modules/substance-converter/src/converter.js:60:9 (ChildProcess.<anonymous> )
events.js:98:17 (ChildProcess.EventEmitter.emit )
child_process.js:789:12 (Process.ChildProcess._handle.onexit )

Substance Figure vs. Image

I wonder if we should rather create an image node type when we import from markdown. Then we can treat a figure as the full-fledged resource-ish thing.

Markdown image captions aren't really used like captions. They primarily serve the purpose of specifying the alt text (e.g. on mouseover). At least that's what they mean to me. ;)

Markdown converter: Make id's deterministic when explicitly given

If you specified in your markdown:

# Intro {#intro}

# Summary {#summary}

Node id's would still be artificial: heading_1, heading_2. That becomes a problem when we do deep links like:

http://substance.io/#substance/manual/heading_2

And in an update to the document those are likely to be invalidated (e.g. when someone inserts a heading intro and summary. We should use the explicitly given id's when possible. We need to make sure though that we normalize the ids so they can only have alphanumerics and underscores (we need html id compatibility).

md tables to json

How can I convert a table?

i get a error downing that from markdown to json.

.md :

+-------------------------+-------------------------+-------------------------+
| O | W | B |
+-------------------------+-------------------------+-------------------------+
| 1 | 1.1 Make | Md |
| | | LL |
| | | |
| | | •        the |
| | | czxc cxzc, |
| | | czxc of |
| | | czxc czxc |
| | | schoon voor czxn |
| | | czxc. |
| | | |
| | | •        czxc de |
| | | czxc op peil. |
| | | |
| | | •        czxc het |
| | | czxc op czxc. |
+-------------------------+-------------------------+-------------------------+

Support for inline-code

Already supported by the Substance.Article but not yet considered by the converter (I think).

From substance converter

Since you don't respond to e-mails, I will try to write here.

As I wrote the basic functionality of substance to pandoc converter is implemented. This means that text blocks decomposes to JSON representation of abstract syntax tree. You can try to use it in playground.js and convert substance document to HTML or markdown. There is still no inline converter, but I hope to implement it soon.

Now we have to decide few things:

  • Where we should (or we shouldn't) make substance document from JSON. Currently there is Document.fromSnapshot function running in playground.js. I thought that if we should implement export from some substance app, there'll be already substance documents, not plain JSON. Correct me if I was wrong.
  • We should think of what to do with other formats which need some directory to output, e.g. with formats which is not working with stdout (docx, pdf etc).

...waiting for your response... :)

Updated schema

I've introduced code and codeblock types to the schema. Construction looks like this:

For convering Inline code annotations (backticks in the markdown)

doc.apply(["insert", {
  "type": "code",
  "data": {
    "source": "text:14",
    "pos": [30, 5]
   }
});

And for code blocks:

doc.apply(["insert", {
  "type": "codeblock",
  "target": ["figures", "back"],
  "data": {
    "content": "function() bla\ndaefdasdfdfasdf"
   }
});

Then we also have images (![name](url)):

doc.apply(["insert", {
  "type": "image",
  "target": ["figures", "back"],
  "data": {
        "large_url": "http://bla.me/bla.png",
        "medium_url": "http://bla.me/large_bla.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.