[HN Gopher] Ruby for eBook Publishing
       ___________________________________________________________________
        
       Ruby for eBook Publishing
        
       Author : thunderbong
       Score  : 107 points
       Date   : 2021-09-20 15:29 UTC (7 hours ago)
        
 (HTM) web link (nts.strzibny.name)
 (TXT) w3m dump (nts.strzibny.name)
        
       | purpleidea wrote:
       | I know this guy, he is a good worker and puts passion into this
       | book. Help him out and give him a sale!
        
         | strzibny wrote:
         | Thanks James ;)
        
       | dyingkneepad wrote:
       | Man, I love Ruby. I think it is much more elegant than Python and
       | I really really wish Ruby would have taken the world instead of
       | Python. That said, it's often the case where I want to do
       | something where there's just no Ruby library for it (or at least
       | not a maintained one) and there's a well known library for it in
       | Python. Note: I do low level things, I don't do anything related
       | to web or Rails.
       | 
       | Also, sometimes I start writing scripts for simple things, then
       | they grow and at some point it's interesting to share them to my
       | teammates, and they all immediately dismiss it since it's in
       | Ruby. For that reason, I started doing all my work-related
       | scripting in Python. But oh boy, it's always with that sad
       | feeling of "I wish I was doing this in Ruby". Sometimes I think I
       | should just not have learned Ruby and jumped straight to Python.
        
         | [deleted]
        
         | jacobsenscott wrote:
         | It just shows how "cargo cult" driven our industry is. Ruby was
         | in. Then it was out, because it "doesn't scale". Then suddenly
         | Python is in, even though it is has the exact same performance
         | characteristics, give or take some constant value, as Ruby.
        
           | luibelgo wrote:
           | Languages look similar, but Python value resides in the vast
           | amount of libraries available to do data processing and ML.
           | Most of them backed by C implementations under the hood.
        
             | Grimm1 wrote:
             | Exactly, and though Ruby has an FFI (Foreign Function
             | Interface) similar libraries were not created and Ruby was
             | pigeon holed as a language you build CRUD apps in.
        
         | Glyptodon wrote:
         | I also think Ruby is so much cleaner and more productive than
         | Python. I really miss it. The number of times I think "this is
         | like a bad version of Ruby" while doing stuff in Python...
        
           | seiferteric wrote:
           | Perhaps we need a ruby <-> python transpiler so you can
           | secretly program in ruby on python projects.
        
         | stevekemp wrote:
         | I have to admit I've had a similar reaction, at a previous
         | company we were "forced" to use Ruby to be consistent.
         | 
         | I grew to love Ruby, though I admit I always approached it with
         | half a mind pretending I was writing Perl.
         | 
         | These days I've sometimes fallen back into Ruby, but then had
         | issues sharing it with colleagues - so I've largely switched to
         | Go. While most people don't have a dev-environment setup I can
         | give them binaries built via github/gitlab/jenkins, and so
         | sharing tools & utilities is just that little bit less painful
         | than with Ruby (and even Python).
        
           | strzibny wrote:
           | ruby-packer worked for my little Ruby things in that regard
           | https://nts.strzibny.name/making-a-ruby-executable-with-
           | ruby...
        
           | benbristow wrote:
           | I used to work somewhere where I got "forced" to use Perl but
           | was more familiar with Ruby.
           | 
           | Obviously Perl came far earlier than Ruby and Ruby was
           | heavily inspired by Perl (There's even a quick comparison on
           | the official Ruby site here https://www.ruby-
           | lang.org/en/documentation/ruby-from-other-l...) but it always
           | felt like Ruby is such a nicer language to read and write and
           | obviously due to age was just a more modern overall. You
           | could define a class as a... class!
           | 
           | Whenever I wanted to make a quick script for myself for
           | personal usage I'd always write it in Ruby.
           | 
           | I'm now in a C#/.NET role and love typed languages now but
           | I'd never go back to Perl, but I still have a special spot
           | for Ruby.
        
           | weaksauce wrote:
           | why not docker?
        
         | seiferteric wrote:
         | I just the other day started working on an idea for a ruby
         | based shell: https://github.com/seiferteric/rbshell . The idea
         | is to try to write a ruby DSL that looks as similar as possible
         | to regular CLI commands, but return ruby objects so you can
         | more easily process the results. I would be interested in some
         | help if others are interested. I haven't yet decided on the
         | exact syntax yet but it is already looking kind of interesting
         | I think.
        
           | freedomben wrote:
           | neat, I started a similar thing in 2014 but just didn't have
           | the time it needed. I sincerely wish you well on your effort!
           | I'd still love to have a shell based on ruby.
        
         | ash_while wrote:
         | I feel very similarly! Ruby just feels like such a well
         | designed system from the ground-up. The object model is so
         | elegant and consistent. The standard library is feature-full
         | and fun to use, and the docs are excellent. Ruby is a beautiful
         | object-oriented language but also leans into the power of FP
         | with a plethora of functions defined on the powerful base-
         | classes like Enumerable. In comparison, Python feels way less
         | thoughtful, more of an ad-hoc language constructed through
         | independent decisions over a long period of time
        
         | Grimm1 wrote:
         | One of the major reasons Ruby didn't take off [outside of web]
         | is because of the library availability. Ruby was pigeon holed
         | by Rails while in Python I can reach for a library for pretty
         | much any usecase and scenario from Genomics to Web.
         | 
         | The thing is that is an issue of community, because Ruby does
         | have an FFI and there is really nothing stopping people from
         | building libraries similar to how they're done in Python,
         | calling out to C. They just didn't.
        
         | weaksauce wrote:
         | Yeah I love ruby too... why do they dismiss it if docker is
         | there for them to get running quickly? python is just so janky
         | to me
        
         | Torwald wrote:
         | Can you give me one or twoo examples for such missing low-level
         | stuff Ruby libraries, please?
        
       | jasonjei wrote:
       | This is great, but wouldn't it be easier to use a LaTeX ebook
       | transformer since many books are already set in TeX?
        
         | strzibny wrote:
         | I used Pandoc + LaTex for https://deploymentfromscratch.com/ as
         | mentioned in the post, but my brother is now taking the
         | AsciiDoc approach and I think it's looking good. I will think
         | hard next time and most likely give AsciiDoctor a chance.
        
       | canyonero wrote:
       | I've been using mdBook: https://github.com/rust-lang/mdBook for a
       | personal knowledge base in an ebook format and it's been a joy.
       | Not Ruby, it's written in Rust instead.
       | 
       | It's very easy to customize either via plugins with Rust or by
       | overriding template files. While the linked article is cool, it
       | seems like a lot of effort to maintain such a set up. Then again,
       | if you're a Ruby expert I could see this being worth it.
        
         | strzibny wrote:
         | Did not know about mdBook, will have a look!
        
       | bovermyer wrote:
       | Sounds like fun. However, I started using LaTeX instead of
       | Markdown+pandoc for PDF creation because I needed more control
       | over the layout than Markdown is capable of.
        
       | Lammy wrote:
       | >PDF publishing
       | 
       | I'm also a big fan of the HexaPDF library:
       | https://hexapdf.gettalong.org/
        
         | strzibny wrote:
         | It's mentioned! I used it to make all kind of previews.
        
       | qwerty456127 wrote:
       | Can it paint a PDF text between 2 pints in a color gradient?
        
         | the_sleaze9 wrote:
         | Yep. It can also convert PDFs into nice PNGs
        
         | gnicholas wrote:
         | Are you referring to the color gradients in text made popular
         | by BeeLine Reader?
        
           | qwerty456127 wrote:
           | Yes. The idea feels very nice but the implementation is
           | unbearable. I want to imitate that without having to install
           | a browser extension which is ridiculously slow and requires
           | access to all the pages you visit. I would tolerate it if it
           | would stay off until I actively invoke it when and where I
           | want (mostly local disk/host documents) and if I could be
           | sure it doesn't spy on me. So I am passively looking for an
           | alternative. So far LaTeX was the only alternative I've found
           | that can do that but it is otherwise too complex to use (I
           | managed to achieve the effect but failed to build a book of
           | specific structure I needed in reasonable time). Now I'm
           | curious if Ruby can fill this gap between MarkDown/HTML+CSS
           | and LaTeX.
        
             | gnicholas wrote:
             | Totally understandable. I'm the creator of BeeLine (and the
             | concept), and permissions in Chrome extensions are tough.
             | One possible solution for concerned users is to whitelist
             | certain sites via the extension manager, so that the
             | extension only has access to those domains, but I don't
             | think there's a way to do that for local files.
             | 
             | If you want to just convert files, you might try the File
             | Transformer[1] by Blackboard Ally. They've licensed the
             | BeeLine technology and are temporarily making it available
             | for free publicly through the File Transformer (it's also
             | available to their university customers through their LMS
             | interface).
             | 
             | Lastly, I know it probably won't put your mind at ease, but
             | I am the solo founder who runs BeeLine Reader. I do not do
             | anything with user data, and in fact I don't even gather
             | data at the individual user level. This is partly because
             | my tools are used in K12 schools, and partly because I
             | can't imagine selling out my customers.
             | 
             | 1: https://ally.ac/covid19/
        
               | qwerty456127 wrote:
               | Thank you for the link (and for inventing the concept).
               | I'll probably use it for some files but again this means
               | uploading files to some untrusted server (I believe you
               | when you say you don't gather data but uploading a file
               | and being sure it won't be saved anywhere feels harder).
               | 
               | You probably know better as you have probably done some
               | business modelling but just for my piece of feedback - I
               | would buy it if you would offer a purely offline
               | Linux+Windows+Mac app that outputs coloured (and
               | structured) PDFs given a MarkDown (or some XML
               | intermediary, perhaps FB2, for more complex structures)
               | file and a paper format for input. At the moment I feel
               | like the price I would pay could be something near $100.
               | I wouldn't even mind paying if it's just a proprietary
               | script on top of free software.
               | 
               | It would also be great if one day you would add an on-
               | demand (on the extension button click) mode to the
               | extension to save the users' CPUs and batteries.
               | 
               | I hope you don't feel insulted by how do I speak about
               | your creation's performance - I understand it can be hard
               | to teach a browser's text rendering engine a totally new
               | trick. Perhaps you have even improved it since the last
               | time I tried (which was years ago).
        
       ___________________________________________________________________
       (page generated 2021-09-20 23:00 UTC)