vuejs / v2.vuejs.org

📄 Documentation for Vue 2
https://v2.vuejs.org
MIT License
5.03k stars 3.43k forks source link

One page Export of Documention for Epub conversion #664

Open gkatsanos opened 7 years ago

gkatsanos commented 7 years ago

Is there a way to convert the guide in a single page document so we can then convert to ePub etc and move to a Reader? I saw this issue as well related. #508

chrisvfritz commented 7 years ago

The answer there still stands. You might be able to achieve some success with a script that parses each markdown file in the source, then uses something like pandoc to convert it. I'd be open to a PR if it works well enough and doesn't increase the complexity of writing the docs for the web.

gkatsanos commented 7 years ago

Chris I believe you meant to say "a PR would be welcome if..".

gkatsanos commented 7 years ago

@chrisvfritz I setup pandoc and easily concatenated files in one locally (from other sources..) The problem with vuejs.org is the lack of a TOC .md and an alphabetical/numbering file naming which will help with concatenating the files properly. I noticed there's the "order" thing used to render them with Hexo but I'm unsure of how to expose this in bash/cat..

chrisvfritz commented 7 years ago

"I'd be open" is actually correct - it has a very similar meaning to "would be welcome", so it sounds like you understand my meaning. 🙂 I'd probably use a node instead of bash script for this. Here are some additional resources you may find useful:

Hope that helps!

gkatsanos commented 7 years ago

I'm not a node expert but I could give it a try. So the logic would be, scanning the "meta" info at the top of each file in /guide/ , and then generate one big file.. but how would I use pandoc with node?

chrisvfritz commented 7 years ago

You can use spawn or spawnSync from the native child_process module to execute binaries and capture the output. Here's an example of spawnSync.

PejmanNik commented 7 years ago

@gkatsanos do you have any success on this? If the problem of ordering isn't solve yet i can help with that I'm thinking to script that convert order from file context to file name...

gkatsanos commented 7 years ago

@PejmanNik unfortunately not. Feel free to jump in

PejmanNik commented 7 years ago

@gkatsanos My first try: vuejs.epub

but the eBook still need cover and maybe style and meta info...

chrisvfritz commented 7 years ago

@PejmanNik Nice start! Still a little rough though. For example, I saw some JavaScript errors and {% raw %} tags used for demos, which we'd probably want to strip out and replace with a placeholder or link to the lives site.

PejmanNik commented 7 years ago

@chrisvfritz Thank u. yes i try to read it and see this problem.. also images link should change and embedded in book I try to fix this problem but for {% raw %} some of them is html and some other is plane text so can i parse them? just replace with links is enough?

d-damien commented 7 years ago

Should it not be a Hexo plugin ? Would allow for other projects to use it. With maybe an alternate config file.