Fossil Forum

Is there a way to save and have Fossil use a preferred markup style?
Login

Is there a way to save and have Fossil use a preferred markup style?

Is there a way to save and have Fossil use a preferred markup style?

(1) By Mike Beard (legacy_code) on 2021-05-07 19:21:45 [source]

hi all!

I looked for this, but probably didn’t use the correct terms and couldn’t find anything or WAY too much.

I was wondering if there was a way to save my preference for Markdown style on any page I create in Fossil. Currently, if I edit a new link or clicking on a yet non-existent wiki link, it brings up the editor but it has the default as “Fossil Wiki”, which I usually forget to switch and then wonder why my pages don’t render correctly when I preview them.

It’s not a huge deal, just an annoyance for me, but if there was a setting that I could change, that would be awesome. If not, I’ll deal with it! I’m currently using version 2.15.

Thanks!

Mike

(2) By Stephan Beal (stephan) on 2021-05-08 02:19:53 in reply to 1 [link] [source]

I was wondering if there was a way to save my preference for Markdown style on any page I create in Fossil. Currently, if I edit a new link or clicking on a yet non-existent wiki link, it brings up the editor but it has the default as “Fossil Wiki”, which I usually forget to switch and then wonder why my pages don’t render correctly when I preview them.

There is not currently one, but there probably/possibly should be one. Ostensibly we could simply default to whichever format appears more often in the wiki, but actually calculating that information is horribly expensive - it's not readily available in queryable form and requires reading every wiki page to figure it out.

That it defaults to fossil wiki is largely historical: that was our only wiki format for the first 3 or 4 years or so.

If there are no objections (specifically from Richard), i'll switch the default in the wiki editor and (if appropriate) ticket comment editor to markdown, which has long since become the more widely preferred option.

(3) By sean (jungleboogie) on 2021-05-08 02:43:27 in reply to 2 [link] [source]

Could the markup style preference be saved to a cookie? We do that for skins and timeline preferences.

Andy may prefer that, since he likes the plaintext mode in the forum.

(4) By Stephan Beal (stephan) on 2021-05-08 02:52:08 in reply to 3 [link] [source]

Could the markup style preference be saved to a cookie? We do that for skins and timeline preferences.

It "could", but i suspect that would just cause more confusion because cookies don't carry over to different machines and are destroyed if you log out or if your login expires. Thus the editor would "sometimes" keep that setting and "sometimes" revert to another setting, possibly leading to more frustration than simply always having to switch it. Muscle memory is a powerful and useful thing, and the setting changing from time to time as the cookie expires would break muscle memory.

That said: i'm not entirely against the idea of storing it in the cookie prefs, then applying it in all of the editors where it makes sense, but cookies are slightly fragile.

(5) By sean (jungleboogie) on 2021-05-08 03:19:20 in reply to 4 [link] [source]

but cookies are slightly fragile.

Yep, that’s understood. Like most things, there are trade offs.

(6) By Warren Young (wyoung) on 2021-05-08 03:21:32 in reply to 4 [link] [source]

When this came up with the ticket editor back in November of 2019, drh just changed the default to Markdown.

Yes, it's a hard-coded solution, but does it not express a more likely default?

(7) By Stephan Beal (stephan) on 2021-05-08 04:25:32 in reply to 6 [link] [source]

When this came up with the ticket editor back in November of 2019, drh just changed the default to Markdown.

Doh, i didn't realize the ticket editor was already set to that default. Then i'll do the same for the wiki editor.

@OP: look for this in the trunk in a short while.

(8) By Mike Beard (legacy_code) on 2021-05-17 13:51:41 in reply to 7 [link] [source]

Thanks Stephan! Didn’t realize I hadn’t replied to this.

Much appreciated!