QTestLib: Undocumented command line argument -chart - qt

In Qt 4.6 QTestLib supports the command-line argument "-chart" (but this is undocumented).
A report.html is created, however neither Firefox 3.6 nor IE8 are able to display anything but the headline "Test". When I look into the html-file it has some JavaScript stuff and test results, so there should be something to display.
As -chart is undocumented, I'm not sure I use it the correct way.
Any hints?
Thanks.

Try using it in combination with the -xml option. I suspect the Javascript reads in an XML file to generate the chart, not sure though.
Also, it might have something to do with this Qt labs blog post: http://labs.trolltech.com/blogs/2008/12/05/qtestlib-now-with-nice-graphs-pointing-upwards

How about looking into the produced HTML file with a text editor?
Other than that, reading the source code of QTest might help.
I assume it's some semi complete experimental feature.

Related

atom.io auto create html basic structure

Im using atom.io for some time now and really like it. there is just one thing im missing. I used to use brackets and sublime before and they both had a feature where you could create the basic structure of a html documents by just typing html.
this would just set the html, head and body tag. created the charset meta, title and link to css file.
I create a lot of html files a day so it would be really helpfull if I know the shortcode or the package which supports this!
You're looking for autocomplete-snippets.
Simply type html and press Enter
Here's a terrible GIF to prove it:
There is a nice Plugin, called emmet: https://atom.io/packages/emmet
When you got that, you just have to type ! -> tab in an empty document. You get pretty much the same result as #hatchet GIF.
If you have disabled the autocomplete functionality mentioned in the currently accepted answer, or want more flexibility than that allows, there is a file-templates package:
https://atom.io/packages/file-templates
Here are some basic instructions.
To install the package: edit->preferences->install->file-templates.
To save the template: packages->new template from this file.
To open a new file with that template, just hit ctrl-alt-n and
select it.
Make sure your file has .html added on the end of its name.
Then go back into Atom, type HTML, and press enter. Your boilerplate should appear. Solved my problem instantly!
If we install Emmet package we are not getting the boiler plate code. So I disabled emmet and it is working fine for me.
!tab is the command u seek. But it won't work unless you create a file and save it with the html extension...
So go create a new file in the directory u want, call it index.html and now go type !tab
It should work 100%, if not be sure u have emmet installed.

Does wkHTMLtoPDF support #page rules?

I've been trying to use this simple command to explore wkHTML2PDF abilities:
wkhtml2pdf test.htm test.pdf
It seems it doesn't support #page rules that might be included in an attached CSS file, or do I miss something? some parameters for examples?
The short answer is No. As #skobajic mentioned, there are command line parameters to get the same functionality. I don't see it coming any time soon given that webkit doesn't support it.
https://github.com/wkhtmltopdf/wkhtmltopdf/issues/2200
https://bugs.webkit.org/show_bug.cgi?id=15548

Use a Pygments lexer with no mime type in Trac?

I'd like to have Trac colorize my aspx files but I can't find a way to make it work. I can easily add a mime-type/extension mapping for most Pygments lexers, but the CSharpAspxLexer doesn't have an assigned mime type (see http://pygments.org/docs/lexers/#lexers-for-net-languages). I've tried a couple things but I don't see a way to connect the [mimeviewers] section to Pygments without a mime type. The CSharpLexer works automatically and looks great, but only for .cs files (as it should).
I'm using Mercurial as a repository so I can't set the mime type manually; that's not a good solution anyways. My Trac installation is in Windows. Any thoughts?
I just render it as XML, and the same for a number of other similar files for typical Windows .Net development. My mapping looks like this:
[mimeviewer]
mime_map = text/xml:aspx:ascx:master:resx:config:sitemap:wsdl:disco:map:asmx:mxml:csproj, ...
However, I think you can also enable aspx via the pygments_modes setting (and you need to remove it from the mime_map):
[mimeviewer]
pygments_modes = text/plain:aspx-cs:7
To my knowledge that won't handle ascx and other (very) close relatives of aspx, so I don't use the setting as I find it better to render all variants using the same lexer. And also, I think the XML lexer works really well.

How can I modify a CSS file programmatically?

I have a legacy application that I needed to implement a configuration page for to change text colors, fonts, etc.
This applications output is also replicated with a PHP web application, where the fonts, colors, etc. are configured in a style sheet.
I've not worked with CSS previously.
Is there a programatic way to modify the CSS and save it without resorting to string parsing or regex?
The application is VB6, but I could write a .net tool that would do the css manipulation if that was the only way.
You don't need to edit the existing one. You could have a new one that overrides the other -- you include this one after the other in your HTML. That's what the "Cascading" means.
It looks like someone's already done a VB.NET CSS parser which is F/OSS, so you could probably adapt it to your needs if you're comfortable with the license.
http://vbcssparser.sourceforge.net/
One hack is to create a PHP script that all output is passed through, which then replaces certain parts of CSS with configurable alternatives. If you use .htaccess you can make all output go through the script.
the best way i can think of solving this problem is creating an application that will get some values ( through the URL query ) and generate the appropriate css output based on a css templates
Check this out, it uses ASP.NET and C#.
In my work with the IE control (shadocvw.dll), it has an interesting ability to let you easily manage the CSS of a page and show the effects of modified CSS on a page in realtime. I've never dealt with the details of such implementations myself, but I recommend that as a possible solution worth looking at. Seeing as pretty much everyone is on IE 6 or later nowadays, you can skip the explanations about handling those who only have IE 5,4,3 or 2 installed.
Maybe the problem's solution, which is most simple for the programmer and a user is to edit css via html form, maybe. I suppose, to create css-file, which would be "default" or "standart" for this application, and just to read it, for example, by perl script, edit in html and to write it down. Here is just the simple example.
In css-file we have string like:
border-color: #008a77;
we have to to read this string, split it up, and send to a file, which will write it down. Get something like this in Perl:
tr/ / /s;
($vari, $value) = split(/:/, _$);
# # While you read file, you can just at the time to put this into html form
echo($vari.":<input type = text name = ".$vari." value = ".$value.">");
And here it is, you've got just simple html-form-data, you just shoul overwrite your css-file with new data like this:
...
print $vari[i].": ".$value.";\n";
...
and voila - you've got programmatical way of changing css. Ofcourse, you have to make it more universal, and more close to your particular problem.
Depending on how technically oriented your CSS editors are going to be, you could do it very simply by loading the whole thing up into a TextEdit field to let them edit it - then write it back to the file.
Parsing and creating an interface for all the possibilities of CSS would be an astronomical pain. :-)

Are there any tools out there to compare the structure of 2 web pages?

I receive HTML pages from our creative team, and then use those to build aspx pages. One challenge I frequently face is getting the HTML I spit out to match theirs exactly. I almost always end up screwing up the nesting of <div>s between my page and the master pages.
Does anyone know of a tool that will help in this situation -- something that will compare 2 pages and output the structural differences? I can't use a standard diff tool, because IDs change from what I receive from creative, text replaces lorem ipsum, etc..
You can use HTMLTidy to convert the HTML to well-formed XML so you can use XML Diff, as Gulzar suggested.
tidy -asxml index.html
If out output XML compliant HTML. Or at least translate your HTML product into XML compliancy, you at least could then XSL your output to remove the content and id tags. Apply the same transformation to their html, and then compare.
I was thinking on lines of XML Diff since HTML can be represented as an XML Document.
The challenge with HTML is that it might not be always well formed. Found one more here showing how to use XMLDiff class.
A copy of my own answer from here.
What about DaisyDiff (Java and PHP vesions available).
Following features are really nice:
Works with badly formed HTML that can be found "in the wild".
The diffing is more specialized in HTML than XML tree differs. Changing part of a text node will not cause the entire node to be changed.
In addition to the default visual diff, HTML source can be diffed coherently.
Provides easy to understand descriptions of the changes.
The default GUI allows easy browsing of the modifications through keyboard shortcuts and links.
winmerge is a good visual diff program

Resources