ericzhang-cn / kindle-open-books Goto Github PK
View Code? Open in Web Editor NEWThis project is created to convert open source materials to kindle supported format
This project is created to convert open source materials to kindle supported format
Hey Eric:
你好!
非常感谢你做的这个工具,非常棒!
我的有道笔记里面存了大量的内容,希望可以通过kindle阅读。
如果要使用你的这个工具,如何才能将有道笔记的内容转换为kindle格式呢?
多谢!
这里是我的笔记的共享,供参考
http://note.youdao.com/share/?id=6d12e588a13f07aa7b73815b54f3ab9b&type=notebook
There are 6 contributors in README while there only 5 contributors in fact.
I guess that you may changed your username before.
In my opinion, we'd better touch a new file named Contributors.md
,like this:
Contributions to the kindle-open-books project
Creator & Maintainer
- someone
Contributors
In chronological order:
- someone
- someone
- someone
The reasons why I did so listed blow:
That's my personal opinions, what do you think of this suggestion?
from calibre.web.feeds.recipes import BasicNewsRecipe
class Python_Tutorial(BasicNewsRecipe):
title = 'Python Tutorial'
description = ''
cover_url = 'http://www.runoob.com/wp-content/uploads/2013/11/python.jpg'
url_prefix = 'http://www.runoob.com'
no_stylesheets = True
# 添加encoding也不行
encoding = 'utf-8'
keep_only_tags = [{ 'class': 'article-intro' }]
def get_title(self, link):
return link.contents[0].strip()
def parse_index(self):
soup = self.index_to_soup(self.url_prefix + '/python/python-tutorial.html')
# 这里打印soup是乱码
print(soup)
div = soup.find('div', { 'id': 'leftcolumn' })
articles = []
for link in div.findAll('a'):
if '#' in link['href']:
continue
if not '/python' in link['href']:
continue
til = self.get_title(link)
url = self.url_prefix + link['href']
a = { 'title': til, 'url': url }
articles.append(a)
ans = [('Python_Tutorial', articles)]
return ans
非常感谢介绍这个优秀的软件,但是我是用您的方法生成的书只有前面100个小节,后面的没有。
书籍地址是:https://support.omnigroup.com/documentation/omniplan/mac/3.0/zh/contents/
我的recipe文件为:
from calibre.web.feeds.recipes import BasicNewsRecipe
class Git_Pocket_Guide(BasicNewsRecipe):
title = 'OmniPlan 3 for MAC User Mannual zh'
description = ''
cover_url = 'https://support.omnigroup.com/doc-assets//OmniPlan-Mac/OmniPlan-Mac-v3.0.0.1/zh/EPUB/art/cover.thumbnail.jpg'
url_prefix = 'https://support.omnigroup.com/'
no_stylesheets = True
#keep_only_tags = [{ 'class': 'body_content' }]
def get_title(self, link):
return link.contents[0].strip()
def parse_index(self):
soup = self.index_to_soup(self.url_prefix + 'documentation/omniplan/mac/3.0/zh/')
div = soup.find('nav', { 'epub:type': 'toc' })
articles = []
for link in div.findAll('a'):
# if '#' in link['href']:
# continue
# if not 'ch' in link['href']:
# continue
print(link)
til = self.get_title(link)
url = self.url_prefix + link['href']
a = { 'title': til, 'url': url }
print(a)
articles.append(a)
ans = [('OmniPlan-Mac-zh-v3.0.0.1', articles)]
return ans
有几个问题要问一下:
Hi @ericzhang-cn, would you like me to provide you a copy of English README?
能否帮忙生成个recipe文件
http://mp.weixin.qq.com/wiki/home/index.html
根据你提供的教程,复制了一份代码自己试着修改创建一个recipe没有成功,不懂Python,请求帮忙。
Android_Training_Course_In_Chinese.recipe
calibre, version 2.50.1 (darwin, isfrozen: True)
转换错误: 失败: 抓取新闻来源于 Android_Training_Course_In_Chinese
抓取新闻来源于 Android_Training_Course_In_Chinese
Resolved conversion options
calibre version: 2.50.1
{'asciiize': False,
'author_sort': None,
'authors': None,
'base_font_size': 0,
'book_producer': None,
'change_justification': 'original',
'chapter': None,
'chapter_mark': 'pagebreak',
'comments': None,
'cover': None,
'debug_pipeline': None,
'dehyphenate': True,
'delete_blank_paragraphs': True,
'disable_font_rescaling': False,
'dont_compress': False,
'dont_download_recipe': False,
'duplicate_links_in_toc': False,
'embed_all_fonts': False,
'embed_font_family': None,
'enable_heuristics': False,
'expand_css': False,
'extra_css': None,
'extract_to': None,
'filter_css': None,
'fix_indents': True,
'font_size_mapping': None,
'format_scene_breaks': True,
'html_unwrap_factor': 0.4,
'input_encoding': None,
'input_profile': <calibre.customize.profiles.InputProfile object at 0x10a553190>,
'insert_blank_line': False,
'insert_blank_line_size': 0.5,
'insert_metadata': False,
'isbn': None,
'italicize_common_cases': True,
'keep_ligatures': False,
'language': None,
'level1_toc': None,
'level2_toc': None,
'level3_toc': None,
'line_height': 0,
'linearize_tables': False,
'lrf': False,
'margin_bottom': 5.0,
'margin_left': 5.0,
'margin_right': 5.0,
'margin_top': 5.0,
'markup_chapter_headings': True,
'max_toc_links': 50,
'minimum_line_height': 120.0,
'mobi_file_type': 'old',
'mobi_ignore_margins': False,
'mobi_keep_original_images': False,
'mobi_toc_at_start': False,
'no_chapters_in_toc': False,
'no_inline_navbars': True,
'no_inline_toc': False,
'output_profile': <calibre.customize.profiles.KindlePaperWhiteOutput object at 0x10a553910>,
'page_breaks_before': None,
'personal_doc': '[PDOC]',
'prefer_author_sort': False,
'prefer_metadata_cover': False,
'pretty_print': False,
'pubdate': None,
'publisher': None,
'rating': None,
'read_metadata_from_opf': None,
'remove_fake_margins': True,
'remove_first_image': False,
'remove_paragraph_spacing': False,
'remove_paragraph_spacing_indent_size': 1.5,
'renumber_headings': True,
'replace_scene_breaks': '',
'search_replace': None,
'series': None,
'series_index': None,
'share_not_sync': False,
'smarten_punctuation': False,
'sr1_replace': '',
'sr1_search': '',
'sr2_replace': '',
'sr2_search': '',
'sr3_replace': '',
'sr3_search': '',
'start_reading_at': None,
'subset_embedded_fonts': False,
'tags': None,
'test': False,
'timestamp': None,
'title': None,
'title_sort': None,
'toc_filter': None,
'toc_threshold': 6,
'toc_title': None,
'unsmarten_punctuation': False,
'unwrap_lines': True,
'use_auto_toc': False,
'verbose': 2}
Python function terminated unexpectedly: 'NoneType' object has no attribute 'findAll'
InputFormatPlugin: Recipe Input running
Using custom recipe
Traceback (most recent call last):
File "/Applications/calibre.app/Contents/Resources/Python/lib/python2.7/site.py", line 209, in main
return run_entry_point()
File "/Applications/calibre.app/Contents/Resources/Python/lib/python2.7/site.py", line 114, in run_entry_point
return getattr(pmod, func)()
File "site-packages/calibre/utils/ipc/worker.py", line 190, in main
File "site-packages/calibre/gui2/convert/gui_conversion.py", line 25, in gui_convert
File "site-packages/calibre/ebooks/conversion/plumber.py", line 1051, in run
File "site-packages/calibre/customize/conversion.py", line 241, in call
File "site-packages/calibre/ebooks/conversion/plugins/recipe_input.py", line 117, in convert
File "site-packages/calibre/web/feeds/news.py", line 1029, in download
File "site-packages/calibre/web/feeds/news.py", line 1194, in build_index
File "", line 21, in parse_index
AttributeError: 'NoneType' object has no attribute 'findAll'
Hi,
When I try make Learn_Python_the_Hard_Way.mobi
it makes the mobi file, but it does not have any content. Just the url of the relevant page.
Can you please fix that, so want to read that book.
Thanks.
Source: http://chimera.labs.oreilly.com/tags/Early%20Release
Note: Did not include incomplete books.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.