Is it possible to add Google Analytics to doxygen generated files? - api

Is it possible to add Google Analytics to the HTML files generated by doxygen dynamically (e.g. in the Doxyfile) at the time they are auto-created? Can someone give an example of how this could be done from within the GUI or from within the Doxyfile?

Assuming the same HTML code needs to be added to each of the generated HTML files, you could replace Doxygen header using the HTML_HEADER option on the Doxyfile:
HTML_HEADER= = header.html
Doxygen can generate an initial header.html using the following command:
doxygen -w html <header> <footer> <stylesheet>
Where <header>, <footer> and <stylesheet> are the filenames that should be generated for the respective components.

Related

Keystone.JS render multiple template files

I use keystone.js together with handlebars as template engine. Until now I had one .hbs-file for each page. However, HTML-Code is growing over time and I would like to split the HTML into several files. Does keystone.js offer a simple way to render multiple template files?
I'd prefer not to use technologies like webpack just for that "simple" task.
You can use partials to break up your templates, so you can include one .hbs file in another file.
Add a new file in the templates/views/partials directory, for example myPartial.hbs, and then you can include it in another file like so:
{{> myPartial }}
KeystoneJS will handle registration of .hbs files in the templates/views/partials directory.
You can read more here:
http://handlebarsjs.com/partials.html
If you use the KeystoneJS generator to set up your project, you can see this in action where pagination.hbs is included in blog.hbs.

How to use Pingendo 4 with themes and templates

I'm using Pingendo V4 (not-beta).
I assume templates are partly completed pages that I can start with and modify, and that Themes are only selections of shapes, colors that I can use on my own pages. Is that correct?
Can I download a (I assume Bootstrap) theme or template, use it locally and then transfer the files to my web site? How is the download done and them integrated with Pingendo?
Thx.
Templates are completed pages that you can edit and customize to your liking. Themes are sets of customizations. Sometimes themes and templates are made for particular business types, for example pingendo has a app, resteraunt, and fasion templates complete with there coresponding themes. With Pingendo you can download your theme by doing the following: Go to the HTML tab, which gives you the HTML view of your page. Copy and paste that into your own index.html page. Secondly go to the sass view in Pingendo and copy and past it into a custom.sass file that you create. Keep in mind you will want to convert that sass to css, there are free tools that do this online. Depending on your webhost the method of putting them online will be different. Most of the time you will need to FTP your files on to the server, put your html into the main folder may be names something like public_html. Put your css into a folder in the main folder called css, make sure your link to the css in your index.html reflects the file path. Once you have it downloaded there is no need to reintegrate it into Pingendo, the only time you will need to go back there is if you need to make changes. Of course you could always hand code the changes as well.

Is there a download function in jsFiddle?

Is there a download function in jsFiddle, so you can download an HTML with the CSS, HTML and JS in one file, so you can run it without jsFiddle for debug purposes?
Ok I found out:
You have to put /show a after the URL you're working on:
http://jsfiddle.net/<your_fiddle_id>/show/
It is the site that shows the results.
And then when you save it as a file. It is all in one HTML-file.
For example:
http://jsfiddle.net/Ua8Cv/show/
for the site http://jsfiddle.net/Ua8Cv
New answer to an old question:
Method 1:
Step 1: You have to put /show after the URL you are working on:
http://jsfiddle.net/<fiddle_id>/show/
It shows the output with a result header.
Step 2: Right click the bottom frame and select View Frame Source. That's it. You got the html code with online JS links, CSS.
Just Save it.
For Example:
http://jsfiddle.net/YRafQ/20/show/
for the site http://jsfiddle.net/YRafQ/20/
Note: View Frame Source and not View Page Source
Method 2:
You can use this code: view-source:http://fiddle.jshell.net/<fiddle_id>/show/light/
For Example: For my fiddle_id: YRafQ/20
view-source:http://fiddle.jshell.net/YRafQ/20/show/light/
Step 1:
Go to a fiddle page like jsfiddle.net/oskar/v5893p61
Step 2:
Add '/show' at the end of the URL, like jsfiddle.net/oskar/v5893p61/show
Step 3:
Right click on the page and click on the View frame source. You will get the HTML code including CSS in tag and Javascript (js) in tag. [Also source link of all library will be added].
See screenshot
Step 4:
Now you can save the source code in a .html file.
Adding /show does not present a pure source code, it's an embedded working example. To display it without any additional scripts, css and html, use:
http://fiddle.jshell.net/<fiddle id>/show/light/
An example:
http://fiddle.jshell.net/Ua8Cv/show/light/
No, JSFiddle doesn't have a download feature. However, it's not very difficult to get around that and save the contents of a fiddle anyway.
Since the time the accepted answer was posted, JSFiddle has made some recent UI and backend changes that affect the way a fiddle should be downloaded. Note the updated procedures below.
Simple Commandline Method
This method only downloads the fiddle's HTML, JavaScript, and CSS as a single file. The fiddle's external resources are not saved.
In the commandline shown below, fiddle_id refers to the ID number of the fiddle. For a fiddle with the URL "http://jsfiddle.net/<fiddle_user>/<fiddle_id>" or "http://jsfiddle.net/<fiddle_id>", only the fiddle_id is needed. The fiddle_user is unimportant.
At a shell prompt, enter the single commandline:
fiddleId=fiddle_id; curl "http://fiddle.jshell.net/${fiddleId}/show/" -H "Referer: http://fiddle.jshell.net/${fiddleId}/" --output "${fiddleId}.html"
The fiddle will be saved to a file named "fiddle_id.html".
Longer Browser Method
This method downloads the fiddle as well as its external resources. The steps given are based on using Google Chrome. Using other web browsers should work as well, but they may use different filenames.
Select the "Share/Embed" menu/link at the top of the JSFiddle edit page. In the dialog box that appears, copy the URL shown in the "Share full screen result" field. It will be of the form "http://jsfiddle.net/<fiddle_user>/<fiddle_id>/embedded/result/" or "http://jsfiddle.net/<fiddle_id>/embedded/result/".
Open a new browser window and paste in the URL copied in the previous step. Load that page.
Use your browser's save feature to save the page and all of its resources to your local computer. To save all the resources using Google Chrome, for example, be sure to select "Webpage, Complete" in the "Format" menu. Be sure to specify a name for the page. Let's say it's named "fiddle.html" for this example.
After the page is saved to your computer, you will have the "fiddle.html" file and a directory named "fiddle_files". The file "fiddle.html" is the wrapper page that JSFiddle uses to display a header with a "Result" title and other links. It will load your fiddle in an iframe element. For the most part, this file can be ignored or even deleted. Your fiddle's HTML, JavaScript, and CSS content will all be saved in the "fiddle_files" directory as a single file named "saved_resource.html".
Copy "fiddle_files/saved_resource.html" to wherever you'd like to use it. If your fiddle included items under "External Resources", those will also appear in the "fiddle_files" directory. Be sure to copy those files to the same place to which you copied "saved_resource.html", because the HTML file will refer to those resources using relative URLs.
As mentioned earlier, other browsers may name the files differently when they are saved. For example, Firefox names the combined HTML/JS/CSS file "fiddle_files/a.html".
Still no download functionality supported.. BUT.. you can use the jsfiddle-downloader node script.
Installation:
npm install jsfiddle-downloader -g
To download a single fiddle from its id:
jsfiddle-downloader -i <fiddle-id> [-o <output file>]
To download a single fiddle from its url:
jsfiddle-downloader -l <url> [-o <output file>]
jsfiddle-downloader -l jsfiddle.net/<user>/<fiddle-id>
jsfiddle-downloader -l https://jsfiddle.net/<fiddle-id>
jsfiddle-downloader -l https://jsfiddle.net/<user>/<fiddle-id>/show/ -o myfiddle.html
To download all scripts of a determinated 'user' from jsFiddle.net:
jsfiddle-downloader -u <user> [-o <output file>]
It'll download all backups in the currrent directory, the jsFiddles scripts will be named as:
[<output-folder>/]<id-fiddle>.html
The best way is:
Right-click on the output panel.
Choose view frame source, then the whole code will appear.
After that you can copy that code, and paste it in your computer.
You have to put /show a after the URL you're working on:
For example:
"http://jsfiddle.net/rkw79/PagTJ/show/"
for Field URL :
"http://jsfiddle.net/rkw79/PagTJ/"
after that save the file and go to the show folder(or the file name you have saved with) under that folder u will get a html file show_resource.HTML .that is your actual file.now open it in browser and view the source code. Best of luck--------Ujjwal Gupta
In a recent work I had to download a list of fiddle urls and create separate folder for each fiddles having separate html css js file for each, i have created the following crawler program for this.
https://github.com/sguha-work/FiddleCrawler
.It will create folder name with counter value and each folder will have a html, a css, a js and a details file. (The details file will holds the links of external resources).
I found an article under the above topic.There by I could take the full code .I will mention it.
Here are steps mentioned in the article:
Add embedded/result/ at the end of the JSFiddle URL you wanna grab.
Show the frame or the frame’s source code: right-click anywhere in the page and view the frame in a new tab or the source right-away
(requires Firefox).
Finally, save the page in your preferred format (MHT, HTML, TXT, etc.) and voilà!
also you can find it : https://sirusdark.wordpress.com/2014/04/10/how-to-save-and-download-jsfiddle-code/
You can download using this package in node js,
https://www.npmjs.com/package/jsfiddle-downloader
There is not such a proper way to download all the things all together from JSFiddle but there is a hack way to do just that.
Simply add "embedded/" or "embedded/result/" at the end of your JSFiddle URL!, and then you can save the whole page as an HTML file + the external libraries (if you wants).
If you want to download all of your fiddles to an offline folder, there is a script available for this:
https://github.com/isonno/DownloadJSF
Try copying and pasting your code into WebDen and then downloading it from there. Only drawback is that it only supports pure JS, html, and css, so any other code may need to be downloaded another way.
Okay, the easiest way, I found out was just changing the url (jsfiddle[dot]net) to fiddle[dot]jshell[dot]net/
There u have a clear html code, without any kind of iframe...
Example:
https://jsfiddle[dot]net/mfvmoy64/27/show/light/ -> http://fiddle[dot]jshell[dot]net/mfvmoy64/27/show/light/
(Must change the '.''s to "[dot]" because of stackeroverflow... :c)
PS: sry 4 bad english
There is npm-package jsfiddle-downloader.
Use http://jsfiddle.net//show/light/
then just use inspect element function of browser. you will get code in iframe tab. . in chrome just right click and cick on edit as html tab. and copy the html content. that is your actual code.
Ctrl + S, saves the entire fiddle, inside the files folder there is the clean page you are looking for

Can Doxygen process pages other than MainPage.dox

If you put a MainPage.dox file in Doxygen's search path, it will add it to the output in Doxygen/html above the source documentation. But can you have multiple files like MainPage.dox? Or are you limited to one?
Doxygen will recognize and parse any file that has a *.dox extension and include it in the resulting documentation. What those files will produce is dictated by the doxygen comments located in the file. For example, if you want to modify the main page, you'll need a comment like:
/**
* #mainpage
* Documentation you want to occur on the main page.
*/
You can also create documentation that should appear on other pages using this technique:
/**
* #page another_page Another Page
* Documentation that will occur on another page.
*/
Assuming HTML output, this form will create a file named another_page.html at the same level as index.html. The title will be Another Page, and the content referenced will follow. An additional tab will also be produced named Related Pages which will have links to all of the related pages created in this manner.
Blocks like this can occur in any file that doxygen parses (including header or source files), and can contain definitions for multiple pages (both of the comments above could be in a single file). The file they're located in does not have an impact on the output that is produced.
As of 1.8.4, .md markdown pages can also be included as separate pages without need for .dox C++ like comments /** */ if they are to be considered by doxygen according to your INPUT and FILE_PATTERNS configs.
One difference between using .md and .dox is that .md files produce a Related page with the same name as the basename without extension of the .md file, while .dox only produces pages with names given by \page commands.
It is still possible to use \page commands from .md files.
For example, if file md_page.md contains:
Inside md_page.
\page md_page2 Md Page 2
Inside md_page2
this will generate 2 pages under "Related Pages" entitled:
md_page
Md Page 2

How do I turn a ColdFusion page into a PDF download?

I would like to turn the HTML generated by my CFM page into a PDF, and have the user prompted with the standard "Save As" prompt when navigating to my page.
You should use the cfdocument tag (with format="PDF") to generate the PDF by placing it around the page you are generating. You'll want to specify a filename attribute, otherwise the document will just stream right to your browser.
After you have saved the content as a PDF, use cfheader and cfcontent in combination to output the PDF as an attachment ("Save As") and add the file to the response stream. I also added deletefile="Yes" on the cfcontent tag to keep the file system clean of the files.
<cfdocument format="PDF" filename="file.pdf" overwrite="Yes">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Hello World</title>
</head>
<body>
Hello World
</body>
</html>
</cfdocument>
<cfheader name="Content-Disposition" value="attachment;filename=file.pdf">
<cfcontent type="application/octet-stream" file="#expandPath('.')#\file.pdf" deletefile="Yes">
As an aside: I'm just using file.pdf for the filename in the example below, but you might want to use some random or session generated string for the filename to avoid problems resulting from race conditions.
If you want to avoid storing the PDF at all, using cfdocument without a filename will send the pdf (of flashpaper) directly to the browser without using the cfheader and cfcontent.
Caveat: Like with using cfheader/cfcontent, you need to do this before the cache gets flushed to the browser, since it's basically doing the same thing without having to store the file.
To get the content, I would probably use cfsavecontent wrapped around the same calls/includes/etc. that generate the page, with two major exceptions. cfdocument seems to have issues with external stylesheets, so using an include to put the styles directly into the document is probably a good idea. You can try using an #import instead -- it works for some people. Also, I'd be careful about relative links to images, as they can sometimes break.
The <cfdocument> approach is the sanctioned way to get it done, however it does not offer everything possible in the way of manipulating existing PDF documents. I had a project where I needed to generate coupons based using a pre-designed, print-resolution PDF template. <cfdocument> would have let me approximate the output, but only with bitmap images embedded in HTML. True, I could fake print-resolution by making a large image and scaling it in HTML, but the original was a nice, clean, vector-image file and I wanted to use that instead.
I ended up using a copy of <cfx_pdf> to get the job done. (Developer's Site, CF Tag Store) It's a CF wrapper around a Java PDF library that lets you manipulate existing PDF documents, including filling out PDF forms, setting permissions, merging files, drawing vector graphics, tables, and text, use custom fonts, etc, etc. If you are willing to work with it, you can get some pretty spectacular results.
The one drawback is that it appears the developer has left this product out to pasture for a long time. The developer site is still copyright 2003 and doesn't mention anything past ColdFusion MX 6.1. I ended up having to break some of the encrypted templates in order to fix a couple of bugs and make it work as I needed it to. Nontheless, it is a powerful tool.
I'm not that familiar with ColdFusion, but what you need to do is set the Content-Type of the page when the user requests it to be application/octet-stream. This will prompt them for a download every time.
Hope this helps!