Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 11-02-2024, 04:49 PM   #10081
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 6,593
Karma: 4600391
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
Quote:
Originally Posted by TheOne320 View Post
I just got my new Kindle Colorsoft and now I am wondering how can I get FanFicFare to import stories with colours? Some RoyalRoad stories use colour in tables or just to highlight specific words. How can I setup FanFicFare to save these colours in the epub?
Depends on the story and how color is implemented.

Tag Styles

A lot of the time, it's style attributes on individual tags. By default, FFF removes style attributes from tags.

From defaults.ini:
Spoiler:
Code:
## Some attributes cause problems for EBook readers.  By default,
## FanFicFare will remove all attributes except the ones specified
## from all tags.  (The only exception is that <img> tags will also
## keep src, alt and longdesc attributes.  data-orighref is used by
## internalize_text_links to preserve links when chapters are
## inserted.)
## Example: To add 'style', 'title' and 'align' to the list to keep,
## in your personal.ini [defaults] put:
## add_to_keep_html_attrs:,style,title,align
keep_html_attrs:href,name,class,id,colspan,rowspan,data-orighref


You can keep style and align attrs for RR only, or all epubs like so:
Code:
[www.royalroad.com]
add_to_keep_html_attrs:,style
# use one or the other, not both
[epub]
add_to_keep_html_attrs:,style
Stylesheets

In some stories/sites, colors/styles are implemented in a separate CSS stylesheet tag or file and applied by tag/class/id.

There isn't a one-line solution for those. You'll need to identify the needed CSS and add it to personal.ini with add_to_output_css. Probably on a story-by-story basis; unless a site or author has a common CSS they use.

In either case, you'll have to do an overwrite always download to get these changes in stories you've already downloaded before.
JimmXinu is offline   Reply With Quote
Old 11-07-2024, 10:02 PM   #10082
XRoverMaelstromX
Junior Member
XRoverMaelstromX began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jun 2021
Device: MoonReader+ (Android App)
I am trying to change how FanFicFare phrases the status metadata piece when it puts it into tags. I used replace metadata and it came out very weird and I don't understand why.

My personal.ini has the following:

Code:
include_subject_tags: status, extratags

extratags: Type - Fanfiction
Previously, this resulted in the tags Completed or In-Progress being inserted into my tags column, depending on how the fic was marked on Ao3.

Today I added:

Code:
replace_metadata:
 status=>Completed=>Status - Completed
 status=>In-Progress=>Status - In-Progress
This resulted in the tags Status - Status - Completed or Status - Status - In-Progress being inserted into my tags column, depending on how the fic was marked as normal.

I don't understand where that extra "Status - " came from at all and I'm very lost on how to fix that.

Also, I realized this messes with the way my title page is generated, since the title page now has Status: Status - Completed or Status: Status - In-Progress, which makes sense for my use of replace_metadata but isn't ideal. Is there a way to change just the way the status metadata piece is phrased when it's put into the tags but not on the title page of the epub? I feel like there is and I'm just missing something, but I'm not sure.
XRoverMaelstromX is offline   Reply With Quote
Old 11-07-2024, 10:12 PM   #10083
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 9,568
Karma: 64960981
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
a bit tired to explain it coherently, but try using anchors to define the beginning and end of strings, e.g.

Code:
replace_metadata: 

 author=>^Anonymous$=>Unknown
 author=>^orphan_account$=>Unknown

Last edited by ownedbycats; 11-07-2024 at 10:15 PM.
ownedbycats is offline   Reply With Quote
Old 11-07-2024, 11:02 PM   #10084
XRoverMaelstromX
Junior Member
XRoverMaelstromX began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jun 2021
Device: MoonReader+ (Android App)
Welp, that worked for the duplication in the tag, thank you! Fun fact, I tested to see if the dash was the issue, and changing the replacement phrase to Status.Completed resulted in Status.Status.Completed, and I'm seriously curious as to why not having the anchors defining the beginning and ends of the string resulted in that kind of duplication!

Do you, or anyone, know how to make it do the replacement only for where it's dropping the status into the tags but not on the title page? I can live with it being slightly awkward on the title page, but I'd prefer it not to be.
XRoverMaelstromX is offline   Reply With Quote
Old 11-08-2024, 12:25 PM   #10085
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 6,593
Karma: 4600391
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
The duplication is an odd interaction between how FFF treats list vs scalar(single) metadata entries with regard to replace_metata and how the method to get subject tags explicitly calls for lists.

Using ^ and $ anchors just means the regex doesn't match the 'Status - ' version when it comes by again.

This is a bug. Hopefully I'll be able to come up with a proper fix.

Yes, it's possible to change only the tags version by making a copy of status to modify and include in subject tags. In fact, if you'd done that first, I don't think this bug would have been revealed.

Search for include_in_ and add_to_extra_valid_entries if you don't want to wait while I'm bug hunting.
JimmXinu is offline   Reply With Quote
Old 11-08-2024, 12:43 PM   #10086
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 6,593
Karma: 4600391
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
New Test Version Posted

2024-11-08
- Add subject_tags to -m/j CLI output
- Fix for double replace_metadata when non-list metadata called by getList().

Test version should address XRoverMaelstromX's duplication issue.

Quote:
Originally Posted by XRoverMaelstromX View Post
I am trying to change how FanFicFare phrases the status metadata piece when it puts it into tags. I used replace metadata and it came out very weird and I don't understand why.
I would further suggest:
Code:
# make a copy of status
add_to_extra_valid_entries:,headerstatus
include_in_headerstatus:status

# add 'Status - ' to all possible status values--some sites do have more
# but only on copy
replace_metadata:
 headerstatus=>^=>Status -\s

# use headerstatus in subject tags only.
include_subject_tags: headerstatus, extratags
JimmXinu is offline   Reply With Quote
Old Yesterday, 10:28 PM   #10087
MsFlutter
Member
MsFlutter began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Jul 2023
Device: Android 12 phone
Sorry if this is a common question, but do you have any plans to enable editing the calibre library from the command line? It's mentioned in the top post, but I wasn't sure if it was something you were working on, or if it's just been fully shelved until further notice.

I've been interested in making a script of some kind to make importing fics easier when I'm not at home. I could in theory download the fics and then import them, but I rely pretty heavily on Calibre's columns so I'd probably end up just having to update the metadata manually anyway.
MsFlutter is offline   Reply With Quote
Old Today, 10:17 AM   #10088
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 6,593
Karma: 4600391
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
Not really.

In theory, it's possible. But it would require re-implementing everything the plugin does using Calibre's CLI interface.

Plus the FFF plugin have several features that need to pop dialogs to the user and/or call other plugins.
JimmXinu is offline   Reply With Quote
Reply

Tags
fanfiction


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] KindleUnpack - The Plugin DiapDealer Plugins 495 10-19-2024 07:06 AM
[GUI Plugin] Open With kiwidude Plugins 403 04-01-2024 09:39 AM
[GUI Plugin] Marvin XD Philantrop Plugins 126 01-29-2017 01:48 PM
[GUI Plugin] KiNotes -axel- Plugins 0 07-14-2013 07:39 PM
[GUI Plugin] Plugin Updater **Deprecated** kiwidude Plugins 159 06-19-2011 01:27 PM


All times are GMT -4. The time now is 07:55 PM.


MobileRead.com is a privately owned, operated and funded community.