Sublime text 2 convert html to javascript string - sublimetext2

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.

Related

Fixing a PDF Accessibility Issue (Alternative description missing for an annotation) when converting an HTML Page to PDF

Currently, I am working on a program that converts an html page into a PDF using the iText Library.
The Checker that I am using is PAC3 -->PDF Accessibility Checker 3 which is described by the following link (https://section508.gov/blog/check-pdf).
One of the issues is the “Alternate description missing for an Annotation”
An excerpt from the following link explains it:
http://www.uottawa.ca/respect/sites/www.uottawa.ca.respect/files/fss-fixing-accessibility-errors-in-pdfs.pdf
Alternative description missing for an annotation This usually happens when the link is not clear enough. To fix this error, add alternative text to the link tags. To add the alternative text, please do the following;
In the tag tree, select the tag for the link, and select Properties
from the options menu.
In the Touchup Properties dialog box, select
the Tag Tab.
Type alternate text for the link, and click close
I have been trying to use iText to fix this problem, but googling, looking at the source and reading the documentation does not help.
Does anybody have any suggestions on how to either write the HTML or use the itext problem to get rid of the “Alternate description missing for an Annotation”
Thank you for your help
You did not specify whether you using old code (XMLWorker, HTMLWorker) or new iText code (pdfHTML).
This of course impacts the proposed solution.
In my answer I am going to assume you are using pdfHTML
There are several options:
edit the incoming HTML using a library like JSoup
convert the incoming HTML to iText IElement objects, and edit those, setting properties where needed
write your own custom TagWorker that handles all instances of a specific tag, and write custom logic to deal with the missing annotations.
An example of a custom tag worker can be found here:
https://developers.itextpdf.com/content/itext-7-examples/converting-html-pdf/pdfhtml-custom-tagworker-example

Indent the text in docbook

I want to indent my text in the article I am writing in docbook 5. I also need to add colors to my text. Is that possible? If so how? I tried indenting as follows but it was not visible when I took the html output of it.(Here I tried to align the text "Kerfun" to the center) I have no idea regarding the colour change. Can someone please tell me how? Where have I gone wrong?
<dbk:para text-indent="center">Kerfun</dbk:para>
<dbk:para text-indent="center">
<dbk:emphasis role="bold">Fadiah</dbk:emphasis>
</dbk:para>
You haven't specified your OS or toolchain.
To format your xml:
I'd suggest using the "xmllint -format" command
To validate your xml:
Same command could be used to ensure your document is valid against the docbook schema
To colorize your xml:
That very much depends on what editor you use. Personally I'm a fan of gvim which has XML high-lighting enabled by default.
Update
As stated I'm not a windows guy but 2 minutes of googling lead me to the following:
Notepad++ appears to have an XML plugin. Source was the following link

Format Code In MonoDevelop

I am using MonoDevelop on Mac to write MonoTouch apps. Automatica code indenting/formatting works great while I am typing.
The problem is that when I copy and paste code snippets, in many cases I lose the formatting and lines are combined together, indenting is lost, and it is a huge pain to implement the tabs, spacing, and line breaks manually. Is there anyway I can use a command in monoDevelop to automatically indent and apply the formatting to existing code.
I thought maybe Edit|Format|Format Document/Selection would work, but these commands don't have any affect on the code at all.
Any help?
To format the entire document in one keystroke: control-I
To format a selection: Edit->Format->Format Selection
To customize the formatting: MonoDevelop->Preferences->Source Code->Code Formatting
You actually need to select all your text, and then go to Edit->Format->Format Document. It doesn't seem to work otherwise.
For me on macOS, the shortcut for "auto-format" is CTRL + i.
You can change the shortcut if you want. To change it, go to Preferences -> Key Bindings, then type "format" in the search box and edit the "Format Document" shortcut/key binding.

JavaDoc editor for Eclipse to create formatted text

im looking for a small plugin which let me create formated javadoc. at the moment im doing it with word (or http://tinymce.moxiecode.com/examples/full.php ) and save the text as a html file which then can be used but i think there must be a easier solution to create nice looking java doc..
JDocEditor is an Eclipse plugin that lets you write Javadoc in a WYSIWYG editor window:
http://www.certiv.net/projects/jdoceditor.html
You can probably use this
http://jautodoc.sourceforge.net/

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