Extra Feature: Copying the Model Code to HTML

Posted
Comments None

The previous post "New Math Functions in C++" was a challenge in terms of composition. For whatever reason, the blog editor I was using (the blog editor of Microsoft Word) refused to publish my post if I included more than 3 functions! And I had 36 more to add!

The code I was trying to add was in C++ and the blog editor was supposed to nicely copy the code, keeping all the formatting, including the different colors for the keywords and comments. And in fact it did that nicely for all the C++ code snippets I've included in previous posts.

Notwithstanding, I knew I had to think of a different way of including the code of all the other languages not recognized by the blog editor as formatted code (for example, the Python code shown in the post "Function Design: Programming Languages" was formatted by hand and it was already a pain for just 3 functions!). And the above mentioned disaster with the C++ code for the previous post just made it crystal clear: There was no way I would be able to format all the code for all the 17 programming languages by hand!

So what I needed was a way to get the HTML that GeneXproTools uses in the Model Panel to show the model code in all the languages it supports! And as it turns out this is a nice feature to add to GeneXproTools for everyone to use! We will now all be able to post the code of our models on the web with the nice formatting and colors without much fuss. We will be releasing this already with the next mini-release as a bonus feature.

Now this seems obvious, doesn't it? But it never occurred to me before and I've posted enough code examples on the web using just plain text and thinking nothing of it (well, almost nothing, because I would commiserate about not being able to use the nice formatting). Sometimes it takes just doing things a little bit differently to come up with a good idea.

I hope you'll find this new feature of GeneXproTools useful and make good use of it. I for one will have plenty of opportunity to use it extensively over the next posts to show you the code for all the new 39 math functions in all the programming languages of GeneXproTools!

Author

Comments

There are currently no comments on this article.

Comment

Enter your comment below. Fields marked * are required. You must preview your comment first before finally posting.





← Older Newer →