Tool or library to format any code to be displayed in HTML - formatting

As the title says. I need some tool, library or workaround which can take a code file i.e., JS, Python, C# etc and make that code displayable in HTML page.
Kind of like what GitHub do when someone tries to open a code in project.
It would be nice if there is some Python implementation for this. But others like nodejs, php, or plain js will do as well.
Any kind of help would be appreciated. Thanks!
EDIT:
Since, it's not allowed to get recommendation regarding libraries, I will add what I have attempted. So far I have been thinking only vital part while displaying the code will be to retain white spaces. So probably replace these with probably. But I'm sure there are better solutions out there. And that's exactly what I am here for.

Related

How to implement content assist / syntax highlighting?

I'd like to create an IDE for a language and I'm wondering how to implement some features. In particular syntax highlighting and content assist are troubling as they must work even when editor content is not valid (when user is typing syntax hightlight should not disappear just because parser fails).
I am wondering how to approach this problem (and others as well). I've found this: How does code completion work? with a description of a solution to this problem, but it's rather brief.
I can come up with a way to implement all features I want at some point, but I'm not the first one and someone has done it already ;) (and reading source code of Eclipse is not that easy)
So, my real question is there a book discussing problems related with creating IDE? A detailed article discussing how to parse invalid code? Any source of information I should see?
Ah, and by IDE I don't mean a new application, just a set of plugins for eclipse.
The following link will help you further..
Syntax Highlighting:Fast Colored TextBox for Syntax Highlighting
an OpenSource IDE:SharpDevelop
an eBook How to create IDE:[Dissecting a C# Application: Inside SharpDevelop]

Xcode 4 built-in help for your own files

Xcode 4 has a very nice built-in help/documentation that you can access e.g. by alt-clicking an identifier in the code, or by opening the help panel in the right sidebar. However, this only works for classes and methods provided by Apple. Is there a way to write some kind of documentation comments (e.g. like the Javadoc comments in Java) in your own code to make Xcode display them in those documentation panels?
http://developer.apple.com/library/mac/#documentation/DeveloperTools/Conceptual/HeaderDoc/intro/intro.html
It's maintained by Apple so it should be well supported. I never actually used it, may try it later.
Ok, it looks like there's no good tool really... there are a few different ones, but they're imperfect and difficult to configure. I couldn't get Doxygen or Appledoc to work, and the tool mentioned by Avizzv92 is referred to as "a pile of poo" elsewhere, so I'd rather not try it... :)
Info that I've found:
How do you document your source code in Xcode?
http://wangling.me/2010/07/documentation-set-generation-tool-in-xcode-is-wanted/
http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
http://www.gentlebytes.com/home/appledocapp/
http://lists.apple.com/archives/xcode-users/2011/Apr/msg00238.html

What Doxygen alternative would Dave DeLong use?

Yesterday, Dave DeLong answered a question of mine. It wasn't the answer I was looking for, but in the question he mentioned an alternative way of generating doxygen-style documentation for Objective-C.
Before I could really look into it, someone (maybe Dave himself) noticed the answer didn't match the question that well and removed it. *poof* gone was the link to that documentation tool.
I can't remember the name, but I'm fairly certain it's neither HeaderDoc nor Doxygen itself.
Dave, you out there? What was that link again?
I'm clearly not Dave DeLong, but I'd use appledoc, it's pretty darn awesome!
Developer Page quote:
appledoc is command line tool that helps Objective-C developers generate
Apple-like source code documentation
from specially formatted source code
comments. It's designed to take as
readable source code comments as
possible for the input and use
comments as well as surrounding source
code to generate visually appealing
documentation in the form of HTML as
well as fully indexed and browsable
Xcode documentation set. Although
there are several tools that can
create HTML documentation for
Objective-C, all of those know to me
fall short in meeting the minimum of
goals described below.
Human readable source code appledoc is designed to keep source
code comments as readable as possible
even within your source code editor.
Cross references to objects and members Creating cross references to
classes, categories or protocols is
straightforward and automated as much
as possible.
Apple-like source code HTML documentation Generate appealing
HTML documentation with the same style
as Apple's.
Xcode documentation set creation Generate and install fully indexed and
browsable Xcode documentation sets.
Documentation set can also be
automatically installed to Xcode.
Single tool from sorce code to doc set Single tool to drive generation
from source code parsing to
documentation set installation
Easily customizable output appledoc gives you a lot of command
line switches so you can parameterize
output. If this is not enough, you can
change any or all of the template
files to suit your needs.
100% Objective-C implementation The whole appledoc is written in
Objective-C, so you can easily change
it using familiar language and tools.
This also make debugging much simpler
and effective.

Dynamic web page convertible to PDF

I'm thinking about writing a professional CV page that would be easy to update, using a simple backend to add informations and blocks of optional details, and... (feature creap coming)
Anyway, I was thinking of a "simple" web page grpahically, that would easily be convertible to PDF file, using browser functionallity or not.
Assuming that the page have blocks of text that you must ckick a button to see (those are optional details), what should I know or what tools should I use to write this web page?
I'm totally rusted on web code, I used php without ajax a lot before but I understand the idea. I was thinking maybe it would be a good opportunity to try a framework to make a "webapp", like Ruby+ROR or Python+Django? Is that a good idea? I'm ready to learn about those, I'm just not sure if it's worth for such project.
Should I know some things about html code or javascript behaviour that I shouldn't use because it would break any PDF generation tool or something like that?
Any advice on the way to proceed would be helpful.
You'll want to read up on how to create a print stylesheet. This way when you go to print the CV you can choose something like CutePDF Writer and your print stylesheet will automatically be used. You will make your stylesheet show all hidden text blocks and hide things like navigation, buttons, etc.
I can't tell you whether or not it's worth it for you to try a new framework for this project, that's up to you. It's not bad to learn new things. Since I don't know all the details of your project it's hard to answer if it's worth it for this particular project. From your description is sounds like you're just making an HTML resume/CV which sound, to me, like one flat HTML page with some JavaScript. If that's the case you could probably just use a text editor.
If you want my personal opinion, ASP.Net 4 is the way to go if you want to learn something new (or if you just want to use a great framework).
As far as breaking the PDF generation, your print stylesheet will be responsible for showing/hiding things but any JavaScripts should be aware of this as well. Check the link I gave you above for more information.

Script or piece of code to get a quick list of links per page in a website

How can I quickly produce a report of a website in the format:
Page Name.
- Links within the page
Page Name.
- Links within the page
Any programming or scripting language will do.
Although I prefer a solution on Windows, we have all of: Windows, Mac and Linux platforms available in the office.
Just looking for a way to do it without much fanfare.
There might be tools able to do this for you, but it isn't all that hard to put together yourself. One possible solution would be to...
Use wget (can be found for Windows) to download all HTML files, and
use some xpath tool or grep with regexps to get the title and the links from the pages.
///Jens
There are loads of link analysers that will do exactly that. Here's the first I found in Google.
For something a little more interesting, Don Syme did a great F# demo in which he wrote a really simple asynch URL processing class. I can't find the exact link, but here's something similar from an F# MVP. You would need to adapt it to pull out links, and recursively follow them if you want nesting.