![]() |
#31 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,686
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
The following edit plugin code, which requires Sigil 0.9 (and higher) and the bundled interpreter, should work. Spoiler:
Last edited by Doitsu; 02-04-2016 at 05:46 AM. |
|
![]() |
![]() |
![]() |
#32 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,365
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
![]() I'll take it under advisement, but you have to admit it's a pretty nitpicky request. Unnecessary is in the eye of the beholder. The whole feature is "unnecessary" when you get right down to it. |
|
![]() |
![]() |
Advert | |
|
![]() |
#33 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
I agree the name is a bit nitpicky.
![]() But I don't know that the feature is "unnecessary". It would be a very nice-to-have thing for running a PortableApp. Easy to turn into a batch/bash script, and also an improvement on the PortableApps.com method which currently copies the config dir to/from AppData. |
![]() |
![]() |
![]() |
#34 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,365
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
My main motivation was for easily testing/debugging multiple configs (and for consolidating all the calls to QStandardPaths::WritableLocation so switching/migrating to the recommended AppDataLocation will be easier some time down the road). If others find it useful, so be it.
![]() I'll consider changing it to SIGIL_PREFS_DIR dir before release. That will aesthetically match the "Open Preferences Location" button in the Preferences widget. I don't want to be the guy who can't take constructive criticism, afterall. ![]() Last edited by DiapDealer; 12-04-2015 at 10:58 AM. |
![]() |
![]() |
![]() |
#35 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Thanks for considering. I can't ask for more than that.
![]() And yes, it's got several uses. |
![]() |
![]() |
Advert | |
|
![]() |
#36 | |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,488
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Hi rubeus,
FYI, there are quite a few parsers available to you in a plugin. QuickParser, lxml, sigil_bs4 with html5lib, sigil_bs4 with lxml, sigil_bs4 with gumbo, etc. So simply have it walk all xhtml docs and parse them and get the image tag, and add the right attributes if needed, serialize it and continue. Parsing with QuickParser is quite easy and using sigil_bs4 (html5lib, gumbo, lxml) to do the modifications and then serialize is easy too. There really is no reason to do any of that manually when this is perfect for a plugin. KevinH Quote:
ps. I see Doitsu has already beaten me to the punch with his solution. If you decide to use BS4, I would recommend the serialize_xhtml call in sigil_bs4 over the prettyprint_xhtml call since the serialize call will make fewer changes to the source code (ie. is less likely to introduce errors from incorrect pretty-printing). Last edited by KevinH; 12-04-2015 at 01:25 PM. |
|
![]() |
![]() |
![]() |
#37 |
Banned
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 272
Karma: 1224588
Join Date: Sep 2014
Device: Sony PRS 650
|
Thanks guys, but first of all i need a new keyboard
![]() I will dig in bs4 as it looks easier to modify an existing max-width so a rerun after a picture has been scaled down doesnt add a second inline style. Need to read the documentation first. Still i'm a beginner in python and a novice in beautifulsoup. With lxml i'm always struggling with the namespace ![]() |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Sigil-0.8.900 released for testing - Wait for Sigil-0.8.901 | KevinH | Sigil | 106 | 10-04-2015 10:41 AM |
Sigil 0.8.5 Released | user_none | Sigil | 12 | 03-30-2015 11:28 AM |
Sigil 0.6.2 Released | user_none | Sigil | 89 | 05-04-2014 06:42 AM |
Sigil 0.5.3 Released | user_none | Sigil | 85 | 05-13-2012 05:29 AM |