Print HTML on webpage - html

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..

Related

Replace text inside WYSIWYG html

I need to find and replace text inside html which comes from WYSIWYG editor in dotnet core app. I have no idea how to approach that.
For example replace ahoj, with joha in:
<b>aha</b> <b><i>b<b>a<i>a<div>h</div>o</i></b><i>ja</i> a<i><b>hoj</b></b> <b>foobar</b>
which would result in
<b>aha</b> <b><i>bajohaa joha</i></b><i> </i><b><i>foobar</i></b>
I was hoping that html agility pack could do such a think but I don't see how. Can you please point me to a right direction?
Kind regards
Teamol

Latex to html conversion

I am building a website with an implemented forum using Xobor. I want to make a button in the toolbar of the Textwindow that can convert Latex to html. Something like [Latex] \sqrt{a^2+b^2} [/Latex] would be great. Alternativly it can also be a button that creates a popup window, where Latex code can be written. Something like this:
Here you can click on the Button fx and a new window pops up, where you can enter latex code, which is then converted
I already found converters like Mathjax and Katex but I don't think, that they do what I need, because these tools seem to work only for the website text itself, but not for the forum posts.
I honestly don't know much about html, so maybe I am mistaken (I have a friend that will help me implement these things as soon as I find a tool that is fit to do what we need).
I can create the button itself like this (picture below), but obviously it doesn't convert anything yet.
So basically what I am looking for, are some lines of Code that I can put in that textbox shown in the picture above, which create a button in the toolbox, to be able to write formulas and other latex math stuff in my forum.
I really hope that this makes sense.
Thanks in advance!
After installing katex in my Angular project (npm install ng-katex --save
) I use it like:
Typescript:
var equaciones = [' H = \\sum_{i=1}^{m} p_{i} log_{2} (p_{i})']
Html:
<ng-katex [equation]="equaciones[0]"></ng-katex>
Result:
You can see an example of the result here: web_example

How to create a HTML5 tag input

for my HTML5 web application (PHP) I need some input widget for tags like many modern tools have them. For example here a screenshot of Jira label list:
No idea how this widget type is named. I thought maybe it's possible to style with a HTML5 form? Any ideas? I tried to search in goggle, but "tag" and "html" together is a bad search combination. :-)
Hmmm, I just found out by reverse engineering the code of this web page from the tags input below I get some ideas...
But does anyone know an easier example?
enter image description here
You can use jquery autocompleter:
https://jqueryui.com/autocomplete/
And style it whatever you want

Sublime text 2 convert html to javascript string

I just started to use the trial of Sublime text 2 and was wondering if there is any function or plugin for me to convert block of HTML to javascript string ?
I have try to search but couldn't find anything. Thanks!
Sublime text doesn't perform any parsing/converting functions, it's just a very pretty and useful text editor with various syntax highlighting, and as far as I'm aware most plugins for it are either for visual styles/highlighting or version control, not converting from one thing to another.
Saying that, if you want to convert HTML to a Javascript style string try this: http://www.accessify.com/tools-and-wizards/developer-tools/html-javascript-convertor/
K. L., I am also reading this book and I gone through the same situation. I am using Notepad++ and could not find a way of doing this conversion directly from the editor. Then, I decided to download and install the vim editor (http://www.vim.org/download.php) and I made the configuration suggested by the authors on pages 73-74. It worked fine. Maybe I will try to make it work on Notepad++ in the future, but, for now, I can continue my reading. Hope this helps.

Nice looking xhtml/html when I "View Source"?

I'm just curious if anyone has any tricks on how to keep source code looking good when you "View Source." I'm militant about keeping my code well formatted and spaced while I'm developing and I tend to "View Source" a lot to double check the output (when firebug is overkill). When I start using RenderPartials and RenderActions and anything in the tag it gets pretty messy.
I don't want to send too many extra characters to the browser to keep file size efficient but is there a way to force the xhtml/html to do a newline or tab? I tried a couple of things that didn't work. Thanks!
Get over it.
Don't worry about how it looks in 'view source'; worry about how it looks in csharp :) If you get worried about the efficiency of the HTML you can gzip it, and other such things.
I use firefox's ViewSourceWith extension to view the source in a code editor (in my case SciTe) in which I have a macro programmed so that when I press Ctrl-1 it reformats the HTML using a script I've written.
If validation is the goal then consider using a HTML validator rather than your eyeballs. Total Validator looks good.
Just send a \n and it should come out as a newline in the "view-source" section of the browser.
Example:
public static String Etc(...)
{
TagBuilder myTag = new TagBuilder("span");
myTag.SetInnerText("I'm mr. tag-content!");
return myTag.ToString(TagRenderMode.Normal) + Environment.NewLine;
}