How to view html output in Notepad++? - editor

How do I view my Code output in Notepad++ as a webpage or something similiar?
I have built something but I can't find a button or something like that in Notepad to view it as a webpage or something similiar.

If it is a webpage written in html:
just go where you saved it and click it.
If it is in php:
You will need a web server, save the file in the www directory. and access it like this:
http://localhost/yourfile.php

Simply, save your file with the correct extension in this case html, then click run , in the run menu click launch in, (in whichever is your browser) in my case, chrome.And it should work(:

Add this plugin in Notepad++: Preview HTML but it opens only in IE

To setup Notepad++ for testing your markup or code there are a few things to consider.
When Notepad++ launches do you want a test document opened by default?
What language do you prefer the document to be opened as?
What browser do you wish to test your test file in?
Do we want a shortcut to open test in browser?
If you do not have your local environment setup to run server-side scripts you will be limited to what the browser supports.
In my example setup I will be using .php as my language. There are some variables, but I've chosen what I believe best suit my needs. I'm also using a windows machine.
Create a new file in C:\Program Files (x86)\Notepad++ (or wherever) as php.php (or whatever). This will be the document we keep open and will remain open so long as we never close it.
In Notepad++ go to Settings > Preferences > New Document
In the bottom left there is a drop-down. Select your language (php in my case).
Open php.php in Notepad++.
Go to Run > Modify Shortcut / Delete Command and locate your desired browser (note: this may not work as expected in some browsers i.e. Internet Explorer, go figure).
Create a custom shortcut so your document can be launched to test (unless you are happy with what is already setup).
This will effectively keep your default file open in Notepad++ every time it is launched in your preferred language and allow you to quickly test your markup.

Cntrl + Alt + Shift + I(Alphabet if you want to open in Internet explorer)
I hope this will work.

Related

InstallAnywhere Readme files

I am using InstallAnywhere 2012. In the post-install section the installer is showing a readme . There are internal and external links in the readme file. The internal ones are not working(it is not navigating to the respective section of readme).
I tried to open the readme.html in a browser and there it works fine.
If I were doing this in the shell, the syntax would look something like..
"C:\Users\myuser\AppData\Local\Google\Chrome\Application\chrome.exe" "file:///C:/Users/myuser/Desktop/index.html#anchor1"
here's one, admittedly crude, way to do that in IA:
1) employ a small jar program that finds browsers (stackoverflow)
2) then your program will compose a couple of strings and write them to a .bat or .sh file - ie the command(s) string to open the browser and the string for your local readme
3) then your program can either pass the "special folder" back to IA using custom code, or, for expediency, execute it directly if you don't care how it happens.
4) this produces a browser scrolled down to the right anchor.
the alternative actions of "open default browser", or "launch file", provided by IA api seems to strip (or not allow) the #anchor annotation in url's.

Lua - how to write string to editor or browser window

I have an app written in Lua with wxLua. While this app is running, I want to be able to send a (large) string to an external program so the user can view the string, search it, etc.
This external program can be notepad, notepad++, etc, or even a browser window, as long as the user can view and search the text.
I can open open an editor using
local handle = io.popen("notepad", "w") -- for example
but then
handle:write (myString)
doesn't show anything in the editor. And notepad++ doesn't even open a new window if I already have it running.
I can launch a browser using
wx.wxLaunchDefaultBrowser ("http://stackoverflow.com")
but I don't know how to pass the (100-200kb) string to the browser window.
Any help is very much appreciated, thank you!
Stomp
Print out text or HTML file and then open it in browser with wx.wxLaunchDefaultBrowser ("file://path/to/file") or use os.execute to run external editor with same file as argument.
See Oleg's post for the best solution, IMO.
Another solution would be to place your text on the clipboard, so the user could paste it wherever they like.
As for injecting text into apps that are already open, that's non-trivial and beyond the scope of what you can do with wxLua. You'd need to use COM interfaces or traverse the apps' control structures using Win32 API calls or something equally hairy and often app-specific.

Zope external editor with upload-on-save (Notepad++ prefered)

We are doing webdevelopment with Zope.
The web-editor is just horrible. No syntax highlighting, no in-text-tabs, nothing you can work with.
I installed Zope External Editor. It is now possible that I click the "use external editor" button on every element and it creates a temporary file and opens it in Notepad++, awesome.
But one important thing fail: it doesn't save back to Zope when I save the file. I still have to copy the code back to Zope manually.
I also searched for syntax highlighting extension for chrome/firefox at least to highlight the code (but I prefer Notepad++ with upload-on-save).
Can someone help me with that?
Did you also download the ExternalEditor Helper application?
Your browser should open the helper application, which will then open the editor (which you can specify in the configuration, see last point below). This is important because the helper application is responsible for sending changes back to Zope, which it does by keeping an open WebDAV session while you are editing.
You should download the latest helper app here: http://plone.org/products/zope-externaleditor-client
From that page:
Under Windows: Install the windows binary executable.
Open your page in your web browser and click on the link 'edit with external application'
Associate the file with Zope External Editor and make it permanent (first time only)
The file is opened in the editor defined in windows registry with certain editors, a message will ask whether the edition is terminated or not;
keep it until you closed you file and say yes.
If you want to change your default editor for certain content types , or if you want to add proxy parameters, open Zope External Edit in your program files menu and change your local user configuration.
The best option is to not develop Zope applications through-the-web anymore.
Use proper python packages, and you'll get to use your favourite tools without difficult integration with the server.

delphi prevent access files from TwebBrowser

I use TEmbeddedWB (internet explorer activex) in my projects.
I want to prevent people from uploading files:
ex: goto gmail.com and then attch a file: Internet explorer opens the upload file windows that allows people to access local disk.
Is there a simple way to prevent this windows from being displayed ?
Regards
It sounds like you are trying to "sandbox" your app so that your users cannot access the local file system. Perhaps you're building an app that is hosted on Citrix with multiple users, and if one of them "breaks out" of the app, they can run rampant through the file system on the server.
I don't know if there is a simple answer to this particular question, but I recommend that you look at the total problem before trying to solve the individual issues, as you may find that there are just too many. For instance, in the browser ActiveX, you can also "view source". That probably opens Notepad on the server. From there, you can run rampant. Do you have CHM help? From the help window, you can also access the "open file" dialog. Do you allow the user to open/save files through your regular menus? Same issue. How about hyperlinks? If your About box has a hyperlink, that's an easy way to pop open a browser. Can the user enter an address for browsing in your embedded ActiveX? If so, can they enter things like: C:\WINDOWS\system32\cmd.exe
You could decouple the navigation, do it yourself, sanitize the HTML then display the sanitized version. Unfortunately you would have to do this for ALL resources and would need to handle the numerous JavaScript libraries. For basic HTML, look for <input type="file". This would at least catch the basic usage, but not the more advanced usage.
A simpler solution might be to limit what URL's the browser can navigate too and only allow URL's you know are safe.
Assuming you don't want them to browse the local machine, if you solve the "open file" problem the same issue exists if you have a "save file" dialog. You may have to close those loops by replacing the browser popup menu with one that does not have any "Save x As..." options.

How Can I Automatically Execute A Link In Internet Explorer

I am trying to create an application to print documents over the web. I have created my document, and made a web page with a meta refresh tag, along the lines of this:
<meta http-equiv="refresh" content="3;http://example.com/download.epl2" />
I specify that the document has a content-type of application/x-epl2, and I have associated .epl2 files on my computer with a program that silently sends them to the printer.
I have put the website into my trusted sites zone.
Currently Internet Explorer pops up the "Open, Save, Cancel" dialog box with no option to automatically open the file.
Is there a setting in IE6/7/8 that I can use to have IE just open the file without prompting?
EDIT
The actual content of the file will differ based on the job, but essentially it is text that follows the Eltron Programming Language.
EDIT
I have accomplished this in both Chrome and Firefox by choosing "Automatically Open Files Of This Type From Now On"
EDIT
The machines this program will be used on will effectively be kiosks that are limited to only accessing my website from their web browsers, so I'm not worried about rogue websites sending documents to my printers.
EDIT
I am using PHP to generate the documents and HTML on the server side, though I expect the solution to be language agnostic.
I would expect that not to be possible, because then you could stumble onto a site that automatically loads and prints a 5000 page document or something, which would not be good.
If you always had a secret desire to develop a custom URL protocol (I know I do), this might be a good excuse to do it. ;-)
http://msdn.microsoft.com/en-us/library/aa767914%28VS.85%29.aspx
There are 1-2 prompts when opening such a link for the first time in IE, but you can choose to automatically open them after that.
I would use javascript to make this happen.
Javascript Window Open
EDIT
Since you have control of the windows box you could use an automate script process to interact with the print window.
autoit3: ControlClick
Write a small utility program that does nothing but send the file passed to it on the command-line to the default system printer.
Then, edit the registry under HKEY_CLASSES_ROOT to associate this program with the .epl2 filetype.
I don't have time to investigate it for You, but there were lots of exploits that could be helpful. Using ie6 without certain fixes seems helpful.
Also there should be an option called "Automatic prompting for file downloads". I use Linux nowadays so I can't chceck if it helps. I found it in some docs.
I'm on a Mac at the moment, but if this is possible in IE I would imagine this page holds the answer to it (or at least hints at it) http://support.microsoft.com/kb/883255
I believe what you're looking for is a setting in Windows, not IE:
Microsoft Support: Not Prompted to Specify Download Folder for File
Try using an older version of IE. Security was looser in the older versions and since it's a non-issue, this could be the quickest solution.

Resources