How to Embed HTML Like JSFiddle? - html

I'm looking for a way to embed an html output. Like I want to write an article like this:
"
when you write <p>A <strong>bold</strong> text</p>,
you get an output like A bold text .
"
So I want to do this programmaticcally like:
"
when you write <p>A <strong>bold</strong> text</p>,
you get an output like <div class='embedded_html_output'><p>A <strong>bold</strong> text</p></div>
"
I hope I made myself clear.
Is there a javascript or php plugin for this?
Thanks !

Looks like you'd just embed one of these: Link
They use simple textarea tags and are initialized via javascript. Google recommends TinyMCE in several places from what I've seen though I've never used any of them personally.

Try using Gist.
https://gist.github.com/
It is a nice way to embed code to your page as well as share it with a URL.

Related

Integrate Code Snippet in Wordpress (Html & Css)

I know this question is really dumb, but I have this code (for a pricetable) here:
https://codepen.io/VoloshchenkoAl/pen/NABNoN
I tried to copy paste it with a shortcode, that looks like this:
<script>
//css code here
</script>
//and then pasted html code here
But the outcome looks like this:
my version
How can I fix that and make it look like the Snippet?
Because it is not interpreting(use) the CSS. Make sure to place the CSS in appropriate places.
And don't use common class names which WordPress uses.

Send text with html to mandrilapp

I'm trying to send something like this to mandrill "the force is <strong> strong </strong> in you" so it's get rendered like "the force is strong in you" but it's not happening. I'm using mandrill template api and using handlebars.
Is there any way to achieve this? I know i could divide the text in 3 parts and put the <strong> tag directly in the template but i have lots of text and would need lots of time
I'ts a handlebars thing. The solution is using triple braces instead of double {{{variable}}} instead of {{variable}}

how can i get the same effect comes by "ctrl + k" in stackoverflow question, in my html code?

see by writting some code here we select that code & press ctrl + K and that code now prints in something different format.
printf("this is code");
see now i copy uper sentences code & paste it below in ctrl+ k mode
printf("this is code");
okey so now i want to know how can i get same effect in my wordpress-blog's post?
any plugin or any technique or any html tag ?
It looks like you are looking for a WP plugin which can handle source code syntax highlighting. Here are some examples which may work for you:
http://wordpress.org/extend/plugins/wp-syntax/screenshots/
http://wordpress.org/extend/plugins/google-syntax-highlighter/screenshots/
You'll want a code highlighter. For WordPress, Geshi-backed highlighters are pretty common. http://wordpress.org/extend/plugins/tags/geshi
You'll be looking for the <pre> tag.

Print HTML on webpage

I want to print some java, jsp code on webpage in an indented format.
Is There a tool that would do it, right now I have to use &nbsp, &lt, &gt to get it done, which is very painful
You could just use the <pre> tag...
If you have access to a text editor, you could just use "Find & Replace..."
Just replace:
< with <
> with >
(two spaces) with
You would have to find the dynamic way of storing and printing the text for example with the combination of javascript and php you can easily achieve this with the help of free and open text editor like WYSIWYG Editor
Have a look at this URL : http://www.openwebware.com/
this can provide a complete solution to you. and embedding on your website should not be a problem, just google something like embedding WYSIWYG Editor etc. you can always find many good tutorial that explain step by step how to do this..
hope this helps you..

Is it possible to retrieve the contents of a html textarea with XPath?

I've looked all over but I can't find any leads. Is it possible to do something like:
//textarea/<some kind of function?>
or
<function>(//textarea)
I know I can do this using JS, or any number of other techniques, but I'm asking because I'm using WebDriver and Firefox to test a TinyMCE textarea input, and because of JS execution delays, I'd like to wait for the textarea to display a certain string after clicking a formatting control and the only way I can think of to achieve this in WebDriver is with SlowLoadableComponent and XPath. That or Thread.sleep but I'd like to avoid that ;)
Thanks in advance.
With TinyMCE, the editor area isn't actually a TextArea - it's an IFrame. Your best bet would be to use Google Chrome (or similar, with Developer-targeted features) to have a look at what TMCE generates. You can then use XPath with something like this:
//IFRAME
which will retrieve all IFRAMEs on the page - or you can add in properties:
//IFRAME[id="myiframe"]
which will retrieve all IFRAMEs on the page with the ID attribute set to 'myiframe'
Hope this helps :)