Quote:
Originally Posted by odamizu
I'm guessing I'm missing something obvious, so forgive the stupid question, but is there a way to convert <h2> to <h1>?
When I go to the Tags dropdown menu, there is no <h2> (or <h1>) option. I tried adding it using Customize Plugin, but couldn't find a place to do so.
Thank you!
|
You can't add new tags to be manipulated though the plugin's UI or json prefs file. You can only manipulate the items that existing tags can be changed
to via Customize Plugin.
I've already included more tags than I really deem worthwhile to this plugin. The original intent was to be able to change tags/attributes that would be difficult to do with standard Sigil tools or fairly simple S&R (or Sigil clips). Primarily nested tags like spans and divs.
For instance, if I wanted to change all h1 tags to h2 tags I'd use something like:
And replace it with:
Having said all that, I did however make it pretty easy to modify the plugin's code to add more tags by default (I'm not a glutton for punishment and people were asking for tags to be added left and right

) You'd have to modify the plugin.py file just a bit (and realize that you'd need to do it again if you ever updated the plugin in the future).
Near the beginning of plugin.py you'd just need to add 'h1' to the 'taglist' list, and then you'd need to add an 'h1_changes' entry to the 'combobox_defaults' dictionary right below that. Something like:
Code:
'h1_changes' : ['h2'],
should suffice. You could then use the gui to customize it with any other tags you might want to change h1s to.
Hope that helps! I'll consider adding h tags to the plugin in a future release, but it really is pretty trivial to make such changes without the plugin. Better yet, I should find a way to make it possible for users to add their own tags in a way that would survive future plugin updates. No promises, though.