baker icon indicating copy to clipboard operation
baker copied to clipboard

Book.json - URL parameter - what does it do?

Open tstegart opened this issue 14 years ago • 6 comments

The URL parameter in the book.json file is required, but what does it do? How does it work? I know it says this: url (string): Unique identifier of the publication, using the book:// protocol.

But what should I change it to before I publish my book using Baker? Lets assume I'm publishing a book or magazine to the Apple App Store, and I only want people to buy it from there. Do I also put my book up on my website? Do I just make up something, like book://mywebsite.com/bookname.hpub? How does it affect my app? Can I just leave the Study in Scarlet url in there? Secondly, do I actually need to publish any files to my website so that something all be available at the URL?

I'm unclear on the purpose of this parameter.

tstegart avatar Jan 31 '12 19:01 tstegart

It's a good question. Ad you got correctly, it's related to the download of a book, but that's a consequence, not a requirement. :)

The first and main usage is being able to uniquely refer to a specific book. Think of it as an ISBN.

In fact, URL, or better, URI, means "Uniform Resource Identifier". It identifies uniquely a resource, and that's also the grounding of having an ISBN. So, by default, it provides:

  • Uniqueness
  • Findability
  • De-duplication of content

The difference from ISBN is that by using a URL we can add way more informations:

  • It could be a link to download the book
  • You could show the author and publisher
  • You can version it
  • You can provide different types of book formats

This is a critical feature to have to organize information, to locate information and to tell apart one book from another without doing a static analysis on the book as a whole.

So, yes, use your own URL, even if there's no file to download. :)

P.S.: Baker internally relies on that unique identifier to tell two books apart, and the standard Hpub requires that as well. If you use an already used URL, it might generate in the future bad overlapping situations where the user won't be able to download a new book because "it's already downloaded", given the same URL. And so on, you can think lots of situations where not using a proper URL can lead to bad user experience and technical problems.

folletto avatar Jan 31 '12 20:01 folletto

Thanks. So I just put in a URL and I don't actually have to upload anything to the website. If I did want to show author and publisher, what would I upload?

tstegart avatar Jan 31 '12 21:01 tstegart

Yep. :)

What do you mean by show author and publisher? :)

folletto avatar Jan 31 '12 21:01 folletto

I took your previous answer to mean I could upload, say, a text file at that URL with the author and publisher info in it, but I think I'm understanding this wrong.

tstegart avatar Jan 31 '12 21:01 tstegart

Ah! Now I got it. By "specify author or publisher" I meant that you could build an URL like:

book://publisher.org/author/book-name/edition.hpub

In this way, you see that the URL is incredibly meaningful. :)

folletto avatar Jan 31 '12 23:01 folletto

Ok, I understand now. Thanks a lot for explaining that.

tstegart avatar Jan 31 '12 23:01 tstegart