Add code to html pages automatically - html

I need to add some code to the of several html contained in a folder on my desktop. How can i do that?
I am using a prototyping tool (Axure) on Mac and I want to add some html meta tags to the generated pages. These pages can be overwritten every time I generate the prototype. What I need is a sort of script that I can launch after re-generating the prototype, to reinsert the code. There is something for windows but it doesn't work on Mac: http://joshuamorse.com/2009/01/14/axure-protonotes-an-alternative-to-protoshare/
thanks

This is a very simple problem to solve using a shell script.
If you are not familiar with scripting, then check out the Automator program built-in to OS X.
This provides a "visual" way of building automation workflows.
This is the basic steps that your workflow will need to perform.
Find the files that need updating.
For each file
Open the file using TextEdit
Tell TextEdit to Find the Head element and replace with the new Head Element that includes the script
Save the file.
Repeat

How about a simple find/replace in multiple files using something like this:
http://search-and-replace.en.softonic.com/mac
If you are able to create some sort of 'dummy' tag in Axure, you could use that as the 'find' that you could replace with your meta tags.
That seems to be a simple way to do what you want.

Related

How to use multiple of the same executable on UGUI

I am using this tool to create a simple GUI with it's easy to understand set up: https://github.com/UniversalGUI/UGUI
But from what I understand from its guides that it needs executables to be in different names so that it can differentiate itself and the form sending it. The project I am doing needs me to use the same command but with different arguments such as:
<cmd executable="xdg-open">
<arg>/home/kali/Downloads/</arg>
</cmd>
I need to open other folders in different parts of the program using that executable. In the guides, the person did use an .exe file which I figured is a script included in its folder and I did try to replicate it but to no luck. https://www.youtube.com/watch?v=qHMRroZ7AAw
The tool isn't used by many but those who do, do you know how to get over this issue?

How to run HtmlUnit.jar in terminal/command line?

I am searching for a way for testing my webpage using the command line.
My intentions are
check an anchor tag is present on the page
check the anchor tag href is pointing to the correct(pre-defined) web link
Check the anchor tag text is the pre-defined one
I should be able to check other tags also like img, script, etc.
After searching, I came across htmlUnit.jar. But I am not getting any proper link on how to run this in the command line.
Will I be able to pass the test cases to the jar file? If so, please guide me
What is the syntax to run this htmlUnit.jar file in the terminal? I am unable to find any useful documentation
Please help if I can achieve my goal by this file
HtmlUnit is a library, you have to write your own program using HtmlUnit for your use case.
Another option is to use Wetator (www.wetator.org).
Wetator is
based on HtmlUnit
runs from the command line
can perform the different asserts you like to do
generates a nice report (and also a return code if at least one assert fails)
(Ok, i'm the person behind HtmlUnit and Wetator so maybe i miss some other option)

How to say to PhpStorm/WebStorm where the including file resides?

Any web project consists of lots of partials that are included into the main file. Very often IDE (PhpStorm for my case) doesn’t know where the including partial resides. The thing is sometimes we use absolute path (e.g. in AngularJS to specify where views’ or directive’s templates reside) and relative path in preprocessors’ sources (jade, stylus, coffee, etc.). And all these files can be stored somewhere in the folder structure.
Therefore very often you can’t to open the including file right from the main file using Ctrl+B.
I think there is a way to tell IDE where this file actually resides. Does anybody know how to cope with it?
If there is no way, I suppose we should ask the developer to solve it somehow.
Depending on the particular framework in which you're developing, a PhpStorm plugin might exist to make CTRL+B navigation possible. For instance, using the Symfony plugin (installed via Settings > Plugins), CTRL+B navigation into a partial template becomes possible in code like this:
return $this->render('hello/world/index.html.twig');
If a plugin is not available, try the following steps. It's not a perfect solution, but it's better than nothing! It's also extremely quick once you get the hang of it.
With your cursor inside the string containing the path and filename, use the 'Extend Selection' keyboard shortcut until the entire string is highlighted (excluding any wrapping single/double quotes). If you don't currently have the 'Extend Selection' action mapped, you can do so via Settings > Keymap.
Immediately use the 'Navigate to File' shortcut (CTRL+SHIFT+N) to search for all files matching the path/filename contained in the string you previously highlighted.
A dropdown box will appear containing all matching files. Find the proper one and open it using ENTER.

Add a new command to notepad++

Notepad++ is my go to editor for most things. I would like to develop a new command(keyboard shortcut) for doing something unique. Anybody has any pointers regarding how I can do this?
I would like to create a command which arranges selected text in certain order based on the characters found. I would also like create a keyboard shortcut for running the same command.
You have several options:
develop a macro - examine Macros dropdown menu in Notepad++
use AutoHotKey which can send keystrokes/mouseclicks, run apps/DLL's, work with clipboard, read any system settings, take values from input boxes and many more. Please see here for its sample usage with Notepad++
use JN plugin for Notepad++ and script your functionality in JavaScript - example. Similarly, there is a Python scripting plugin, too.
write your own N++ plugin. You get the best control, but without experience this is the most difficult option.

How to search a word in a html file without any java coding?

I'm doing a project in Java which creates a user manual (html files that are linked together like Windows "Help and support centre") of software. Now once a user manual is created I have only html files remaining. Now I want to search html file that contains specified keyword(Search Engine).How can I do this without Java code??
grep, find, python script, or open any file with a text editor and try edit->search
(on windows use windows search in file)
If all of your other code is written in java, then it'll be sensible (without knowing your usecase) to use java for searching as well. You might of course use some commandline programs as grep or find - or built in search functionality in a webbrowser, but if the search should be part of a java application anyway, why not go for java and e.g. Lucene?
If this 'help' is going to be online than you can embed google search in it (limiting the search results to specified site:). Alternatively if you're hosting the pages yourself you can use htdig for indexing the pages.
However if it's going to offilne you'll be better of by generating a static index page with links to topics. In order to create a more help-system-alike user experience you can hide the contents of the index in the invisible html DIV tags and add a JavaScript that takes searched phrase as an input and that unhides the matched words with their links.
Maybe I'm missing something, but have you looked at javahelp? It has indexing and searching built in, and can be used online or offline.