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
Kindle specific view for the Content Server #162
Conversation
Some comments:
|
@kovidgoyal thanks for the comments
I would personally prefer to separate the representation layer from the logic and just have a normal template. I saw in the code that some parts of the Content Server already has this but this part doesn't yet. Some ideas from the Kindle view would be great I think to have in the Mobile view like the hyperlinks on the Author, tags, pre-filtered formats depending on the device browsing the page. Maybe it's an idea to write down some ideas what else we (the users) would like to see so maybe we can figure out a way to implement this properly? It luckily didn't take me weeks to hack this together so a clean approach for a stable release would be 👍 for me |
A general refactoring of the content server is on my TODO list, see http://www.mobileread.com/forums/showthread.php?t=219642 As part of that, the server will stop using server side html generation and instead use some kind of client side templating library along with the ajax endpoints in ajax.py. Hopefully, when this gets done, there will not need to be a mobile.py at all, and we can use a responsive/adaptive/whatever-the-current-buzzword is single design for all screen sizes. In the meantime if you wish to make relatively small improvements to mobile.py, you are welcome to do so. Regarding 3) I dont see why it would be a lot more code. Can you elaborate? |
It sounds like a good idea to do everything from one view but my experience teaches me this is not a great approach. For a desktop you always want more information then for a Mobile (or even eInk view). I would still recommend a refactor and we could take a look at integrating Django's Templating for this. It's very well documented and the logic can easily be separated from the view. Referring to the 'more code' this is what I meant :) On a Mobile view you don't need a giant Table like on an eInk device so you would probably want to serve two different views etc. I wouldn't mind looking at creating new views and using the internal Calibre Database for proper querying into a view. Let's keep this PR open and throw some ideas around. PS: is it already possible to run the Calibre Content Server completely Headless? Or is there still a GUI needed for the initial installation? |
There is nothing preventing a single view from hiding information depending on screen size. My question about more code was why you think it is less code to create kindle.py rather than make mobile.py adapt its output based on user agent. the server runs headless, always has. |
As long as the View does that server side then indeed it's not much of an issue.
That was simply a duplicate, proof of concept. Also because for the Mobile View it has a different layout (div inside of a table vs 3 rows). But yes they can be merged just the |
2653bf0
to
fb416dd
Compare
12edbb7
to
d724fbc
Compare
fcddae0
to
b1eafd9
Compare
17d5990
to
2160cba
Compare
The new server is more or less ready (currently it only has a cover grid view, but the views are modular so adding more views should be easy in the future) calibre-debug --new-server to see it in action Closing this PR as it is no longer relevant. |
Hi,
this is still a Work in Progress but I wanted to get some feedback on this before.
This is a Kindle specific view for the Calibre Content Server because the mobile view was sadly a bit of a mess on my Kindle.
I started by taking the normal mobile.py and duplicate it to kindle.py and work my way from there.
On top of that I've decided to filter away formats that the Kindle cannot show and just display the one's it can.
It starts by doing a
format:mobi OR format:azw3
search query and then afterwards on URL generation for the Download again only showing the relevant formats.I've also made it possible to directly search for an Author, Tag or Series through the use of normal hyperlinks.
And because sometimes you want to see a Summary (but not always) this is Toggled through a simple Javascript command (which the Kindle supports! hooray!)
I'd love to hear some feedback, I haven't done Python in a while so don't go completely bonkers on me ;)