View Single Post
Old Yesterday, 10:48 PM   #129
elzzzz
Junior Member
elzzzz began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Sep 2025
Device: iPad/Kindle
Multi Pair priorities questions

Quote:
Originally Posted by culytera View Post
What kind of look do you want to achieve? I shared my config in this thread before though the ini is slightly outdated. The only significant change is the background color changing depending on the rating. And since I only use AO3 I don't know how well my config will work with other sites. Here's my ini:
Spoiler:

Code:
[defaults]
replace_xbr_with_hr:3
replace_hr:false
replace_br_with_p:false

slow_down_sleep_time:0.5

## http://docs.python.org/library/datetime.html#strftime-strptime-behavior
datePublished_format:%%B %%d, %%Y
dateUpdated_format:%%B %%d, %%Y

add_to_extra_valid_entries:,additional_characters,category_main,dateRange,icon_bookmarked,icon_subscribed,icons,prefix_category,prefix_rating,prefix_ships,prefix_status,prefix_wordcount

additional_characters_label:Characters
category_label:Fandom
dateRange_label:Date

include_in_additional_characters:characters
include_in_category_main:category
include_in_dateRange:datePublished,dateUpdated
include_in_icons:icon_bookmarked,icon_subscribed
include_in_prefix_category:category
include_in_prefix_rating:rating
include_in_prefix_ships:ships
include_in_prefix_status:status
include_in_prefix_wordcount:numWords

keep_in_order_category:true
keep_in_order_characters:true
keep_in_order_ships:true

## keep in order for extra entries
keep_in_order_additional_characters:true
keep_in_order_category_main:true
keep_in_order_dateRange:true
keep_in_order_icons:true
keep_in_order_prefix_category:true
keep_in_order_prefix_ships:true

exclude_metadata_pre:
 category=~(.*) - Fandom
 additional_characters==Other(s)
 additional_characters=~(Original|Various) Character\(?s?\)?
 freeformtags,genre==Other Additional Tags to Be Added
 warnings==Creator Chose Not To Use Archive Warnings
 warnings==No Archive Warnings Apply
## Remove ships that don't have a / or &
 ships,prefix_ships!~(.*)(\/| & )(.*)
## Removes platonic ships in ship lists
 ships,prefix_ships=~(.*) & (.*)
## Removes ships that are only implied or mentioned according to author
 prefix_ships=~^(.*)\(?(implied|mentioned)\)?

replace_metadata:
 rating=> Audiences=>
 rating=>Teen [Aa]nd Up=>Teen
## Change / to & if friendship is mentioned
 ships=>(.*)[/](.*) \(?[Ff]riendship(?: only)\)?=>\1 & \2
 category,prefix_category=>No Fandom=>Original Work
 category,prefix_category=> \(?(- All Media Types|- Fandom|Movies|Movie [0-9]+|Comics|TV|Video Games?)\)?$=>
 additional_characters=> - Character=>
 additional_characters=> ?\((cameo|briefly|if you squint|sort of)\)=>
 additional_characters=> \([Cc]haracter\)=>
 additional_characters=>\(mentions of\) =>
 category,ships= - Fandom$=>
 ships=> - Relationship=>
 ships=>^(.* - Relationship)$=>
 ships=>^(Eventual (.*)/(.*))$=>
## Get first item in list for prefixed tag
 prefix_category_LIST=>^(.*?)(\,.*)=>\1
 category_main_LIST=>^(.*?)(\,.*)=>\1
 prefix_ships_LIST=>^(.*?)(\,.*)=>\1
## Add prefix to tags
 prefix_ships=>^(.*)=>[p] \1
 prefix_category=>^(.*)=>[c] \1
 prefix_rating=>^(.*)=>[r] \1
 prefix_status=>^(.*)=>[s] \1
## Group word count
 prefix_wordcount=>^(\d+|([0-4],\d{3})*|5,000)$=>[w] 0 - 5000
 prefix_wordcount=>^((?!5,000)([5-9],\d{3})*|10,000)$=>[w] 5001 - 10000
 prefix_wordcount=>^((?!10,000)(1\d,\d{3})*|20,000)$=>[w] 10001 - 20000
 prefix_wordcount=>^((?!20,000)([2-3]\d,\d{3})*|40,000)$=>[w] 20001 - 40000
 prefix_wordcount=>^((?!40,000)([4-7]\d,\d{3})*|80,000)$=>[w] 40001 - 80000
 prefix_wordcount=>^((?!80,000)(([8-9]\d)|(\d{3,}))(,\d{3})+)$=>[w] 80000
### Get date range with published date and updated date
## diff dates     1pmonth    2pday        3pyear   4umonth    5uday        6uyear
 dateRange_LIST=>([^\s]+)\s+(\d{1,2})\,\s+(\d{4})\,\s([^\s]+)\s+(\d{1,2})\,\s+(\d{4})=>\1 \2, \3-\4 \5, \6
## same year      1          2            3        4          5
 dateRange_LIST=>([^\s]+)\s+(\d{1,2})\,\s+(\d{4})-([^\s]+)\s+(\d{1,2})\,\s+\3=>\1 \2-\4 \5, \3
## same month     1          2              3            4
 dateRange_LIST=>([^\s]+)\s+(\d{1,2})-\1\s+(\d{1,2})\,\s+(\d{4})=>\1 \2-\3, \4
## don't need regexp for date day, handled by de-dup.
### Bookmark and subscribed icons
 icon_bookmarked=>True=>Bookmarked
 icon_subscribed=>True=>Subscribed
 icon_bookmarked=>False=>Not Bookmarked
 icon_subscribed=>False=>Not Subscribed
## Show bookmarked icon, show subscribed icon
 icons_LIST=>^(Bookmarked\, Subscribed)$=>����
## Don't show bookmarked icon, don't show subscribed icon
 icons_LIST=>^(Not Bookmarked\, Not Subscribed)$=>◈
## Don't show bookmarked icon, show subscribed icon
 icons_LIST=>^(Not Bookmarked\, Subscribed)$=>��
## Show bookmarked icon, don't show subscribed icon
 icons_LIST=>^(Bookmarked\, Not Subscribed)$=>��
## CHANGE BACKGROUND COLOR ACCORDING TO RATING
 output_css=>fff_titlepage_color_replace=>264701&&rating==General
 output_css=>fff_titlepage_color_replace=>38419D&&rating==Teen
 output_css=>fff_titlepage_color_replace=>66347F&&rating==Mature
 output_css=>fff_titlepage_color_replace=>8F0101&&rating==Explicit
 output_css=>fff_titlepage_color_replace=>1B1B1B&&rating==Not Rated 
 output_css=>fff_titlepage_color_replace=>555555
## FILTER REDUNDANT FREEFORM TAGS
 freeformtags=>^(Angst and )(.*)=>Angst\,\2
 freeformtags=>^(Fluff and )(.*)=>Fluff\,\2
 freeformtags=>^(Smut and )(.*)=>Smut\,\2
 freeformtags=>(\w+ )(Fluff)$=>Fluff
 freeformtags=>(\w+ )(Smut)$=>Smut
 freeformtags=>(\w+ )(Angst)$=>Angst
 freeformtags=>(.*)(Hurt\/Comfort)$=>Hurt/Comfort
 freeformtags=>^(Alternate Universe)$=>
 freeformtags=>^(Alternate Universe -)=>AU -
 freeformtags=>^(Drama & Romance)$=>Drama\,Romance
 freeformtags=>^(Friendship)$=>
 freeformtags=>^(Friendship/Love)$=>
 freeformtags=>^(Male-Female Friendship)$=>
 freeformtags=>^(Platonic Female/Male Relationships)$=>
 freeformtags=>^(Platonic Relationships)$=>
 freeformtags=>^(Canon Divergent)$=>Canon Divergence


add_to_custom_columns_settings:
 additional_characters=>#additional_characters
 bookmarked=>#work_bookmarked
 subscribed=>#work_subscribed
 chapterslashtotal=>#chapters
 dateRange=>#date_range
 freeformtags=>#additional_tags

add_to_output_css:
 body {
  text-align: left;
  font-family: 'Noto Sans', sans-serif;
 }
 body.fff_titlepage {
  font-size: 2.5vmax;
  font-family: 'Roboto', sans-serif;
  background-color: #fff_titlepage_color_replace;
  color: white;
 }
 hr {
  display: block;
  border: 0; border-top: 1px solid;
  padding: 0;
 }
## https://stackoverflow.com/a/50191135
 .flex-parent {
  display: flex;
  align-items: center;
 }
 .flex-child-edge {
  flex-grow: 2;
  border-bottom: 1px solid;
 }
 .flex-child-text {
  flex-basis: auto;
  flex-grow: 0;
  text-align: center;
  margin: 0 5px 0 5px;
  font-family: 'Roboto', sans-serif;
 }
 .flex-child-text.stats span { font-weight: bold; }
 .flex-child-text.category { font-weight: bold; }
 .fff_titlepage .title h1 {
  font-family: 'Roboto', sans-serif;
  font-size: 3vmax;
  margin: 0;
 }
 .fff_titlepage .title h1 { font-weight: normal; }
 .fff_titlepage .title h1 a { font-weight: bold; } 
 .fff_titlepage .title a,
 .fff_titlepage .tags a,
 .fff_titlepage .tag-summary-content a {
   text-decoration: none;
   color: unset;
 }
 .fff_titlepage .tag-summary-content a {
  font-style: italic;
 }
 .fff_titlepage .tag-summary-content p {
  margin-top: 0;
 }
 .fff_titlepage .tags {
  display: block;
  padding: 0;
 }
 dl .inline dt:after { content:'\00a0'; }
 dl .inline dt { float: left; }
 .display-on-reader { display: none; }
 .fff_titlepage dt { font-family: 'Roboto Condensed'; }
 .fff_titlepage dd { margin-left: 0.75em; }
 .fff_titlepage dl, .fff_titlepage dt { margin: 0; }
## Change displayed content on titlepage depending on screen width
 @media only screen and (max-device-width: 480px),
 only screen and (min-device-width: 768px) and (max-device-width: 1024px) {
  body.fff_titlepage, .fff_titlepage dt {
   background_color: unset;
   color: unset;
   font-family: unset;
  }
  .display-on-cover { display: none; }
  .display-on-reader { display: block; }
  .flex-parent.display-on-reader { display: flex; }
 }

## first ship, first category, rating, status, word count - all prefixed in Calibre's tags
include_subject_tags:prefix_ships_LIST,prefix_category_LIST,prefix_rating,prefix_status,prefix_wordcount

titlepage_start:<?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
 <title>${title} by ${author}</title>
 <link href="stylesheet.css" type="text/css" charset="UTF-8" rel="stylesheet"/>
 <meta name="calibre-html-render-data"/>
 </head>
 <body class="fff_titlepage">
 <div class="title">
 <h1><a href="${storyUrl}">${title}</a> by ${authorHTML}</h1>
 </div>
  <div class="flex-parent display-on-reader">
   <div class="flex-child-edge"></div>
   <div class="flex-child-text">◈</div>
   <div class="flex-child-edge"></div>
 </div>
 <div class="flex-parent display-on-cover">
   <div class="flex-child-edge"></div>
   <div class="flex-child-text category">${category_main}</div>
   <div class="flex-child-edge"></div>
 </div>
 <dl class="tags">



## ${id}, ${label}, ${value}
titlepage_entry:
 <dt><b>${label}:</b></dt> <dd>${value}</dd>

## ${id}, ${label}, ${value}
## Used with entries listed in wide_titlepage_entries, typically description, storyUrl, authorUrl
titlepage_wide_entry:

## When using tables, make these span both columns.
wide_titlepage_entries:

## ${id}, ${value}
## For example, if you've set description_label:
## (that is, nothing)
titlepage_no_title_entry:${value}<br />

## metadata
titlepage_end:
 </dl>
 <div class="flex-parent display-on-cover">
   <div class="flex-child-edge"></div>
   <div class="flex-child-text stats"><span>${rating}</span> ${icons} ${numWords} ◈ ${chapterslashtotal}</div>
   <div class="flex-child-edge"></div>
 </div>
 <div class="flex-parent display-on-reader">
   <div class="flex-child-edge"></div>
   <div class="flex-child-text">${icons}</div>
   <div class="flex-child-edge"></div>
 </div>
 <div class="tag-summary-content">${description}</div>
 </body>
 </html>

 
[epub]
make_firstimage_cover:false
jpg_quality:100
convert_images_to:png
remove_transparency:false
no_image_processing:true

[archiveofourown.org]
is_adult:true
always_login:true

username:XXXXXXXX
password:XXXXXXXX

add_chapter_numbers:toconly
mark_new_chapters:latestonly
chapter_title_def_pattern:${title}
chapter_title_add_pattern:${title} (${date})
chapter_title_new_pattern:${title} (${date}) | NEW
chapter_title_addnew_pattern:${title} (${date}) | NEW

include_in_genre:
include_in_icon_bookmarked:bookmarked
include_in_icon_subscribed:subscribed

keep_in_order_ao3categories:true
keep_in_order_freeformtags:true

chapterslashtotal_label:Chapters
freeformtags_label:Tags
freefromtags_label:Tags
ao3categories_label:Category

extratags:

add_to_replace_metadata:
 authorUrl=>(/users/orphan_account)/pseuds/.*$=>\1

titlepage_entries:<div class="inline">,<div class="display-on-reader">,category,</div>,seriesHTML,warnings,ships,additional_characters,freeformtags,dateRange,<div class="display-on-reader">,rating,chapterslashtotal,numWords,</div>,</div>

## ${number}, ${index04}("%04d"%${number}), ${chapter}
chapter_start:<?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
 <title>${chapter}</title>
 <link href="stylesheet.css" type="text/css" charset="UTF-8" rel="stylesheet"/>
 <meta name="chapterurl" content="${url}"></meta>
 <meta name="chapterorigtitle" content="${origchapter}"></meta>
 <meta name="chaptertoctitle" content="${tocchapter}"></meta>
 <meta name="chaptertitle" content="${chapter}"></meta>
 </head>
 <body class="fff_chapter">
 <h3 class="fff_chapter_title">${origchapter}<hr><small>${date}</small></h3>


Preview:
Spoiler:
Hey, I am new to calibre and mobile read so if im doing a post wrong let me know, but i have been working on my library for a month and came across a lot of your helpful ini tricks so im in the process of adapting them. I love how you have the first ship category and was wondering if there was a way to set a priority of thr first ship. For example I have quite a lot of Hermione Granger/Draco Malfoy/Theodore Nott fanfics, but sometimes the author lists the individual pairs as well, like Draco Malfoy/Theodore Nott and that might come up first. Is there a way to to set something up so that I check for certain pairings in a priority order?

Thanks!
elzzzz is offline   Reply With Quote