<?xml version="1.0" encoding="UTF-8"?><!-- generator="bbPress" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
>
	<channel>
		<title>Dudas de Programacion &#187; Topic: AYUDA FORO: Como poner código fuente</title>
		<link>http://www.dudasprogramacion.com/topic/ayuda-foro-como-poner-codigo-fuente</link>
		<description>Dudas sobre lenguajes y apis de programación</description>
		<language>en-US</language>
		<pubDate>Wed, 08 Feb 2012 04:42:12 +0000</pubDate>
		<generator>bbpress 1.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://www.dudasprogramacion.com/search.php</link>
		</textInput>
		<atom:link href="http://www.dudasprogramacion.com/rss/topic/ayuda-foro-como-poner-codigo-fuente" rel="self" type="application/rss+xml" />

		<item>
			<title>admin on "AYUDA FORO: Como poner código fuente"</title>
			<link>http://www.dudasprogramacion.com/topic/ayuda-foro-como-poner-codigo-fuente#post-503</link>
			<pubDate>Sat, 12 Jun 2010 19:48:59 +0000</pubDate>
			<dc:creator>admin</dc:creator>
			<guid isPermaLink="false">503@http://www.dudasprogramacion.com/</guid>
			<description><p>Ejemplo con HTML:</p>
<pre class="html4strict" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ddbb00;">&amp;#60;</span> pre lang='html4strict' lineno='1'<span style="color: #ddbb00;">&amp;#62;&amp;#60;</span>html<span style="color: #ddbb00;">&amp;#62;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ddbb00;">&amp;#60;</span>body<span style="color: #ddbb00;">&amp;#62;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ddbb00;">&amp;#60;</span>h1<span style="color: #ddbb00;">&amp;#62;</span>Hola Mundo<span style="color: #ddbb00;">&amp;#60;</span>/h1<span style="color: #ddbb00;">&amp;#62;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ddbb00;">&amp;#60;</span>/body<span style="color: #ddbb00;">&amp;#62;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ddbb00;">&amp;#60;</span>/html<span style="color: #ddbb00;">&amp;#62;&amp;#60;</span> /pre<span style="color: #ddbb00;">&amp;#62;</span></div></li></ol></pre>
<p>Que haría que se visualizase:</p>
<pre class="html4strict" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ddbb00;">&amp;#60;</span>html<span style="color: #ddbb00;">&amp;#62;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ddbb00;">&amp;#60;</span>body<span style="color: #ddbb00;">&amp;#62;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ddbb00;">&amp;#60;</span>h1<span style="color: #ddbb00;">&amp;#62;</span>Hola Mundo<span style="color: #ddbb00;">&amp;#60;</span>/h1<span style="color: #ddbb00;">&amp;#62;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ddbb00;">&amp;#60;</span>/body<span style="color: #ddbb00;">&amp;#62;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ddbb00;">&amp;#60;</span>/html<span style="color: #ddbb00;">&amp;#62;</span></div></li></ol></pre></description>
		</item>
		<item>
			<title>admin on "AYUDA FORO: Como poner código fuente"</title>
			<link>http://www.dudasprogramacion.com/topic/ayuda-foro-como-poner-codigo-fuente#post-502</link>
			<pubDate>Sat, 12 Jun 2010 19:26:43 +0000</pubDate>
			<dc:creator>admin</dc:creator>
			<guid isPermaLink="false">502@http://www.dudasprogramacion.com/</guid>
			<description><p>Mediante el manejo de etiquetas en las entradas del foro podréis incluir código fuente resaltado de una forma sencilla.</p>
<p>Primero veamos cual es el resultado:</p>
<pre class="java" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> HolaMundo <span style="color: #009900;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">System</span></a>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Hola Mundo&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  <span style="color: #009900;">&#125;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&#125;</span></div></li></ol></pre>
<p>Para utilizarlo tenéis que usar la etiqueta PRE:</p>
<pre class="html4strict" style="font-family:monospace;"><span style="color: #ddbb00;">&amp;#60;</span> pre<span style="color: #ddbb00;">&amp;#62;</span>Codigo<span style="color: #ddbb00;">&amp;#60;</span> /pre<span style="color: #ddbb00;">&amp;#62;</span></pre>
<p>Si no ponéis atributos a la etiqueta PRE, se queda el formato por defecto. Pero podéis hacer que se realice el formato por lenguajes de programación. Esto lo conseguimos mediante el atributo LANG.</p>
<p>El siguiente código formatearía como si fuese Java:</p>
<pre class="html4strict" style="font-family:monospace;"><span style="color: #ddbb00;">&amp;#60;</span> pre lang='java'<span style="color: #ddbb00;">&amp;#62;</span>Codigo<span style="color: #ddbb00;">&amp;#60;</span> /pre<span style="color: #ddbb00;">&amp;#62;</span></pre>
<p>Si, queremos añadir una numeración a las líneas, utilizaremos el atributo LINENO, dándole el número de la línea por el que queremos empezar</p>
<pre class="html4strict" style="font-family:monospace;"><span style="color: #ddbb00;">&amp;#60;</span> pre lineno='1'<span style="color: #ddbb00;">&amp;#62;</span>codigo</pre>
<p>Por último podemos combinar los dos atributos, quedando el siguiente código</p>
<pre class="html4strict" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ddbb00;">&amp;#60;</span> pre lang='java' lineno='1'<span style="color: #ddbb00;">&amp;#62;</span>public class HolaMundo {</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  public static void main(String[] args) {</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    System.out.println(&quot;Hola Mundo&quot;);</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  }</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">}<span style="color: #ddbb00;">&amp;#60;</span> /pre<span style="color: #ddbb00;">&amp;#62;</span></div></li></ol></pre></description>
		</item>

	</channel>
</rss>

