You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@roller.apache.org by kaig <na...@kinokai.de> on 2007/02/03 18:58:13 UTC

Source Code Highlighting

Hi there, 

I want to be able to create blog entries containing highlighted source code.
How am I supposed to do this? The normal WYSIWYG editor does not have such
an option, so how is this possible? What is the best practise for doing
something like this?

Thanks in advance

cheers

Kai
-- 
View this message in context: http://www.nabble.com/Source-Code-Highlighting-tf3166846s12275.html#a8784933
Sent from the Roller - User mailing list archive at Nabble.com.


Re: feed behaviour in planet

Posted by Dave <sn...@gmail.com>.
On 2/8/07, jonathan <je...@ryerson.ca> wrote:
> I'm generating aggregated blogs using:
>
> #set($pager = $planet.getAggregationPager("<custom group name>",$since,
> $maxResults))
>
> in my Weblog template.
>
> For seldom-used blogs, it seems that this doesn't pick up feed entries
> properly - a custom group of two blogs with only one entry in the past
> $since days showed no results at all.  Once I either added an entry, or
> "edited" the existing entries (just republished the same entry), they
> were picked up by the aggregator.  Possibly a result of these entries
> having been posted using an earlier Roller version?
>
> Also, it seems that once an entry is picked up by the aggregator, it is
> never deleted even if it is removed from the feeding blog?  This seems
> to be the result of storing these entries in rag_entry, but not
> re-syncing when the original blog has an entry deleted.

When Roller-Planet detects that a feed has changed, the existing
entries for the feed are deleted from the database and the feed is
fetched, parsed and the latest entries are stored in the database.

> Is there a way to force a sync between a custom planet group, and the rss feeds that
> comprise said group?

Not really, or at least not through the Roller UI. But you can use SQL
to set the last_updated field in the rag_subscription table to an old
date/time, that will force a reload of the feed associated with that
subscription.

- Dave

feed behaviour in planet

Posted by jonathan <je...@ryerson.ca>.
I'm generating aggregated blogs using:

#set($pager = $planet.getAggregationPager("<custom group name>",$since, 
$maxResults))

in my Weblog template.

For seldom-used blogs, it seems that this doesn't pick up feed entries 
properly - a custom group of two blogs with only one entry in the past 
$since days showed no results at all.  Once I either added an entry, or 
"edited" the existing entries (just republished the same entry), they 
were picked up by the aggregator.  Possibly a result of these entries 
having been posted using an earlier Roller version?

Also, it seems that once an entry is picked up by the aggregator, it is 
never deleted even if it is removed from the feeding blog?  This seems 
to be the result of storing these entries in rag_entry, but not 
re-syncing when the original blog has an entry deleted.  Is there a way 
to force a sync between a custom planet group, and the rss feeds that 
comprise said group?

Re: Source Code Highlighting

Posted by Matt Raible <ma...@raibledesigns.com>.
The easiest solution is probably to host these on your own server and
then link to them from jroller.com. Otherwise, you could try 1)
posting the scripts as new pages (this should work) or 2) using the
ones on java.dzone.com:

<link type="text/css" rel="stylesheet"
href="/sites/all/themes/dzone/scripts/syntaxHighlighter/styles/SyntaxHighlighter.css"/>
<script type="text/javascript"
src="/sites/all/themes/dzone/scripts/syntaxHighlighter/dzShCore.js"></script>
<script type="text/javascript"
src="/sites/all/themes/dzone/scripts/syntaxHighlighter/shBrushJava.js"></script>

<script type="text/javascript"
src="/sites/all/themes/dzone/scripts/syntaxHighlighter/shBrushGroovy.js"></script>
<script type="text/javascript"
src="/sites/all/themes/dzone/scripts/syntaxHighlighter/shBrushColdFusion.js"></script>
<script type="text/javascript"
src="/sites/all/themes/dzone/scripts/syntaxHighlighter/shBrushPhp.js"></script>
<script type="text/javascript"
src="/sites/all/themes/dzone/scripts/syntaxHighlighter/shBrushPython.js"></script>
<script type="text/javascript"
src="/sites/all/themes/dzone/scripts/syntaxHighlighter/shBrushRuby.js"></script>
<script type="text/javascript"
src="/sites/all/themes/dzone/scripts/syntaxHighlighter/shBrushXml.js"></script>
<script type="text/javascript"
src="/sites/all/themes/dzone/scripts/syntaxHighlighter/shBrushCss.js"></script>
<script type="text/javascript"
src="/sites/all/themes/dzone/scripts/syntaxHighlighter/shBrushSql.js"></script>
<script type="text/javascript"
src="/sites/all/themes/dzone/scripts/syntaxHighlighter/shBrushJScript.js"></script>

<script type="text/javascript"
src="/sites/all/themes/dzone/scripts/syntaxHighlighter/shBrushCSharp.js"></script>

Matt

On 2/5/08, David Whitehurst <dl...@gmail.com> wrote:
>
> Matt:
>
> What do think is the best solution here?  I like the highlighting, line
> numbering, and styling, but the javascript is a little clunky.  It would be
> nice if the people at jroller would host a syntax hilighting solution for
> all.  I don't even think that Google's blogger has it either by default.
>
> If you host a public blog, you should provide syntax highlighting.
>
> David
>
>
> Matt Raible-3 wrote:
> >
> > I don't use this on my blog, but I'll probably think about it the next
> > time I need to post a lot of source code.  Generally, what I do is use
> > JSPWiki's Java2Html Plugin:
> >
> > http://www.java2html.de/docs/wiki/jspwiki.html
> >
> > Unfortunately, the version I'm using spits out invalid XHTML, so I
> > often render it using my wiki - then find and replace the invalid
> > stuff.  I believe the new version fixes this problem.  The JavaScript
> > solution seems a fair bit easier. ;-)
> >
> > Matt
> >
> > On 2/3/07, Kai Grabfelder <na...@kinokai.de> wrote:
> >>
> >> Hi Matt,
> >>
> >> cool, thanks I was not aware of the db Syntax Highlighter
> >> (http://www.dreamprojections.com/SyntaxHighlighter/Default.aspx)
> >>
> >> I think including the scripts storing on the local server makes more
> >> sense
> >> than including them from appfuse or rollerblogger sites...
> >>
> >> So you are using this on your blog as well? I noticed your nice formated
> >> sourcode..
> >>
> >> cheers
> >>
> >> Kai
> >>
> >>
> >> Matt Raible-3 wrote:
> >> >
> >> > Here's some instructions I obtained from David Whitehurst, who has a
> >> > blog on JRoller.  Here's an example of the highlighting:
> >> >
> >> > http://jroller.com/page/dlwhitehurst?entry=i_didn_t_write_that
> >> >
> >> > Instructions:
> >> >
> >> > Add this to top of your blogged entry ...
> >> >
> >> > <!-- style sheet should be linked at the top of the page -->
> >> > <link type="text/css" rel="stylesheet" href="
> >> >
> >> http://static.appfuse.org/scripts/dp.SyntaxHighlighter/Styles/SyntaxHighlighter.css">
> >> > </link>
> >> > <p>
> >> > Have you ever written code or worked on a module ...
> >> >
> >> >
> >> > Then I put this around the code ...
> >> >
> >> > <textarea name="code" class="java" cols="60" rows="10">
> >> >
> >> > private boolean checkInsuranceWithAdjunctEligibilityForIncome() {}
> >> >
> >> > </textarea>
> >> >
> >> > And, this is needed at the bottom ....
> >> >
> >> > <!-- the following code should be place at the bottom of the page -->
> >> > <script language="javascript"
> >> >
> >> src="http://static.appfuse.org/scripts/dp.SyntaxHighlighter/Scripts/shCore.js"></script>
> >> > <script language="javascript"
> >> >
> >> src="http://static.appfuse.org/scripts/dp.SyntaxHighlighter/Scripts/shBrushJava.js
> >> > "></script>
> >> > <script language="javascript"
> >> >
> >> src="http://static.appfuse.org/scripts/dp.SyntaxHighlighter/Scripts/shBrushXml.js
> >> > "></script>
> >> > <script language="javascript">
> >> > dp.SyntaxHighlighter.HighlightAll('code');
> >> > </script>
> >> >
> >> > Notice that these scripts are stored on my site (static.appfuse.org).
> >> > Maybe we could host them on rollerweblogger.org?  Dave - do you have
> >> > unlimited bandwidth on that site?
> >> >
> >> > Matt
> >> >
> >> >
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Source-Code-Highlighting-tf3166846s12275.html#a8786596
> >> Sent from the Roller - User mailing list archive at Nabble.com.
> >>
> >>
> >
> >
> > --
> > http://raibledesigns.com
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Source-Code-Highlighting-tp8784933s12275p15300095.html
> Sent from the Roller - User mailing list archive at Nabble.com.
>
>

Re: Source Code Highlighting

Posted by David Whitehurst <dl...@gmail.com>.
Matt:

What do think is the best solution here?  I like the highlighting, line
numbering, and styling, but the javascript is a little clunky.  It would be
nice if the people at jroller would host a syntax hilighting solution for
all.  I don't even think that Google's blogger has it either by default.

If you host a public blog, you should provide syntax highlighting.  

David


Matt Raible-3 wrote:
> 
> I don't use this on my blog, but I'll probably think about it the next
> time I need to post a lot of source code.  Generally, what I do is use
> JSPWiki's Java2Html Plugin:
> 
> http://www.java2html.de/docs/wiki/jspwiki.html
> 
> Unfortunately, the version I'm using spits out invalid XHTML, so I
> often render it using my wiki - then find and replace the invalid
> stuff.  I believe the new version fixes this problem.  The JavaScript
> solution seems a fair bit easier. ;-)
> 
> Matt
> 
> On 2/3/07, Kai Grabfelder <na...@kinokai.de> wrote:
>>
>> Hi Matt,
>>
>> cool, thanks I was not aware of the db Syntax Highlighter
>> (http://www.dreamprojections.com/SyntaxHighlighter/Default.aspx)
>>
>> I think including the scripts storing on the local server makes more
>> sense
>> than including them from appfuse or rollerblogger sites...
>>
>> So you are using this on your blog as well? I noticed your nice formated
>> sourcode..
>>
>> cheers
>>
>> Kai
>>
>>
>> Matt Raible-3 wrote:
>> >
>> > Here's some instructions I obtained from David Whitehurst, who has a
>> > blog on JRoller.  Here's an example of the highlighting:
>> >
>> > http://jroller.com/page/dlwhitehurst?entry=i_didn_t_write_that
>> >
>> > Instructions:
>> >
>> > Add this to top of your blogged entry ...
>> >
>> > <!-- style sheet should be linked at the top of the page -->
>> > <link type="text/css" rel="stylesheet" href="
>> >
>> http://static.appfuse.org/scripts/dp.SyntaxHighlighter/Styles/SyntaxHighlighter.css">
>> > </link>
>> > <p>
>> > Have you ever written code or worked on a module ...
>> >
>> >
>> > Then I put this around the code ...
>> >
>> > <textarea name="code" class="java" cols="60" rows="10">
>> >
>> > private boolean checkInsuranceWithAdjunctEligibilityForIncome() {}
>> >
>> > </textarea>
>> >
>> > And, this is needed at the bottom ....
>> >
>> > <!-- the following code should be place at the bottom of the page -->
>> > <script language="javascript"
>> >
>> src="http://static.appfuse.org/scripts/dp.SyntaxHighlighter/Scripts/shCore.js"></script>
>> > <script language="javascript"
>> >
>> src="http://static.appfuse.org/scripts/dp.SyntaxHighlighter/Scripts/shBrushJava.js
>> > "></script>
>> > <script language="javascript"
>> >
>> src="http://static.appfuse.org/scripts/dp.SyntaxHighlighter/Scripts/shBrushXml.js
>> > "></script>
>> > <script language="javascript">
>> > dp.SyntaxHighlighter.HighlightAll('code');
>> > </script>
>> >
>> > Notice that these scripts are stored on my site (static.appfuse.org).
>> > Maybe we could host them on rollerweblogger.org?  Dave - do you have
>> > unlimited bandwidth on that site?
>> >
>> > Matt
>> >
>> >
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Source-Code-Highlighting-tf3166846s12275.html#a8786596
>> Sent from the Roller - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> http://raibledesigns.com
> 
> 

-- 
View this message in context: http://www.nabble.com/Source-Code-Highlighting-tp8784933s12275p15300095.html
Sent from the Roller - User mailing list archive at Nabble.com.


Re: Source Code Highlighting

Posted by Matt Raible <mr...@gmail.com>.
I don't use this on my blog, but I'll probably think about it the next
time I need to post a lot of source code.  Generally, what I do is use
JSPWiki's Java2Html Plugin:

http://www.java2html.de/docs/wiki/jspwiki.html

Unfortunately, the version I'm using spits out invalid XHTML, so I
often render it using my wiki - then find and replace the invalid
stuff.  I believe the new version fixes this problem.  The JavaScript
solution seems a fair bit easier. ;-)

Matt

On 2/3/07, Kai Grabfelder <na...@kinokai.de> wrote:
>
> Hi Matt,
>
> cool, thanks I was not aware of the db Syntax Highlighter
> (http://www.dreamprojections.com/SyntaxHighlighter/Default.aspx)
>
> I think including the scripts storing on the local server makes more sense
> than including them from appfuse or rollerblogger sites...
>
> So you are using this on your blog as well? I noticed your nice formated
> sourcode..
>
> cheers
>
> Kai
>
>
> Matt Raible-3 wrote:
> >
> > Here's some instructions I obtained from David Whitehurst, who has a
> > blog on JRoller.  Here's an example of the highlighting:
> >
> > http://jroller.com/page/dlwhitehurst?entry=i_didn_t_write_that
> >
> > Instructions:
> >
> > Add this to top of your blogged entry ...
> >
> > <!-- style sheet should be linked at the top of the page -->
> > <link type="text/css" rel="stylesheet" href="
> > http://static.appfuse.org/scripts/dp.SyntaxHighlighter/Styles/SyntaxHighlighter.css">
> > </link>
> > <p>
> > Have you ever written code or worked on a module ...
> >
> >
> > Then I put this around the code ...
> >
> > <textarea name="code" class="java" cols="60" rows="10">
> >
> > private boolean checkInsuranceWithAdjunctEligibilityForIncome() {}
> >
> > </textarea>
> >
> > And, this is needed at the bottom ....
> >
> > <!-- the following code should be place at the bottom of the page -->
> > <script language="javascript"
> > src="http://static.appfuse.org/scripts/dp.SyntaxHighlighter/Scripts/shCore.js"></script>
> > <script language="javascript"
> > src="http://static.appfuse.org/scripts/dp.SyntaxHighlighter/Scripts/shBrushJava.js
> > "></script>
> > <script language="javascript"
> > src="http://static.appfuse.org/scripts/dp.SyntaxHighlighter/Scripts/shBrushXml.js
> > "></script>
> > <script language="javascript">
> > dp.SyntaxHighlighter.HighlightAll('code');
> > </script>
> >
> > Notice that these scripts are stored on my site (static.appfuse.org).
> > Maybe we could host them on rollerweblogger.org?  Dave - do you have
> > unlimited bandwidth on that site?
> >
> > Matt
> >
> >
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Source-Code-Highlighting-tf3166846s12275.html#a8786596
> Sent from the Roller - User mailing list archive at Nabble.com.
>
>


-- 
http://raibledesigns.com

Re: Source Code Highlighting

Posted by Kai Grabfelder <na...@kinokai.de>.
Hi Matt, 

cool, thanks I was not aware of the db Syntax Highlighter
(http://www.dreamprojections.com/SyntaxHighlighter/Default.aspx)

I think including the scripts storing on the local server makes more sense
than including them from appfuse or rollerblogger sites...

So you are using this on your blog as well? I noticed your nice formated
sourcode..

cheers

Kai


Matt Raible-3 wrote:
> 
> Here's some instructions I obtained from David Whitehurst, who has a
> blog on JRoller.  Here's an example of the highlighting:
> 
> http://jroller.com/page/dlwhitehurst?entry=i_didn_t_write_that
> 
> Instructions:
> 
> Add this to top of your blogged entry ...
> 
> <!-- style sheet should be linked at the top of the page -->
> <link type="text/css" rel="stylesheet" href="
> http://static.appfuse.org/scripts/dp.SyntaxHighlighter/Styles/SyntaxHighlighter.css">
> </link>
> <p>
> Have you ever written code or worked on a module ...
> 
> 
> Then I put this around the code ...
> 
> <textarea name="code" class="java" cols="60" rows="10">
> 
> private boolean checkInsuranceWithAdjunctEligibilityForIncome() {}
> 
> </textarea>
> 
> And, this is needed at the bottom ....
> 
> <!-- the following code should be place at the bottom of the page -->
> <script language="javascript"
> src="http://static.appfuse.org/scripts/dp.SyntaxHighlighter/Scripts/shCore.js"></script>
> <script language="javascript"
> src="http://static.appfuse.org/scripts/dp.SyntaxHighlighter/Scripts/shBrushJava.js
> "></script>
> <script language="javascript"
> src="http://static.appfuse.org/scripts/dp.SyntaxHighlighter/Scripts/shBrushXml.js
> "></script>
> <script language="javascript">
> dp.SyntaxHighlighter.HighlightAll('code');
> </script>
> 
> Notice that these scripts are stored on my site (static.appfuse.org).
> Maybe we could host them on rollerweblogger.org?  Dave - do you have
> unlimited bandwidth on that site?
> 
> Matt
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Source-Code-Highlighting-tf3166846s12275.html#a8786596
Sent from the Roller - User mailing list archive at Nabble.com.


Re: Source Code Highlighting

Posted by Matt Raible <mr...@gmail.com>.
Here's some instructions I obtained from David Whitehurst, who has a
blog on JRoller.  Here's an example of the highlighting:

http://jroller.com/page/dlwhitehurst?entry=i_didn_t_write_that

Instructions:

Add this to top of your blogged entry ...

<!-- style sheet should be linked at the top of the page -->
<link type="text/css" rel="stylesheet" href="
http://static.appfuse.org/scripts/dp.SyntaxHighlighter/Styles/SyntaxHighlighter.css">
</link>
<p>
Have you ever written code or worked on a module ...


Then I put this around the code ...

<textarea name="code" class="java" cols="60" rows="10">

private boolean checkInsuranceWithAdjunctEligibilityForIncome() {}

</textarea>

And, this is needed at the bottom ....

<!-- the following code should be place at the bottom of the page -->
<script language="javascript"
src="http://static.appfuse.org/scripts/dp.SyntaxHighlighter/Scripts/shCore.js"></script>
<script language="javascript"
src="http://static.appfuse.org/scripts/dp.SyntaxHighlighter/Scripts/shBrushJava.js
"></script>
<script language="javascript"
src="http://static.appfuse.org/scripts/dp.SyntaxHighlighter/Scripts/shBrushXml.js
"></script>
<script language="javascript">
dp.SyntaxHighlighter.HighlightAll('code');
</script>

Notice that these scripts are stored on my site (static.appfuse.org).
Maybe we could host them on rollerweblogger.org?  Dave - do you have
unlimited bandwidth on that site?

Matt


On 2/3/07, kaig <na...@kinokai.de> wrote:
>
> Hi there,
>
> I want to be able to create blog entries containing highlighted source code.
> How am I supposed to do this? The normal WYSIWYG editor does not have such
> an option, so how is this possible? What is the best practise for doing
> something like this?
>
> Thanks in advance
>
> cheers
>
> Kai
> --
> View this message in context: http://www.nabble.com/Source-Code-Highlighting-tf3166846s12275.html#a8784933
> Sent from the Roller - User mailing list archive at Nabble.com.
>
>


-- 
http://raibledesigns.com