Codemirror theme In Tiddlywiki

132 views
Skip to first unread message

Mohammad

unread,
Dec 3, 2018, 11:03:01 AM12/3/18
to TiddlyWiki
Has anybody tried https://github.com/BurningTreeC/LightTableTheme for Tiddlywiki + CodeMirror?

My question is can we push codemirror editor to have a dark textarea like above?

-Mohammad

BurningTreeC

unread,
Dec 3, 2018, 11:19:43 AM12/3/18
to TiddlyWiki
@Mohammad, the codemirror plugin comes with a usage section that describes how to add codemirror themes. There's a link to a theme-library and a step-by-step how-to

Under ControlPanel - Settings - CodeMirror there's a link underneath "theme"

Mohammad

unread,
Dec 3, 2018, 11:27:20 AM12/3/18
to TiddlyWiki
Hi BTC,
 I followed the instruction and made a theme, still no dark color in my TW textarea (codemirror editor)!


To add a theme to your wiki, follow these four steps:

  • choose one of the CSS files and copy its content to a new tiddler
  • remove all comments from the top and tag the tiddler with $:/tags/Stylesheet
  • add a field "module-type" with the value "codemirror-theme". add a field "name" with the exact name of the theme as value
  • save the tiddler and go to the Settings tab in $:/ControlPanel - look for the "theme" dropdown to select your newly added theme


 

Do I need to do anything else?

-Mohammad


BurningTreeC

unread,
Dec 3, 2018, 12:21:23 PM12/3/18
to TiddlyWiki
Following these instructions it works
The rest is up to you to figure out where you made a mistake

Mohammad

unread,
Dec 3, 2018, 12:48:07 PM12/3/18
to TiddlyWiki
What is the exact name below? I use the tiddler name!
Message has been deleted

Mohammad

unread,
Dec 3, 2018, 1:36:36 PM12/3/18
to tiddl...@googlegroups.com
I found the answer
 
  • add a field "module-type" with the value "codemirror-theme". add a field "name" with the exact name of the theme as value
You need to use he correct name of theme it can be found in css file. See below the first line in cff  file

.cm-s-light-table.CodeMirror 

For this theme the EXACT name is : 
light-table


So for everybody likes to change the default theme of CodeMirror plugin:

a. follow this instruction:

To add a theme to your wiki, follow these four steps:

  • choose one of the CSS files and copy its content to a new tiddler
  • remove all comments from the top and tag the tiddler with $:/tags/Stylesheet
  • add a field "module-type" with the value "codemirror-theme". add a field "name" with the exact name of the theme as value
  • save the tiddler and go to the Settings tab in $:/ControlPanel - look for the "theme" dropdown to select your newly added theme


    To find the EXACT name of theme to be used in `name` field: Look at the content of css (theme) file and the name can be find in the css selector like .cm-s-light-table.CodeMirror
    Here the theme name is light-table.

    I attached a correct theme to be used by anybody interested.

    LightTable-Corrected.CSS.tid
    Reply all
    Reply to author
    Forward
    0 new messages