Discussion
Loading...

Post

  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Richard MacManus
@ricmac@mastodon.social  ·  activity timestamp 2 days ago

For #Eleventy fans: I’m curious if anyone is using 11ty to output eBook files? i.e. strict XHTML and perhaps some basic CSS. Specifically, I’d like to use some of my Cybercultural files in 11ty (i.e. the Markdown files for various articles) and turn those into XHTML so that I can edit in Calibre as an eBook project. Just curious if anyone is doing something similar already. #11ty cc @11ty

  • Copy link
  • Flag this post
  • Block
Dan Burzo
@db@typo.social replied  ·  activity timestamp 2 days ago

@ricmac @11ty The closest to what you’re describing is implementing a HTML to ePUB flow for https://github.com/danburzo/percollate, are you thinking just .md to .xhtml, or the whole .epub shebang?

GitHub

GitHub - danburzo/percollate: A command-line tool to turn web pages into readable PDF, EPUB, HTML, or Markdown docs.

A command-line tool to turn web pages into readable PDF, EPUB, HTML, or Markdown docs. - danburzo/percollate
  • Copy link
  • Flag this comment
  • Block
Richard MacManus
@ricmac@mastodon.social replied  ·  activity timestamp 2 days ago

@db @11ty Thanks, I will try out your tool and see how it goes 😊 I’m also still curious about .md to .xhtml, but really whatever works best is what I’m after.

  • Copy link
  • Flag this comment
  • Block
Dan Burzo
@db@typo.social replied  ·  activity timestamp 2 days ago

@ricmac @11ty If it’s just .md to .xhtml, I would implement a valid XHTML template for the shell, and I’d output the HTML content as XHTML with an Eleventy filter, roughly:

```
import { JSDOM } from 'jsdom';

config.addFilter('toxhtml', str => {
const { window } = new JSDOM(str);
return new window.XMLSerializer().serializeToString(window.document.body);
});
```

(written from memory, details may vary)

  • Copy link
  • Flag this comment
  • Block
Richard MacManus
@ricmac@mastodon.social replied  ·  activity timestamp 2 days ago

@db @11ty Thanks, I will give this a go!

  • Copy link
  • Flag this comment
  • Block
Dan Burzo
@db@typo.social replied  ·  activity timestamp 2 days ago

@ricmac (percollate has the non-negotiable Mozilla Readability pass, I don’t think it would be a good fit to turn .md/.html to an exact .epub)

  • Copy link
  • Flag this comment
  • Block
Log in

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.0-rc.3.21 no JS en
Automatic federation enabled
  • Explore
  • About
  • Members
  • Code of Conduct
Home
Login