1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-23 18:17:20 +00:00

Fix word wrapping in code blocks

* Fix word wrapping in code blocks

When you create a code block with the three back ticks any thing that
was wider then the pre block would be word wrapped. That causes code
snippets to look odd.

* Make code wrapping a theme tweek option
This commit is contained in:
Devin Weaver 2016-04-04 12:27:55 -04:00 committed by Jeremy Ruston
parent 811aa23010
commit de3adf905a
3 changed files with 4 additions and 3 deletions

View File

@ -44,6 +44,7 @@ You can tweak certain aspects of the ''Vanilla'' theme.
|[[Sidebar layout|$:/themes/tiddlywiki/vanilla/options/sidebarlayout]] |<$select tiddler="$:/themes/tiddlywiki/vanilla/options/sidebarlayout"><option value="fixed-fluid">Fixed story, fluid sidebar</option><option value="fluid-fixed">Fluid story, fixed sidebar</option></$select> | |[[Sidebar layout|$:/themes/tiddlywiki/vanilla/options/sidebarlayout]] |<$select tiddler="$:/themes/tiddlywiki/vanilla/options/sidebarlayout"><option value="fixed-fluid">Fixed story, fluid sidebar</option><option value="fluid-fixed">Fluid story, fixed sidebar</option></$select> |
|[[Sticky titles|$:/themes/tiddlywiki/vanilla/options/stickytitles]]<br>//Causes tiddler titles to "stick" to the top of the browser window. Caution: Does not work at all with Chrome, and causes some layout issues in Firefox// |<$select tiddler="$:/themes/tiddlywiki/vanilla/options/stickytitles"><option value="no">No</option><option value="yes">Yes</option></$select> | |[[Sticky titles|$:/themes/tiddlywiki/vanilla/options/stickytitles]]<br>//Causes tiddler titles to "stick" to the top of the browser window. Caution: Does not work at all with Chrome, and causes some layout issues in Firefox// |<$select tiddler="$:/themes/tiddlywiki/vanilla/options/stickytitles"><option value="no">No</option><option value="yes">Yes</option></$select> |
|[[Wrap long lines in code blocks|$:/themes/tiddlywiki/vanilla/options/codewrapping]] |<$select tiddler="$:/themes/tiddlywiki/vanilla/options/codewrapping"><option value="pre">No</option><option value="pre-wrap">Yes</option></$select> |
! Settings ! Settings

View File

@ -88,8 +88,7 @@ pre {
margin-bottom: 1em; margin-bottom: 1em;
word-break: normal; word-break: normal;
word-wrap: break-word; word-wrap: break-word;
white-space: pre; white-space: {{$:/themes/tiddlywiki/vanilla/options/codewrapping}};
white-space: pre-wrap;
background-color: <<colour pre-background>>; background-color: <<colour pre-background>>;
border: 1px solid <<colour pre-border>>; border: 1px solid <<colour pre-border>>;
padding: 0 3px 2px; padding: 0 3px 2px;
@ -101,7 +100,7 @@ code {
color: <<colour code-foreground>>; color: <<colour code-foreground>>;
background-color: <<colour code-background>>; background-color: <<colour code-background>>;
border: 1px solid <<colour code-border>>; border: 1px solid <<colour code-border>>;
white-space: pre-wrap; white-space: {{$:/themes/tiddlywiki/vanilla/options/codewrapping}};
padding: 0 3px 2px; padding: 0 3px 2px;
border-radius: 3px; border-radius: 3px;
font-family: {{$:/themes/tiddlywiki/vanilla/settings/codefontfamily}}; font-family: {{$:/themes/tiddlywiki/vanilla/settings/codefontfamily}};

View File

@ -2,3 +2,4 @@ title: $:/themes/tiddlywiki/vanilla/options/
stickytitles: no stickytitles: no
sidebarlayout: fixed-fluid sidebarlayout: fixed-fluid
codewrapping: pre-wrap