Code Button

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

ZeroQool
Posts: 3
Joined: Fri Mar 13, 2009 2:19 pm

Code Button

Post by ZeroQool »

Hallo,

möchte mir eine Wissensdatenbank aufbauen hauptsächlich für meine Programmierung. Nun fehlt mir der Code Button bzw Tag. Kann mir jemand bitte helfen? habe die 2 und 2.5er Version bereits versucht, aber überall fehlt er. danke
Thorsten
Posts: 15724
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Code Button

Post by Thorsten »

Hi,

du kannst übergangsweise auch <code> per Hand einfügen. Der Button soll in die 2.5 wieder rein, dauert aber noch etwas.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
ZeroQool
Posts: 3
Joined: Fri Mar 13, 2009 2:19 pm

Re: Code Button

Post by ZeroQool »

Hmm...funktioniert so nicht. siehe screen. oder mache ich etwas falsch?! =)
You do not have the required permissions to view the files attached to this post.
Thorsten
Posts: 15724
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Code Button

Post by Thorsten »

Hi,

bist du in den HTML-Modus gewechselt? :-)

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
ZeroQool
Posts: 3
Joined: Fri Mar 13, 2009 2:19 pm

Re: Code Button

Post by ZeroQool »

Thorsten wrote:Hi,

bist du in den HTML-Modus gewechselt? :-)

bye
Thorsten
Nein, wenn ich über EDIT HTML Source mache sieht es sogar noch schlimmer aus. Keine Absätze..alles imgrunde in eine Zeile.
Thorsten
Posts: 15724
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Code Button

Post by Thorsten »

Hi,

dann musst du erstmal leider "preformatted" nehmen. Sorry!

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
jenolan
Posts: 16
Joined: Fri Apr 13, 2007 12:54 pm

Re: Code Button

Post by jenolan »

I have tried both of these in the new RC

Code: Select all

<code php>
<?php
$if( a == b
{
   xxx;
}
</code>

<pre>
<?php
$if( a == b
{
   xxx;
}

</pre>
Neither work and are simply eaten and disappear.

Please, pretty please, can we have a way to embed code I seriously would like to swap back from using a wiki but I need to be able to show code samples.

Thanks!
Larry
Thorsten
Posts: 15724
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Code Button

Post by Thorsten »

Hi Larry,

I'll work on it.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
jenolan
Posts: 16
Joined: Fri Apr 13, 2007 12:54 pm

Re: Code Button

Post by jenolan »

I will donate US$25 (is that ok?) to have a way to embed code :-) I really love phpMyFAQ this has been my only real grouch.

Thanks guys!
Larry

Ended up as Eu 25 as I didn't want to do the conversions in my head 8)
Thorsten
Posts: 15724
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Code Button

Post by Thorsten »

Hi,

thank you very much. I'll work on that today to bring that feature back.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Thorsten
Posts: 15724
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Code Button

Post by Thorsten »

Hi,

phpMyFAQ 2.5.0 final will support syntax highlighting for several programming languages like PHP, Perl, Python, Ruby, Java, C++ and SQL.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
jenolan
Posts: 16
Joined: Fri Apr 13, 2007 12:54 pm

Re: Code Button

Post by jenolan »

Fantastic .. can't wait :wink:
jenolan
Posts: 16
Joined: Fri Apr 13, 2007 12:54 pm

Re: Code Button

Post by jenolan »

Testing the one in svn...

Parsed code block

Code: Select all

<p>Hello</p> <p>&nbsp;</p> <pre class="brush: php;fontsize: 100; first-line: 1;">function normalizePath($path){ if (substr(PHP_OS, 0, 3) == 'WIN'){ $path = preg_replace('|^[A-Za-z]:|', '', $path); $path = str_replace("\\", '/', $path); } return $path; } </pre> 
which in html source is...

Code: Select all

<p><p>Hello</p>
<p>&nbsp;</p>
<pre class="brush: php;fontsize: 100; first-line: 1;">function normalizePath($path){
	if (substr(PHP_OS, 0, 3) == 'WIN'){	
    	$path = preg_replace('|^[A-Za-z]:|', '', $path);
    	$path = str_replace("\\", '/', $path);
	}
	return $path;
}
</pre></p>
Would say that pre hasn't been added to allowable tags ;-)

Larry
Thorsten
Posts: 15724
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Code Button

Post by Thorsten »

Hi Larry,

I don't understand your quote... :-)

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
jenolan
Posts: 16
Joined: Fri Apr 13, 2007 12:54 pm

Re: Code Button

Post by jenolan »

I added code with the button, and that's how it mangles. Just try adding a code block.
Post Reply