Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Mylyn » WikiText background
WikiText background [message #62577] Wed, 03 December 2008 09:21 Go to next message
yaumunlam  is currently offline yaumunlam Friend
Messages: 33
Registered: July 2009
Member
Hi,

how to set background image or color for WikiText?

Thanks!

Yau.
Re: WikiText background [message #62625 is a reply to message #62577] Wed, 03 December 2008 21:46 Go to previous messageGo to next message
David Green is currently offline David GreenFriend
Messages: 136
Registered: July 2009
Senior Member
Yau wrote:
> how to set background image or color for WikiText?

Can you elaborate on your use case? Are you interested in the
background color/image of the WikiText markup editor, or markup rendered
to HTML in a Browser widget or MarkupViewer?
Re: WikiText background [message #62648 is a reply to message #62625] Thu, 04 December 2008 02:09 Go to previous messageGo to next message
yaumunlam  is currently offline yaumunlam Friend
Messages: 33
Registered: July 2009
Member
Browser widget or MarkupViewer is preferred.

"David Green" <dgreen99@gmail.com> wrote in message
news:gh6uqn$ol4$2@build.eclipse.org...
> Yau wrote:
> > how to set background image or color for WikiText?
>
> Can you elaborate on your use case? Are you interested in the
> background color/image of the WikiText markup editor, or markup rendered
> to HTML in a Browser widget or MarkupViewer?
Re: WikiText background [message #62669 is a reply to message #62648] Thu, 04 December 2008 02:34 Go to previous messageGo to next message
David Green is currently offline David GreenFriend
Messages: 136
Registered: July 2009
Senior Member
Yau wrote:
> Browser widget or MarkupViewer is preferred.

If you're using a browser widget you can apply a CSS stylesheet. If
doing this programatically, consult the HtmlDocumentBuilder javadoc. If
doing this with Ant tasks, consult the WikiText User Guide documentation.

If you're using the MarkupViewer you can set the background color using
the standard JFace and SWT APIs. I believe it's something like:

markupViewer.getTextWidget().setBackground(color)

Let me know if that doesn't work out for you.

David
Re: WikiText background [message #595162 is a reply to message #62577] Wed, 03 December 2008 21:46 Go to previous messageGo to next message
David Green is currently offline David GreenFriend
Messages: 96
Registered: July 2009
Member
Yau wrote:
> how to set background image or color for WikiText?

Can you elaborate on your use case? Are you interested in the
background color/image of the WikiText markup editor, or markup rendered
to HTML in a Browser widget or MarkupViewer?
Re: WikiText background [message #595166 is a reply to message #62625] Thu, 04 December 2008 02:09 Go to previous messageGo to next message
yaumunlam  is currently offline yaumunlam Friend
Messages: 33
Registered: July 2009
Member
Browser widget or MarkupViewer is preferred.

"David Green" <dgreen99@gmail.com> wrote in message
news:gh6uqn$ol4$2@build.eclipse.org...
> Yau wrote:
> > how to set background image or color for WikiText?
>
> Can you elaborate on your use case? Are you interested in the
> background color/image of the WikiText markup editor, or markup rendered
> to HTML in a Browser widget or MarkupViewer?
Re: WikiText background [message #595175 is a reply to message #62648] Thu, 04 December 2008 02:34 Go to previous messageGo to next message
David Green is currently offline David GreenFriend
Messages: 96
Registered: July 2009
Member
Yau wrote:
> Browser widget or MarkupViewer is preferred.

If you're using a browser widget you can apply a CSS stylesheet. If
doing this programatically, consult the HtmlDocumentBuilder javadoc. If
doing this with Ant tasks, consult the WikiText User Guide documentation.

If you're using the MarkupViewer you can set the background color using
the standard JFace and SWT APIs. I believe it's something like:

markupViewer.getTextWidget().setBackground(color)

Let me know if that doesn't work out for you.

David
Re: WikiText background [message #1843196 is a reply to message #62577] Mon, 19 July 2021 19:09 Go to previous message
Vincent Collet is currently offline Vincent ColletFriend
Messages: 1
Registered: July 2021
Junior Member
Hello,

If you need to setup dark theme color scheme for Markdown files, you should configure both the editor and the viewer with similar colors.

For the viewer
for markdown preview, "simply" edit the CSS resource :
/org/eclipse/mylyn/internal/wikitext/ui/viewer/default.css
inside the jar file of the Eclipse plugins
/home/<USER>/.p2/pool/plugins/org.eclipse.mylyn.wikitext.ui_X.Y.Z.DDDDDDDDDDDD.jar
and replace with the following content
(to customize) :

* {
	 font-family:  Arial, Helvetica, sans-serif;
	 background-color: #2f2f2e;
	 color: #adadad;
	 font-size: 12px;
}

h1 {
	font-size: 120%;
	font-weight: bold;
	color: #f2f2f2;
}

h2 {
	font-size: 110%;
	font-weight: bold;
	color: #f2f2f2;
}

h3 {
	font-size: 105%;
	font-weight: bold;
	color: #f2f2f2;
}

h4 {
	font-weight: bold;
	color: #f2f2f2;
}

h5 {
	font-size: 90%;
	font-weight: bold;
	color: #f2f2f2;
}

h6 {
	font-size: 80%;
	font-weight: bold;
	color: #f2f2f2;
}

b {
	font-weight: bold;
}

strong {
	font-weight: bold;
}

i {
	font-style: italic;
}

cite {
	font-style: italic;
	background-color: #bad0e6;
}

em {
	font-style: italic;
}

mark {
	background-color:yellow;
}

var {
	font-style: italic;
}

dfn {
	font-style: italic;
}

code {
	font-family: monospace;
	color:#ababff;
	background-color: #545454;
}

pre {
	font-family: monospace;
}

/* Java stack traces
pre.javaStackTrace {
	font-family: monospace;
}
*/

/* sections beginning with -- Error Details --
pre.eclipseErrorDetails {
	font-family: monospace;
}
*/
 
ins {
	text-decoration: underline;
}

del {
	text-decoration: line-through;
}

sup {
	font-size: smaller;
	vertical-align: super;
}

a {
	text-decoration: underline;
	color: blue;
}

sup a {
	text-decoration: none;
}

sub {
	font-size: smaller;
	vertical-align: sub;
}

dt {
	font-weight: bold;
}

blockquote {
	color: rgb(38, 86, 145);
}

tt {
	font-family: monospace;	
}

q {
	color: rgb(38, 86, 145);
}

h1.editorPreview, h2.editorPreview, h3.editorPreview, h4.editorPreview {
  padding-bottom: 0.3em;
  font-size: 1.75em;
  border-bottom: 1px solid #eee;
}

pre.editorPreview {
  padding: 16px;
  overflow: auto;
  line-height: 1.45;
  background-color: #545454;
  border-radius: 3px;
}
  
table.editorPreview {
  border-collapse: collapse;
  border-spacing: 0;
  border-color: grey;
}
  
tr.editorPreview td.editorPreview {
  border:1px solid #ddd;
  padding: 6px 13px;
}

tr.editorPreview th.editorPreview {
  border:1px solid #ddd;
  padding: 6px 13px;
  background-color: #545454;
}


For the editor
To stay aligned with your dark theme color patterns applied to the editor must aslo adapt the viewer colors.

Edit the file in your workspace metadata folder like below :
/home/<USER>/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.wikitext.ui.prefs

And replace with the following content :
block-bc=font-family\: monospace; color\: \#569cd6; background-color\: \#2f2f2e;
block-bq=color\: rgb(38,86,145); background-color\: \#2f2f2e;
block-dt=font-weight\: bold; background-color\: \#2f2f2e;
block-h1=font-size\: 120%; font-weight\: bold; color\: \#569cd6;  background-color\: \#2f2f2e;
block-h2=font-size\: 110%; font-weight\: bold; color\: \#569cd6;  background-color\: \#2f2f2e;
block-h3=font-size\: 105%; font-weight\: bold; color\: \#569cd6;  background-color\: \#2f2f2e;
block-h4=font-weight\: bold; color\: \#569cd6;  background-color\: \#2f2f2e;
block-h5=font-size\: 90%; font-weight\: bold; color\: \#569cd6;  background-color\: \#2f2f2e;
block-h6=font-size\: 80%; font-weight\: bold; color\: \#569cd6;  background-color\: \#2f2f2e;
block-pre=font-family\: monospace; background-color\: \#545454;
eclipse.preferences.version=1
org.eclipse.mylyn.wikitext.ui.customtemplates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="org.eclipse.mylyn.wikitext.ui.editor" deleted\="false" description\="document background" enabled\="true" name\="background">.{\n  background-color\: rgb(47,47,47);\n  color\: rgb(155,155,155);\n}</template></templates>
phrase-bold=font-weight\: bold;  background-color\: \#cccccc;
phrase-citation=font-style\: italic;  background-color\: \#cccccc;
phrase-code=font-family\: monospace; color\:  \#569cd6; background-color\: \#545454;
phrase-deletedtext=text-decoration\: line-through;  background-color\: \#cccccc;
phrase-emphasis=font-style\: italic;  background-color\: \#cccccc;
phrase-insertedtext=text-decoration\: underline; background-color\: \#cccccc; 
phrase-italic=font-style\: italic;  background-color\:\#cccccc;
phrase-monospace=font-family\: monospace; background-color\: \#545454;
phrase-quote=color\: rgb(38,86,145); background-color\: \#cccccc;
phrase-span=\ background-color\: \#cccccc;
phrase-strong=font-weight\: bold;  background-color\: \#cccccc;
phrase-subscript=font-size\: smaller; vertical-align\: sub; background-color\: \#cccccc;
phrase-superscript=font-size\: smaller; vertical-align\: super; background-color\: \#cccccc;
phrase-underlined=text-decoration\: underline; background-color\: \#cccccc;


(see file attached for preview)

Hope it helps !
  • Attachment: wikitext.png
    (Size: 172.57KB, Downloaded 24 times)

[Updated on: Tue, 20 July 2021 19:57]

Report message to a moderator

Previous Topic:Wikitext German Umlaute in External Links
Next Topic:Problem regarding Existing project was support by Mylyn
Goto Forum:
  


Current Time: Tue Sep 27 01:52:43 GMT 2022

Powered by FUDForum. Page generated in 0.02243 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top