캘리버 사용자 정의¶
캘리버는 매우 모듈화된 설계를 가지고 있습니다. 다양한 부분을 사용자 정의할 수 있습니다. 여기서 다음 내용을 배우게 됩니다:
환경 변수와 *트윅*을 사용하여 캘리버의 동작을 사용자 정의하는 방법,
아이콘과 템플릿 같은 자신만의 정적 리소스를 지정하여 기본값을 재정의하는 방법
*플러그인*을 사용하여 캘리버에 기능을 추가하는 방법.
다른 캘리버 사용자와 아이콘 테마 및 플러그인을 공유하는 방법.
캘리버에 새로운 온라인 콘텐츠 소스를 추가하기 위한 *레시피*를 만드는 방법은 즐겨찾는 뉴스 웹사이트 추가 섹션을 방문하세요.
참고
아이콘 테마와 플러그인은 캘리버의 내장된 업데이터를 통해 인덱싱되고 다운로드할 수 있지만 캘리버의 일부가 아니며 지원 및 소스 코드에 대한 표준 위치는 지원 스레드의 `Mobileread 포럼 <https://www.mobileread.com/forums/forumdisplay.php?f=166>`__에 있습니다.
환경 변수¶
CALIBRE_CONFIG_DIRECTORY- 구성 파일이 저장/읽기되는 폴더를 설정합니다.
CALIBRE_TEMP_DIR- 캘리버가 사용하는 임시 폴더를 설정합니다
CALIBRE_CACHE_DIRECTORY- 캘리버가 세션 간에 영속 데이터를 캐시하는 폴더를 설정합니다
CALIBRE_OVERRIDE_DATABASE_PATH- metadata.db의 전체 경로를 지정할 수 있습니다. 이 변수를 사용하면 metadata.db를 라이브러리 폴더가 아닌 다른 위치에 둘 수 있습니다. 라이브러리 폴더가 파일 잠금을 지원하지 않는 네트워크 드라이브에 있는 경우에 유용합니다.
CALIBRE_ALLOW_PYTHON_TEMPLATES-1이외의 값으로 설정하면 캘리버에서 Python 기반 템플릿의 사용을 비활성화합니다.
CALIBRE_DEVELOP_FROM- 캘리버 개발 환경에서 실행하는 데 사용합니다. :ref:`develop`을 참조하세요.
CALIBRE_OVERRIDE_LANG- 인터페이스에서 사용하는 언어를 강제하는 데 사용합니다 (ISO 639 언어 코드)
CALIBRE_TEST_TRANSLATION- 번역 .po 파일을 테스트하는 데 사용합니다 (.po 파일의 경로여야 합니다)
CALIBRE_NO_NATIVE_FILEDIALOGS- 캘리버가 파일/폴더 선택 시 기본 파일 대화상자를 사용하지 않도록 합니다.
CALIBRE_NO_NATIVE_MENUBAR- Ubuntu Unity 및 유사한 Linux 데스크톱 환경에서 캘리버가 기본(전역) 메뉴를 생성하지 않도록 합니다. 대신 메뉴가 기존 방식대로 창 안에 배치됩니다.
CALIBRE_USE_SYSTEM_THEME- 기본적으로 Linux에서 캘리버는 자체 내장 Qt 스타일을 사용합니다. 이는 캘리버가 빌드된 Qt 버전과 시스템 Qt 간의 비호환성으로 인한 충돌 및 멈춤을 방지하기 위함입니다. 단점은 캘리버가 시스템의 모양과 느낌을 따르지 않을 수 있다는 것입니다. Linux에서 이 환경 변수를 설정하면 캘리버가 시스템 테마를 사용하게 됩니다 – 충돌 및 멈춤에 주의하세요.
CALIBRE_SHOW_DEPRECATION_WARNINGS- 캘리버가 stdout에 사용 중단 경고를 출력하도록 합니다. 캘리버 개발자에게 유용합니다.
CALIBRE_NO_DEFAULT_PROGRAMS- 캘리버가 처리 가능한 파일 형식을 Windows에 자동으로 등록하지 않도록 방지합니다.
CALIBRE_USE_SYSTEM_CERTIFICATES- Windows 및 macOS에서 캘리버가 자체 인증서 저장소 대신 시스템 인증서 저장소를 사용하여 SSL 인증서 검증을 수행하도록 합니다.
CALIBRE_NO_ICONS_IN_MENUS- 메뉴에서 아이콘 비활성화
QT_QPA_PLATFORM- Linux에서 ``wayland``로 설정하면 캘리버가 Wayland를 사용하도록 강제하고, ``xcb``로 설정하면 X11을 사용하도록 강제합니다.
SYSFS_PATH- sysfs가 /sys 외의 다른 곳에 마운트된 경우 사용
http_proxy,https_proxy- Linux에서 HTTP(S) 프록시를 지정하는 데 사용
Windows에서 환경 변수를 설정하는 방법 <https://www.computerhope.com/issues/ch000549.htm>`_을 참조하세요. macOS를 사용하는 경우 :file:`~/Library/Preferences/calibre/macos-env.txt 파일을 생성하고 환경 변수를 한 줄에 하나씩 넣어 설정할 수 있습니다. 예를 들어:
CALIBRE_DEVELOP_FROM=$HOME/calibre-src/src
CALIBRE_NO_NATIVE_FILEDIALOGS=1
CALIBRE_CONFIG_DIRECTORY=~/.config/calibre
트윅¶
트윅은 캘리버의 동작을 다양한 측면에서 제어하기 위해 지정할 수 있는 작은 변경 사항입니다. 환경설정->고급->트윅으로 이동하여 변경할 수 있습니다. 트윅의 기본값은 아래에 나열되어 있습니다
#!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
# License: GPLv3 Copyright: 2010, Kovid Goyal <kovid at kovidgoyal.net>
# Contains various tweaks that affect calibre behavior. Only edit this file if
# you know what you are doing. If you delete this file, it will be recreated from
# defaults.
#: Auto increment series index
# The algorithm used to assign a book added to an existing series a series number.
# New series numbers assigned using this tweak are always integer values, except
# if a constant non-integer is specified.
# Possible values are:
# next - First available integer larger than the largest existing number
# first_free - First available integer larger than 0
# next_free - First available integer larger than the smallest existing number
# last_free - First available integer smaller than the largest existing number. Return largest existing + 1 if no free number is found
# const - Assign the number 1 always
# no_change - Do not change the series index
# a number - Assign that number always. The number is not in quotes. Note that 0.0 can be used here.
# Examples:
# series_index_auto_increment = 'next'
# series_index_auto_increment = 'next_free'
# series_index_auto_increment = 16.5
#
# Set the use_series_auto_increment_tweak_when_importing tweak to True to
# use the above values when importing/adding books. If this tweak is set to
# False (the default) then the series number will be set to 1 if it is not
# explicitly set during the import. If set to True, then the
# series index will be set according to the series_index_auto_increment setting.
# Note that the use_series_auto_increment_tweak_when_importing tweak is used
# only when a value is not provided during import. If the importing regular
# expression produces a value for series_index, or if you are reading metadata
# from books and the import plugin produces a value, then that value will
# be used irrespective of the setting of the tweak.
series_index_auto_increment = 'next'
use_series_auto_increment_tweak_when_importing = False
#: Add separator after completing an author name
# Set this if the completion separator should be appended to the end of the
# completed text to automatically begin a new completion operation for authors.
# It can be either True or False
authors_completer_append_separator = False
#: Author sort name algorithm
# The algorithm used to copy author to author_sort.
# Possible values are:
# invert: use "fn ln" -> "ln, fn"
# copy : copy author to author_sort without modification
# comma : use 'copy' if there is a ',' in the name, otherwise use 'invert'
# nocomma : "fn ln" -> "ln fn" (without the comma)
# When this tweak is changed, the author_sort values stored with each author
# must be recomputed by right-clicking on an author in the left-hand tags
# panel, selecting 'Manage authors', and pressing
# 'Recalculate all author sort values'.
#
# The author_name_suffixes are words that are ignored when they occur at the
# end of an author name. The case of the suffix is ignored and trailing
# periods are automatically handled.
#
# The same is true for author_name_prefixes.
#
# The author_name_copywords are a set of words which, if they occur in an
# author name, cause the automatically generated author sort string to be
# identical to the author's name. This means that the sort for a string like
# "Acme Inc." will be "Acme Inc." instead of "Inc., Acme".
#
# If author_use_surname_prefixes is enabled, any of the words in
# author_surname_prefixes will be treated as a prefix to the surname, if they
# occur before the surname. So for example, "John von Neumann" would be sorted
# as "von Neumann, John" and not "Neumann, John von".
author_sort_copy_method = 'comma'
author_name_suffixes = ('Jr', 'Sr', 'Inc', 'Ph.D', 'Phd',
'MD', 'M.D', 'I', 'II', 'III', 'IV',
'Junior', 'Senior')
author_name_prefixes = ('Mr', 'Mrs', 'Ms', 'Dr', 'Prof')
author_name_copywords = (
'Agency', 'Corporation', 'Company', 'Co.', 'Council',
'Committee', 'Inc.', 'Institute', 'National', 'Society', 'Club', 'Team',
'Software', 'Games', 'Entertainment', 'Media', 'Studios',
)
author_use_surname_prefixes = False
author_surname_prefixes = ('da', 'de', 'di', 'la', 'le', 'van', 'von')
#: Splitting multiple author names
# By default, calibre splits a string containing multiple author names on
# ampersands and the words "and" and "with". You can customize the splitting
# by changing the regular expression below. Strings are split on whatever the
# specified regular expression matches, in addition to ampersands.
# Default: r'(?i),?\s+(and|with)\s+'
authors_split_regex = r'(?i),?\s+(and|with)\s+'
#: Use author_sort and/or series_sort for names in Tag browser
# Set which author or series field is used to display as the item name in the
# Tag browser (the list of authors, series, publishers etc on the left hand
# side). The choices for author are 'author' and 'author_sort'. The choices for
# series are 'series' and 'series_sort'. This tweak affects only what is
# displayed under the category in the Tag browser and Content server. Please
# note that if you set this to …_sort, it is possible to see duplicate names in
# the list because although it is guaranteed that author and series names are
# unique, there is no such guarantee for their sort values. Showing duplicates
# won't break anything but it could lead to some confusion. The tooltip for an
# item will show the item's name no matter how you set this tweak.
# Examples:
# categories_use_field_for_author_name = 'author'
# categories_use_field_for_author_name = 'author_sort'
# categories_use_field_for_series_name = 'series'
# categories_use_field_for_series_name = 'series_sort'
categories_use_field_for_author_name = 'author'
categories_use_field_for_series_name = 'series'
#: Control partitioning of Tag browser
# When partitioning the Tag browser, the format of the subcategory label is
# controlled by a template: categories_collapsed_name_template if sorting by
# name, categories_collapsed_rating_template if sorting by average rating, and
# categories_collapsed_popularity_template if sorting by popularity. There are
# two variables available to the template: first and last. The variable 'first'
# is the initial item in the subcategory, and the variable 'last' is the final
# item in the subcategory. Both variables are 'objects'; they each have multiple
# values that are obtained by using a suffix. For example, first.name for an
# author category will be the name of the author. The sub-values available are:
# name: the printable name of the item
# count: the number of books that references this item
# avg_rating: the average rating of all the books referencing this item
# sort: the sort value. For authors, this is the author_sort for that author
# category: the category (e.g., authors, series) that the item is in.
# Note that the "r'" in front of the { is necessary if there are backslashes
# (\ characters) in the template. It doesn't hurt anything to leave it there
# even if there aren't any backslashes.
categories_collapsed_name_template = r'{first.sort:shorten(4,,0)} - {last.sort:shorten(4,,0)}'
categories_collapsed_rating_template = r'{first.avg_rating:4.2f:ifempty(0)} - {last.avg_rating:4.2f:ifempty(0)}'
categories_collapsed_popularity_template = r'{first.count:d} - {last.count:d}'
#: Specify columns to sort the booklist by on startup
# Provide a set of columns to be sorted on when calibre starts.
# The argument is None if saved sort history is to be used
# otherwise it is a list of column,order pairs. Column is the
# lookup/search name, found using the tooltip for the column
# Order is 0 for ascending, 1 for descending.
# For example, set it to [('authors',0),('title',0)] to sort by
# title within authors.
sort_columns_at_startup = None
#: Control how dates are displayed
# Format to be used for publication date and the timestamp (date).
# A string controlling how the publication date is displayed in the GUI
# d the day as number without a leading zero (1 to 31)
# dd the day as number with a leading zero (01 to 31)
# ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun')
# dddd the long localized day name (e.g. 'Monday' to 'Sunday')
# M the month as number without a leading zero (1-12)
# MM the month as number with a leading zero (01-12)
# MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec')
# MMMM the long localized month name (e.g. 'January' to 'December')
# yy the year as two digit number (00-99)
# yyyy the year as four digit number
# h the hours without a leading 0 (0 to 11 or 0 to 23, depending on am/pm)
# hh the hours with a leading 0 (00 to 11 or 00 to 23, depending on am/pm)
# m the minutes without a leading 0 (0 to 59)
# mm the minutes with a leading 0 (00 to 59)
# s the seconds without a leading 0 (0 to 59)
# ss the seconds with a leading 0 (00 to 59)
# ap use a 12-hour clock instead of a 24-hour clock, with "ap" replaced by the lowercase localized string for am or pm
# AP use a 12-hour clock instead of a 24-hour clock, with "AP" replaced by the uppercase localized string for AM or PM
# aP use a 12-hour clock instead of a 24-hour clock, with "aP" replaced by the localized string for am or pm
# Ap use a 12-hour clock instead of a 24-hour clock, with "Ap" replaced by the localized string for AM or PM
# iso the date with time and timezone. Must be the only format present
# For example, given the date of 9 Jan 2010, the following formats show
# MMM yyyy ==> Jan 2010 yyyy ==> 2010 dd MMM yyyy ==> 09 Jan 2010
# MM/yyyy ==> 01/2010 d/M/yy ==> 9/1/10 yy ==> 10
#
# publication default if not set: MMM yyyy
# timestamp default if not set: dd MMM yyyy
# last_modified_display_format if not set: dd MMM yyyy
gui_pubdate_display_format = 'MMM yyyy'
gui_timestamp_display_format = 'dd MMM yyyy'
gui_last_modified_display_format = 'dd MMM yyyy'
#: Control sorting of titles and series in the library display
# Control title and series sorting in the library view. If set to
# 'library_order', the title sort field will be used instead of the title.
# Unless you have manually edited the title sort field, leading articles such as
# The and A will be ignored. If set to 'strictly_alphabetic', the titles will be
# sorted as-is (sort by title instead of title sort). For example, with
# library_order, The Client will sort under 'C'. With strictly_alphabetic, the
# book will sort under 'T'.
# This flag affects calibre's library display. It has no effect on devices. In
# addition, titles for books added before changing the flag will retain their
# order until the title is edited. Editing a title and hitting Enter
# without changing anything is sufficient to change the sort. Or you can use
# the 'Update title sort' action in the Bulk metadata edit dialog to update
# it for many books at once.
title_series_sorting = 'library_order'
#: Control formatting of title and series when used in templates
# Control how title and series names are formatted when saving to disk/sending
# to device. The behavior depends on the field being processed. If processing
# title, then if this tweak is set to 'library_order', the title will be
# replaced with title_sort. If it is set to 'strictly_alphabetic', then the
# title will not be changed. If processing series, then if set to
# 'library_order', articles such as 'The' and 'An' will be moved to the end. If
# set to 'strictly_alphabetic', the series will be sent without change.
# For example, if the tweak is set to library_order, "The Lord of the Rings"
# will become "Lord of the Rings, The". If the tweak is set to
# strictly_alphabetic, it would remain "The Lord of the Rings". Note that the
# formatter function raw_field will return the base value for title and
# series regardless of the setting of this tweak.
save_template_title_series_sorting = 'library_order'
#: Set the list of words considered to be "articles" for sort strings
# Set the list of words that are to be considered 'articles' when computing the
# title sort strings. The articles differ by language. By default, calibre uses
# a combination of articles from English and whatever language the calibre user
# interface is set to. In addition, in some contexts where the book language is
# available, the language of the book is used. You can change the list of
# articles for a given language or add a new language by editing
# per_language_title_sort_articles. To tell calibre to use a language other
# than the user interface language, set, default_language_for_title_sort. For
# example, to use German, set it to 'deu'. A value of None means the user
# interface language is used. The setting title_sort_articles is ignored
# (present only for legacy reasons).
per_language_title_sort_articles = {
# English
'eng': (r'A\s+', r'The\s+', r'An\s+'),
# Esperanto
'epo': (r'La\s+', r"L'", 'L´'),
# Spanish
'spa': (r'El\s+', r'La\s+', r'Lo\s+', r'Los\s+', r'Las\s+', r'Un\s+',
r'Una\s+', r'Unos\s+', r'Unas\s+'),
# French
'fra': (r'Le\s+', r'La\s+', r"L'", r'L´', r'L’', r'Les\s+', r'Un\s+', r'Une\s+',
r'Des\s+', r'De\s+(La\s+)?', r"D'", r'D´', r'D’'),
# Polish
'pol': (),
# Italian
'ita': (r'Lo\s+', r'Il\s+', r"L'", r'L´', r'La\s+', r'Gli\s+',
r'I\s+', r'Le\s+', r'Uno\s+', r'Un\s+', r'Una\s+', r"Un'",
r'Un´', r'Dei\s+', r'Degli\s+', r'Delle\s+', r'Del\s+',
r'Della\s+', r'Dello\s+', r"Dell'", r'Dell´'),
# Portuguese
'por': (r'A\s+', r'O\s+', r'Os\s+', r'As\s+', r'Um\s+', r'Uns\s+',
r'Uma\s+', r'Umas\s+'),
# Romanian
'ron': (r'Un\s+', r'O\s+', r'Nişte\s+'),
# German
'deu': (r'Der\s+', r'Die\s+', r'Das\s+', r'Den\s+', r'Ein\s+',
r'Eine\s+', r'Einen\s+', r'Dem\s+', r'Des\s+', r'Einem\s+',
r'Eines\s+'),
# Dutch
'nld': (r'De\s+', r'Het\s+', r'Een\s+', r"'n\s+", r"'s\s+", r'Ene\s+',
r'Ener\s+', r'Enes\s+', r'Den\s+', r'Der\s+', r'Des\s+',
r"'t\s+"),
# Swedish
'swe': (r'En\s+', r'Ett\s+', r'Det\s+', r'Den\s+', r'De\s+'),
# Turkish
'tur': (r'Bir\s+',),
# Afrikaans
'afr': (r"'n\s+", r'Die\s+'),
# Greek
'ell': (r'O\s+', r'I\s+', r'To\s+', r'Ta\s+', r'Tus\s+', r'Tis\s+',
r"'Enas\s+", r"'Mia\s+", r"'Ena\s+", r"'Enan\s+"),
# Hungarian
'hun': (r'A\s+', r'Az\s+', r'Egy\s+'),
}
default_language_for_title_sort = None
title_sort_articles = r'^(A|The|An)\s+'
#: Specify a folder calibre should connect to at startup
# Specify a folder that calibre should connect to at startup using
# connect_to_folder. This must be a full path to the folder. If the folder does
# not exist when calibre starts, it is ignored.
# Example for Windows:
# auto_connect_to_folder = 'C:/Users/someone/Desktop/testlib'
# Example for other operating systems:
# auto_connect_to_folder = '/home/dropbox/My Dropbox/someone/library'
auto_connect_to_folder = ''
#: Specify renaming rules for SONY collections
# Specify renaming rules for SONY collections. This tweak is only applicable if
# metadata management is set to automatic. Collections on SONYs are named
# depending upon whether the field is standard or custom. A collection derived
# from a standard field is named for the value in that field.
#
# For example, if the standard 'series' column contains the value 'Darkover', then the
# collection name is 'Darkover'. A collection derived from a custom field will
# have the name of the field added to the value. For example, if a custom series
# column named 'My Series' contains the name 'Darkover', then the collection
# will by default be named 'Darkover (My Series)'. For purposes of this
# documentation, 'Darkover' is called the value and 'My Series' is called the
# category. If two books have fields that generate the same collection name,
# then both books will be in that collection.
#
# This set of tweaks lets you specify for a standard or custom field how
# the collections are to be named. You can use it to add a description to a
# standard field, for example 'Foo (Tag)' instead of the 'Foo'. You can also use
# it to force multiple fields to end up in the same collection.
#
# For example, you could force the values in 'series', '#my_series_1', and
# '#my_series_2' to appear in collections named 'some_value (Series)', thereby
# merging all of the fields into one set of collections.
#
# There are two related tweaks. The first determines the category name to use
# for a metadata field. The second is a template, used to determines how the
# value and category are combined to create the collection name.
# The syntax of the first tweak, sony_collection_renaming_rules, is:
# {'field_lookup_name':'category_name_to_use', 'lookup_name':'name', ...}
#
# The second tweak, sony_collection_name_template, is a template. It uses the
# same template language as plugboards and save templates. This tweak controls
# how the value and category are combined together to make the collection name.
# The only two fields available are {category} and {value}. The {value} field is
# never empty. The {category} field can be empty. The default is to put the
# value first, then the category enclosed in parentheses, it isn't empty:
# '{value} {category:|(|)}'
#
# Examples: The first three examples assume that the second tweak
# has not been changed.
#
# 1) I want three series columns to be merged into one set of collections. The
# column lookup names are 'series', '#series_1' and '#series_2'. I want nothing
# in the parenthesis. The value to use in the tweak value would be:
# sony_collection_renaming_rules={'series':'', '#series_1':'', '#series_2':''}
#
# 2) I want the word '(Series)' to appear on collections made from series, and
# the word '(Tag)' to appear on collections made from tags. Use:
# sony_collection_renaming_rules={'series':'Series', 'tags':'Tag'}
#
# 3) I want 'series' and '#myseries' to be merged, and for the collection name
# to have '(Series)' appended. The renaming rule is:
# sony_collection_renaming_rules={'series':'Series', '#myseries':'Series'}
#
# 4) Same as example 2, but instead of having the category name in parentheses
# and appended to the value, I want it prepended and separated by a colon, such
# as in Series: Darkover. I must change the template used to format the category name
#
# The resulting two tweaks are:
# sony_collection_renaming_rules={'series':'Series', 'tags':'Tag'}
# sony_collection_name_template='{category:||: }{value}'
sony_collection_renaming_rules = {}
sony_collection_name_template = '{value}{category:| (|)}'
#: Specify how SONY collections are sorted
# Specify how SONY collections are sorted. This tweak is only applicable if
# metadata management is set to automatic. You can indicate which metadata is to
# be used to sort on a collection-by-collection basis. The format of the tweak
# is a list of metadata fields from which collections are made, followed by the
# name of the metadata field containing the sort value.
# Example: The following indicates that collections built from pubdate and tags
# are to be sorted by the value in the custom column '#mydate', that collections
# built from 'series' are to be sorted by 'series_index', and that all other
# collections are to be sorted by title. If a collection metadata field is not
# named, then if it is a series- based collection it is sorted by series order,
# otherwise it is sorted by title order.
# [(['pubdate', 'tags'],'#mydate'), (['series'],'series_index'), (['*'], 'title')]
# Note that the bracketing and parentheses are required. The syntax is
# [ ( [list of fields], sort field ) , ( [ list of fields ] , sort field ) ]
# Default: empty (no rules), so no collection attributes are named.
sony_collection_sorting_rules = []
#: Control how tags are applied when copying books to another library
# Set this to True to ensure that tags in 'Tags to add when adding
# a book' are added when copying books to another library
add_new_book_tags_when_importing_books = False
#: Set the maximum number of sort 'levels'
# Set the maximum number of sort 'levels' that calibre will use to resort the
# library after certain operations such as searches or device insertion. Each
# sort level adds a performance penalty. If the database is large (thousands of
# books) the penalty might be noticeable. If you are not concerned about multi-
# level sorts, and if you are seeing a slowdown, reduce the value of this tweak.
maximum_resort_levels = 5
#: Choose whether dates are sorted using visible fields
# Date values contain both a date and a time. When sorted, all the fields are
# used, regardless of what is displayed. Set this tweak to True to use only
# the fields that are being displayed.
sort_dates_using_visible_fields = False
#: Fuzz value for trimming covers
# The value used for the fuzz distance when trimming a cover.
# Colors within this distance are considered equal.
# The distance is in absolute intensity units.
cover_trim_fuzz_value = 10
#: Control behavior of the book list
# You can control the behavior of double clicks and pressing Enter on the books
# list. Choices: open_viewer, do_nothing, show_book_details,
# show_locked_book_details, edit_cell, edit_metadata. Selecting anything other
# than open_viewer, show_book_details, or show_locked_book_details has the side
# effect of disabling editing a field using a single click.
# Default: open_viewer.
# Example: doubleclick_on_library_view = 'do_nothing'
# You can also control whether the book list scrolls per item or
# per pixel. Default is per item.
doubleclick_on_library_view = 'open_viewer'
enter_key_behavior = 'do_nothing'
horizontal_scrolling_per_column = False
vertical_scrolling_per_row = False
#: Language to use when sorting
# Setting this tweak will force sorting to use the
# collating order for the specified language. This might be useful if you run
# calibre in English but want sorting to work in the language where you live.
# Set the tweak to the desired ISO 639-1 language code, in lower case.
# You can find the list of supported locales at
# https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
# Default: locale_for_sorting = '' -- use the language calibre displays in
# Example: locale_for_sorting = 'fr' -- sort using French rules.
# Example: locale_for_sorting = 'nb' -- sort using Norwegian rules.
locale_for_sorting = ''
#: The number of seconds to wait before sending emails
# The number of seconds to wait before sending emails when using a
# public email server like GMX/Hotmail/Gmail. Default is: 5 minutes
# Setting it to lower may cause the server's SPAM controls to kick in,
# making email sending fail. Changes will take effect only after a restart of
# calibre. You can also change the list of hosts that calibre considers
# to be public relays here. Any relay host ending with one of the suffixes
# in the list below will be considered a public email server.
public_smtp_relay_delay = 301
public_smtp_relay_host_suffixes = ['gmail.com', 'live.com', 'gmx.com', 'outlook.com']
#: The maximum width and height for covers saved in the calibre library
# All covers in the calibre library will be resized, preserving aspect ratio,
# to fit within this size. This is to prevent slowdowns caused by extremely
# large covers
maximum_cover_size = (1650, 2200)
#: Where to send downloaded news
# When automatically sending downloaded news to a connected device, calibre
# will by default send it to the main memory. By changing this tweak, you can
# control where it is sent. Valid values are "main", "carda", "cardb". Note
# that if there isn't enough free space available on the location you choose,
# the files will be sent to the location with the most free space.
send_news_to_device_location = 'main'
#: Unified toolbar on macOS
# If you enable this option and restart calibre, the toolbar will be 'unified'
# with the titlebar as is normal for macOS applications. However, doing this has
# various bugs, for instance the minimum width of the toolbar becomes twice
# what it should be and it causes other random bugs on some systems, so turn it
# on at your own risk!
unified_title_toolbar_on_osx = False
#: Save original file when converting/polishing from same format to same format
# When calibre does a conversion from the same format to the same format, for
# example, from EPUB to EPUB, the original file is saved, so that in case the
# conversion is poor, you can tweak the settings and run it again. By setting
# this to False you can prevent calibre from saving the original file.
# Similarly, by setting save_original_format_when_polishing to False you can
# prevent calibre from saving the original file when polishing.
save_original_format = True
save_original_format_when_polishing = True
#: Number of recently viewed books to show
# Right-clicking the "View" button shows a list of recently viewed books. Control
# how many should be shown, here.
gui_view_history_size = 15
#: Change the font size of the Book details panel in the interface
# Change the font size at which book details are rendered in the side panel and
# comments are rendered in the metadata edit dialog. Set it to a positive or
# negative number to increase or decrease the font size. Similarly, change the
# font size of the widget used to converse with AI.
change_book_details_font_size_by = 0
change_ai_chat_font_size_by = 0
#: What format to default to when using the "Unpack book" feature
# The "Unpack book" feature of calibre allows direct editing of a book format.
# If multiple formats are available, calibre will offer you a choice
# of formats, defaulting to your preferred output format if it is available.
# Set this tweak to a specific value of 'EPUB' or 'AZW3' to always default
# to that format rather than your output format preference.
# Set to a value of 'remember' to use whichever format you chose last time you
# used the "Unpack book" feature.
# Examples:
# default_tweak_format = None (Use output format)
# default_tweak_format = 'EPUB'
# default_tweak_format = 'remember'
default_tweak_format = None
#: Do not preselect a completion when editing authors/tags/series/etc.
# This means that you can make changes and press Enter and your changes will
# not be overwritten by a matching completion. However, if you wish to use the
# completions you will now have to press Tab to select one before pressing
# Enter. Which technique you prefer will depend on the state of metadata in
# your library and your personal editing style.
#
# If preselect_first_completion is False and you want Tab to accept what you
# typed instead of the first completion then set tab_accepts_uncompleted_text
# to True. If you do this then to select from the completions you must press
# the Down or Up arrow keys. The tweak tab_accepts_uncompleted_text is ignored
# if preselect_first_completion is True
preselect_first_completion = False
tab_accepts_uncompleted_text = False
#: Completion mode when editing authors/tags/series/etc.
# By default, when completing items, calibre will show you all the candidates
# that start with the text you have already typed. You can instead have it show
# all candidates that contain the text you have already typed. To do this, set
# completion_mode to 'contains'. For example, if you type asi it will match both
# Asimov and Quasimodo, whereas the default behavior would match only Asimov.
# There is also a 'word-prefix' mode that matches only at the start of words,
# so typing 'asi' will match Asimov and "Isaac Asimov" but not Quasimodo.
# Similarly, typing 'cat' will match cathedral and "tabby cat" but not education.
#
# If completion_mode is 'word-prefix', you can specify additional word break chars
# with the extra_word_break_chars setting.
# For example, for extra_word_break_chars = '-' typing 'fic' will match
# both "Science Fiction" and "Science-Fiction", instead of only the first one.
completion_mode = 'prefix'
extra_word_break_chars = ''
#: Sort the list of libraries alphabetically
# The list of libraries in the Copy to library and Quick switch menus are
# normally sorted by most used. However, if there are more than a certain
# number of such libraries, the sorting becomes alphabetic. You can set that
# number here. The default is ten libraries.
many_libraries = 10
#: Choose available output formats for conversion
# Restrict the list of available output formats in the conversion dialogs.
# For example, if you only want to convert to EPUB and AZW3, change this to
# restrict_output_formats = ['EPUB', 'AZW3']. The default value of None causes
# all available output formats to be present.
restrict_output_formats = None
#: Set the thumbnail image quality used by the Content server
# The quality of a thumbnail is largely controlled by the compression quality
# used when creating it. Set this to a larger number to improve the quality.
# Note that the thumbnails get much larger with larger compression quality
# numbers.
# The value can be between 50 and 99
content_server_thumbnail_compression_quality = 75
#: Image file types to treat as e-books when dropping onto the "Book details" panel
# Normally, if you drop any image file in a format known to calibre onto the
# "Book details" panel, it will be used to set the cover. If you want to store
# some image types as e-books instead, you can set this tweak.
# Examples:
# cover_drop_exclude = {'tiff', 'webp'}
cover_drop_exclude = ()
#: Exclude fields when copy/pasting metadata
# You can ask calibre to not paste some metadata fields when using the
# Edit metadata->Copy metadata/Paste metadata actions. For example,
# exclude_fields_on_paste = ['cover', 'timestamp', '#mycolumn']
# to prevent pasting of the cover, Date and custom column, mycolumn.
# You can also add a shortcut in Preferences->Shortcuts->Edit metadata
# to paste metadata ignoring this tweak.
exclude_fields_on_paste = []
#: Skip internet connected check
# Skip checking whether the internet is available before downloading news.
# Useful if for some reason your operating systems network checking
# facilities are not reliable (for example NetworkManager on Linux).
skip_network_check = False
#: Tab stop width in the template editor
# Sets the width of the tab stop in the template editor in "average characters".
# For example, a value of 1 results in a space with the width of one average character.
template_editor_tab_stop_width = 4
#: Value for undefined numbers when sorting
# Sets the value to use for undefined numbers when sorting.
# For example, the value -10 sorts undefined numbers as if they were set to -10.
# Use 'maximum' for the largest possible number. Use 'minimum' for the smallest
# possible number. Quotes are optional if entering a number.
# Examples:
# value_for_undefined_numbers_when_sorting = -100
# value_for_undefined_numbers_when_sorting = '2'
# value_for_undefined_numbers_when_sorting = -0.01
# value_for_undefined_numbers_when_sorting = 'minimum'
# value_for_undefined_numbers_when_sorting = 'maximum'
value_for_undefined_numbers_when_sorting = 0
#: Allow template database functions in composite columns
# If True then the template database functions book_values() and book_count()
# can be used in composite custom columns. Note: setting this tweak to True and
# using these functions in composites can be very slow.
# Default: False
allow_template_database_functions_in_composites = False
#: Change the programs that are run when opening files/URLs
# By default, calibre passes URLs to the operating system to open using
# whatever default programs are configured there. Here you can override
# that by specifying the program to use, per URL type. For local files,
# the type is "file" and for web links it is "http*". For example:
# openers_by_scheme = { "http*": "firefox %u" } will make calibre run Firefox
# for https://whatever URLs. %u is replaced by the URL to be opened. The scheme
# takes a glob pattern allowing a single entry to match multiple URL types.
openers_by_scheme = {}
#: Set the first day of the week for calendar popups
# It must be one of the values Default, Sunday, Monday, Tuesday, Wednesday,
# Thursday, Friday, or Saturday, all in English, spelled exactly as shown.
calendar_start_day_of_week = 'Default'
#: East Asian language to use for transliteration
# Setting this tweak will make calibre use the specified language as the "base"
# language when transliterating East Asian languages to English. This might be
# useful if you run calibre in English but want text transliterated to
# Japanese instead of Chinese. The valid values are:
# 'ja' for Japanese
# 'kr' for Korean
# 'vn' for Vietnamese
# 'zh' for Chinese
# Any other value will use the language set in calibre preferences as the base
# language. A base language other than those in the above list causes transliteration
# with a base language of Chinese.
# Example: east_asian_base_language = 'ja'
east_asian_base_language = ''
#: Hide AI features
# Hide AI features throughout the calibre user interface. Note that AI is
# already opt-in and no AI related code is even loaded until the user configures some
# AI backend. This tweak exists simply to hide a few menu entries and the like
# that mention AI.
hide_ai_features = False
#: Control GPU usage in Qt WebEngine
# Qt WebEngine is the library that is used to render content in the calibre
# viewer and editor. It can optionally use the GPU for enhanced performance,
# however, this can cause crashes/black screens on some older systems, so it
# is disabled by default. In normal usage, the performance difference is not
# noticeable anyway.
qt_webengine_uses_gpu = False
아이콘, 템플릿 등 재정의¶
참고
캘리버는 아이콘 테마를 직접 지원하며, 여러 아이콘 테마가 캘리버에 사용 가능합니다. :guilabel:`환경설정->인터페이스->모양 및 느낌->아이콘 테마 변경`으로 이동하여 사용할 수 있습니다. 개별 아이콘을 재정의하는 것보다 아이콘 테마를 사용하는 것이 바람직합니다.
캘리버는 아이콘, JavaScript, 메타데이터 재킷용 템플릿, 카탈로그 등의 정적 리소스를 원하는 사용자 정의 버전으로 재정의할 수 있습니다. 모든 정적 리소스는 캘리버 설치 위치의 resources 하위 폴더에 저장됩니다. Windows에서는 보통 C:\Program Files\Calibre2\app\resources`입니다. macOS에서는 :file:/Applications/calibre.app/Contents/Resources/resources/입니다. Linux에서 캘리버 웹사이트의 바이너리 설치 프로그램을 사용하는 경우 :file:/opt/calibre/resources`입니다. 이 경로는 캘리버를 설치하는 위치에 따라 달라질 수 있습니다.
이 resources 폴더의 파일을 변경하면 캘리버를 다음에 업데이트할 때 변경 사항이 덮어쓰여지므로 변경하지 않아야 합니다. 대신 :guilabel:`환경설정->고급->기타`로 이동하여 :guilabel:`캘리버 구성 폴더 열기`를 클릭하세요. 이 구성 폴더에 resources라는 하위 폴더를 만들고 재정의하려는 파일을 넣으세요. 파일을 적절한 하위 폴더에 배치하세요. 예를 들어 이미지는 :file:`resources/images`에 넣으세요. 캘리버는 다음에 시작할 때 내장 파일 대신 사용자 정의 파일을 자동으로 사용합니다.
예를 들어 책 제거 동작의 아이콘을 변경하려면 먼저 내장 resources 폴더에서 관련 파일이 :file:`resources/images/remove_books.png`임을 확인하세요. :file:`my_remove_books.png`라는 대체 아이콘이 PNG 형식으로 있으면 구성 폴더에 :file:`resources/images/remove_books.png`로 저장하세요. 캘리버 사용자 인터페이스에서 사용하는 모든 아이콘은 :file:`resources/images`와 그 하위 폴더에 있습니다. 여기에 재정의 파일을 배치하면 사용자 정의 아이콘 테마보다 더 높은 우선순위를 갖습니다.
캘리버용 사용자 정의 아이콘 테마 만들기¶
아름다운 아이콘 세트를 만들었고 캘리버의 내장 아이콘 테마 지원을 통해 다른 캘리버 사용자와 공유하고 싶다면 아이콘을 테마로 쉽게 패키징할 수 있습니다. 그렇게 하려면 환경설정 → 기타 → 아이콘 테마 만들기`로 이동하여 아이콘을 넣은 폴더를 선택하세요. 그런 다음 테마 메타데이터를 입력하고 확인을 클릭하세요. 이렇게 하면 테마 아이콘이 포함된 ZIP 파일이 생성됩니다. 이를 `Mobileread <https://www.mobileread.com/forums/forumdisplay.php?f=166>`__의 캘리버 포럼에 업로드하면 캘리버의 내장 아이콘 테마 시스템을 통해 테마를 사용할 수 있습니다. 기본적으로 방금 만든 아이콘 테마는 캘리버의 현재 테마로도 설치됩니다. 테마를 테스트하는 경우 테마의 아이콘이 사용되도록 :file:`resources/images 폴더에서 이미지를 제거하는 것을 잊지 마세요.
캘리버 6부터는 라이트 모드와 다크 모드에 대한 사용자 정의 아이콘을 가질 수 있습니다. 아이콘의 두 버전을 만들고 파일 이름에 -for-dark-theme``와 ``-for-light-theme 접미사를 붙이면 됩니다. 예를 들어 modified-for-dark-theme.png``와 ``modified-for-light-theme.png. 그러면 캘리버는 현재 테마에 따라 적절한 아이콘을 자동으로 사용합니다.
플러그인으로 캘리버 사용자 정의¶
캘리버는 매우 모듈화된 설계를 가지고 있습니다. 캘리버의 거의 모든 기능이 플러그인 형태로 제공됩니다. 플러그인은 변환, 뉴스 다운로드(이것은 레시피라고 합니다), 사용자 인터페이스의 다양한 구성 요소, 다양한 장치 연결, 캘리버에 파일 추가 시 파일 처리 등에 사용됩니다. :guilabel:`환경설정->고급->플러그인`으로 이동하여 캘리버의 모든 내장 플러그인의 전체 목록을 볼 수 있습니다.
캘리버의 동작을 사용자 정의하고 확장하기 위해 자신만의 플러그인을 작성할 수 있습니다. 캘리버의 플러그인 아키텍처는 매우 간단합니다. 직접 플러그인을 작성하여 calibre 기능 확장하기 튜토리얼을 참조하세요.
플러그인을 작성하고 나면 `Mobileread <https://www.mobileread.com/forums/forumdisplay.php?f=237>`__의 캘리버 플러그인 포럼에 업로드할 수 있으며 캘리버의 내장된 플러그인 업데이터를 통해 사용할 수 있습니다.
