Welcome to Geeklog, Anonymous Sunday, December 22 2024 @ 04:32 pm EST

Geeklog Forums

Posting Code to Geeklog Site


xiao_haozi

Anonymous
Hi all,
I couldn't come up with a good solution myself so I implore your help.
I have a site that I post tutorials and guides for Linux [http://mutaku.com] and was trying to come up with a good way to separate code or cli commands from the rest of the guide text. Currently I just bold these parts but I would like maybe throw each in a small table to have a different background maybe.
So my question is, what do you guys do to post code or cli commands in a story...what works best, what looks best, etc.
Thanks in advance!

 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Did you see the [code] tag (not to be confused with the HTML <code> tag) that Geeklog has?

bye, Dirk
 Quote

xiao_haozi

Anonymous
Hi Dirk,
Yeah I tried out [code] and it seemed to just change the font a bit to a smaller semi-italicized form.
This worked in differentiating it a bit, but I was curious as to whether there were tricks people used to make it stand out a bit more.
Another option I found was to maybe just create a new css class for a different colored font:
http://www.geeklog.net/forum/viewtopic.php?showtopic=79622
 Quote

xiao_haozi

Anonymous
OK, I think I found something that exemplifies what I would like to do with my code posting.
http://www.macosxhints.com/article.php?story=2007111404402514
It is a site that uses geeklog. I have checked the source and it uses something like this:
<div style="margin-left:60px"><blockquote>text here</blockquote></div>

I am not sure how I go about setting this up, as I have tried as such and it strips everything down to <div>text here</div> when I post it. Do I need to make something in my style.css and if so I am not quite sure how I do this and any input would be great. I have found my style.css in under my professional theme directory thus far...slow start.
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Geeklog removes HTML tags and attributes that aren't explicitly allowed.

But rather than adding the code in the story every time, I'd suggest you add it to your stylesheet. The [code] pseudo-tag is translated into the HTML tags <pre><code>, so defining CSS rules for either of these two would save you a lot of typing.

bye, Dirk
 Quote

xiao_haozi

Anonymous
Thanks Dirk, I have done just that and it is working great!
 Quote

All times are EST. The time is now 04:32 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content