Skip to content

WIP on ePub #94

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

WIP on ePub #94

wants to merge 2 commits into from

Conversation

asolove
Copy link
Contributor

@asolove asolove commented Jan 12, 2016

⚠️ Not at all ready, just putting this here for review as I work through #88.

I think a minimal useful version of this would:

  • get the ordered list of files from the MDBook and concat them
  • parse the combination of files in pulldown-cmark
  • transform the AST adding anchors to headings
  • transform the AST mapping external links to internal anchors
  • match the themes with epub versions of the styles

@@ -38,7 +38,7 @@ impl MDBook {
.set_src(&root.join("src"))
.set_dest(&root.join("book"))
.to_owned(),
renderer: Box::new(HtmlHandlebars::new()),
renderer: Box::new(Pandoc::new()),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just temporary to make local testing easier, but curious how we see this playing out long term. Should the mdbook command line support a new argument? Default to using all the available renderers?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the long term I guess it would be nice if the user could choose a couple of formats in his book.json and on build all formats would be exported. This needs a little bit of thinking to come up with a good design:

  • How to handle the automatic switching of renderers
  • Where to export, currently the html version is exported in book dir but where would pdf, epub, ... go?

@mkpankov
Copy link

@asolove @azerupi Hi!

We over at @ruRust (@ruRust/mdbook) plan to implement EPUB, MOBI and PDF output so we wanted to know if this PR is being worked on.

Anyway, we should probably discuss the specifics of configuration and choice of renderers in advance. @azerupi do you hang out on Mozilla's IRC (#rust)?

@azerupi
Copy link
Contributor

azerupi commented Mar 21, 2016

do you hang out on Mozilla's IRC (#rust)?

Not often, but if we agree on some date / time I can come online ;)

We over at @ruRust (@ruRust/mdbook) plan to implement EPUB, MOBI and PDF output so we wanted to know if this PR is being worked on.

That would be awesome!

I have been wanting to rewrite how mdBook works internally so that it would be easier to implement / enable / disable different renderers, themes and plug-ins for extra functionality. Because currently you can only have one renderer and this rendererer is not completely isolated into its own module to just swap it out. I have experimented with some designs but didn't get far.

The problem is that I feel like it would be a shame to put a lot of effort in writing the EPUB / PDF / MOBI renderer now and have to rewrite it when that new API is implemented. On the other hand I don't want to block new features as I have nothing concrete yet and it will probably take more time than I expect.

Maybe we could work together on that rewrite, we could discuss ideas about the new API. You could concentrate more on implementing the renderer and I could get useful feedback about how bad my ideas are. 😉 It will probably take more time, but I think it could be beneficial in the end and I would feel less guilty of making you do unnecessary work!

Now that you know that, I leave the choice up to you. Don't feel obligated in any way! :)

@azerupi
Copy link
Contributor

azerupi commented Apr 5, 2016

I am going to close this, as it has been inactive for some time

@azerupi azerupi closed this Apr 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants