No longer maintained. Use http://github.com/substance/substance instead.
substance / converter Goto Github PK
View Code? Open in Web Editor NEWPandoc in — Substance out and the other way round.
License: MIT License
Pandoc in — Substance out and the other way round.
License: MIT License
No longer maintained. Use http://github.com/substance/substance instead.
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' } ] }
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 )
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. ;)
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).
This Markdown input brought up an error:
- Foo
- Bar
- Bla
- Blupp
E.g., these are inline HTML comments.
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. |
+-------------------------+-------------------------+-------------------------+
An interesting document base is arxiv.
We need to evaluate how Pandoc can deal with it.
Here are the available formats for most of the articles: http://arxiv.org/format/1401.0013v2
Already supported by the Substance.Article but not yet considered by the converter (I think).
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:
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.stdout
(docx, pdf etc)....waiting for your response... :)
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"
}
});
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.