Adding code snippets to a blog post in Lemoon - lemoon

Does anyone have experience with adding formatted code snippets to a blog post using Lemoon? I have been using Syntax Highlighter in other systems and like it fine, but I'm wondering first if there's a built in solution in Lemoon. I noticed that the system uses codemirror for HTML view for editing content and wondered if that might also be used for formatting code snippets. Thanks.

Lemoon has a built in code EDITOR that uses codemirror. Just decorate your field appropriately as described here. This applies only to the administrative section of Lemoon.
You could use this field type to write your markup and snippets, but I guess you are looking for a better way to insert code snippets in your blog posts.
It is possible to configure the standard Lemoon HTML editor (TinyMce 3.x) to use a plugin that enables you to insert code snippets. https://github.com/RichGuk/syntaxhl looks promising (haven’t tried it though). You will find the TinyMce config files in the app_data\settings folder.
Another alternative is to switch to the HTML source and manually add the pre or code elements as needed.
As for presenting the snippets on your site, you could use codemirror (configured as read-only) or perhaps you are better off sticking with SyntaxHighlighter. In any way, you have to include the appropriate JavaScript files and handle the initialization yourself.

Related

SonarQube page extension with html possible?

I just read about extending SonarQube with custom pages. All examples I have found consist only of javascript files.
Is it possible to have html files as well or is it javascript only? If it is javascript only then the whole feature is completely useless as nobody wants to create all the html elements with javascript.
It's Javascript only.
However, there's a guide on how to use React to create the HTML elements, which makes it a lot more bearable. Try it!

Possible to include an image in the meta data in code? VS 2013

I would like to be able to include a screenshot of a control inside my code, this way making control identification easier for new members on my team, is such a thing possible?
Maybe even the ability to just have the image on a network share with the path in a comment, and then have a plugin that when hovering over the link brings up the image?
EDIT (More detail):
I'm creating a test project, the application under test has over 1000 controls, some of them are similar in name and purpose, this can make it difficult at times for developers to reuse the API I am creating because the control name is simply not enough for quick identification of the control in use.
I use the word API very loosely too, none of this stuff will be consumed in web services, and it will always be white box with developers including a project reference and have direct access to the source code.
For every form in my application (The test one), I have a controls.cs file where all the controls for that form in the application under test are listed - This is where I want the hover to screenshot ability in the control definitions.
Another sure factor is that all developers will be using VS2013 (For now the base version), later this could be update 1 or 2.
As the initial author and senior developer on this project, these hover / image references (in the code) will be as useful to me personally as any 3rd party developers, or any later developers to join the initiative.
Thanks again, and I added a bounty!
I believe you can use Whole Tomato's free SourceLinks Visual Studio extension to do what you want - or at least get pretty close to it.
Built-in Functionality:
Out of the box, the extension allows you to specify comment patterns you want users to be able to take an action on. Once the patterns are specified, SourceLinks will highlight any occurrences of those patterns in the text editor. You will be able to double click the highlighted items and perform a pre-configured action (such as opening a link in an internal/external browser, or launching an executable).
You can see an example in the SourceLinks configuration dialog shown below:
(source: wholetomato.com)
So you could use this feature pretty painlessly to define a keyword such as Control Image and then put comments like the following in your code:
// Control Image: my_smart_list.jpg
SourceLinks would allow you double click this text, and you could have that configured to launch the image (using a file:// or http:// url depending on how and where your images are stored) either inside Visual Studio in it's internal browser, or in an external browser.
Custom Tooltips!
Now, if you want to put in some more effort into this and actually write some code, then SourceLinks allows you to create API Extensions to display custom tooltips when the user hovers over the marked text in the editor. The default installation of SourceLinks comes with sample API extensions that you can copy to create your own. See the article linked at the very top of the answer for more details on these samples.
This post in the SourceLinks forum informs us that SourceLinks expects the custom API Extension to return the tooltip value as FlowDocument XAML text. This is awesome news for us, because a FlowDocument can contain many types of elements, including formatted text, hyperlinks, and images.
Imanges in a Flow document can be specified both inline as well as externally.
Hope this helps!
I would use doxygen -- create the images somewhere in the source tree and use doxygen comments. You can embed the \image command in source comments (see docs) and doxygen will generate all the HTML documentation from there. I think doxygen is a great tool for documenting a codebase as you can generate the documentation directly from comments in the source and distribute or host the HTML separately.

Font-awesome codes overrided by toggle editor

I am editing an article and adding FontAwesome in it using Toggle Editor. I've found out that when I add the code using programmer view, it works fine. However, when I change to the designer view from the programmer view, the editor automatically edit the code like this:
Before:
After clicking "Toggle Editor":
It is quite inconvenient for me because I use the designer view to style the article frequently. Is there any solution for it?
You'll have to look into the allowed tags for the editor you're using.
In your case using JCK Editor - you can see this article on why it removes certain code
At first glance it appears there are whitelist & blacklists for some HTML. You'll probably be able to add your selectors to the whitelist and they will no longer get stripped.

SharePoint 2007 RichHtmlField has inline style that is causing issues in ie8

I am working on an intranet project that is having the majority of its users move up to ie8 soon. A bug was detected where when attempting to create/edit a page, the rich html editor boxes would be squeezed compared to what they look like in any other browser.
I found the offending style, its inline and its:
style="display:inline-block"
Now if it was just "inline" then it would be fine. However, it is not.
I have attempted to override the PrefixStyleSheet attribute in the master page and have a custom style in the main css file, but it is not working at all.
I have heard that a control adapter might be helpful to post process the html but i am unsure on how to use one.
Is there any advice you guys can give me?
From my experience, using JQuery "hacks" in the master page header is the most convenient approach, without messing up the system css or the backend.
Find the element you want to override the style to a custom style, and assign your custom style. Be careful if the override is page layout specific, then might add to the page layout header placeholder instead.
http://api.jquery.com/css/
Hope it helps.

Webpage hosted HTML editor that graphically shows tag nesting in WYSIWYG view

I once found a webpage hosted HTML editor that optionally included the tags, as highlighted colour coded elements with the tag type, in the (almost) WYSIWYG view, but now cannot find the project anywhere.
I thought it an excellent compromise between WYSIWYG ease of use an markup flexibility.
Does anyone know which editor this was? Or maybe there is more then one editor with this feature?
Here is one that looks promising.
http://koivi.com/WYSIWYG-Editor/
This appears to match your request.
I found one such, and only one. Unfortunately it isn't the one I had seen before and so I'm still looking. They are called What You See Is What You Mean editors - WYSIWYM.
WYMeditor
Also see - http://en.wikipedia.org/wiki/WYSIWYM

Resources