|
Rahul Rajat Singh wrote: Wow, too many "elephanting" in this post. I don't mind them some someone could.
Do you really think I give a elephant?
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
My tip makes use of code blocks that are in multiple languages. The PRE block on the bottom should look red, like in my alternate (which I plan to delete once I've confirmed that the new feature is up to snuff). In the WYSIWYG while editing the tip, the PRE blocks do look red, but that style information disappears when the tip gets rendered.
|
|
|
|
|
Styles, fonts and classes, except for a very few, are stripped from PRE blocks. Use class = highlight or emphasis, and B, U and I tags, but that's about it.
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
|
But it works on a normal PRE block (as you can see in my alternate). It's only with the multi-language feature that this happens.
|
|
|
|
|
I am in the very early stages of trying to come up with an article. For this article, I was thinking about providing the solution in C# and VB.NET, but I don't think the current code blocks can handle it without having 2 separate blocks for each section of code I will explain. I was thinking that it would be nice if we could have Tabbed code blocks (like MSDN)? This could facilitate multiple code language articles, but I could also see some other use cases: If you were explaining a main section of code, have the code in the first tab, then any ancillary classes can be included in tabs behind it.
Be The Noise
|
|
|
|
|
Good idea!
"With sufficient thrust, pigs fly just fine."
Ross Callon, The Twelve Networking Truths, RFC1925
|
|
|
|
|
I support your idea!
Bill Gates is a very rich man today... and do you want to know why? The answer is one word: versions.
Dave Barry
Read more at BrainyQuote[ ^]
|
|
|
|
|
Take a look at the Code Project Article FAQ[^]
If you have the same code snippet shown in multiple languages (eg C# and VB versions of the same code) you can wrap muiltiple PRE blocks inside a <div class="code-samples"> and have the multiple code blocks appear in a tabbed form, similar to MSDN
eg
<div class="code-samples">
<pre lang="C#">
...
</pre>
<pre lang="VB.NET">
...
</pre>
</div>
Just make sure you set the lang attribute correctly
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
modified 29-Jun-12 14:15pm.
|
|
|
|
|
Awesome!
Next time, I will try to RTFM
Be The Noise
|
|
|
|
|
There's a lot of stuff and a lot of options. It's easy to miss.
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
|
The correct response should have been "Booya!".
|
|
|
|
|
Chris Maunder wrote: eg div class="code-samples">
FYI, as you have pasted it here, that page is missing a less than (<) before the "div" (and the "eg" should probably not be on the same line). Also, considering this is an HTML snippet, I'd think you would want to wrap it in a PRE block.
|
|
|
|
|
Bill Gates is a very rich man today... and do you want to know why? The answer is one word: versions.
Dave Barry
Read more at BrainyQuote[ ^]
|
|
|
|
|
Hi Chris,
I asked the same question last week and was forwarded to this post. So I tried what you said and somehow failed miserably...
Could you, or someone of the staff, an editor, please have a look at where I went wrong?
This is the article that should now have tabbed code blocks, but hasn't...
A Look under the hood of the .NET Framework[^]
Thanks!
It's an OO world.
public class Naerling : Lazy<Person>{
public void DoWork(){ throw new NotImplementedException(); }
}
|
|
|
|
|
All fixed.
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
|
Thanks Chris, looks great!
It's an OO world.
public class Naerling : Lazy<Person>{
public void DoWork(){ throw new NotImplementedException(); }
}
|
|
|
|
|
Example here. Thanks again, Chris & Co, for implementing this.
|
|
|
|
|
Thanks for the great example. Exactly what I'm hoping to do
Be The Noise
|
|
|
|
|
Maybe you can add a My Forums menu and allow users to customize which forums they want to have handy. You could also use the My Bookmarks list (forums only) to display there.
|
|
|
|
|
It's on the TODO.
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
|
Me no like numbers in reputation. I'm getting sea-sickness.
|
|
|
|
|
|
We always include a certain margin of error in our dates.
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
|
Hi,
Dropdown for choosing "My Job Title" under "Public Profile" tab is not working. Refer Here[^].
Warm Regards.
--Amit
|
|
|
|
|
All fixed!
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|