CamBam
News:
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
August 20, 2019, 19:34:10 pm


Login with username, password and session length


Pages: [1] 2 3 ... 6
  Print  
Author Topic: CamBam API documentation (in pogress)  (Read 39737 times)
EddyCurrent
CNC Jedi
*****
Offline Offline

Posts: 3993



View Profile
« on: March 21, 2015, 21:07:54 pm »

This is not as easy as it first appears with regard to making it easy and practical.

Proposal;
1. To use Notepad++ as the viewing application. http://notepad-plus-plus.org/
2. To save files with the appropriate language extension.
3. To use the same layout for a consistent look and feel.

I tried a load of different ways to tackle this but here's what I like about this method.

1. Notepad++ can handle a wide range of languages and formats the code accordingly
2. It's as easy as changing the top set of comments and pasting some code in from Visual Studio for example.
3. Notepad++ provides automatic colour highlighting of code making it easy to read
4. Scripts can be saved right out of Notepad++ into the CamBam 'scripts' folder.
5. Each file can contain multiple functions, classes, examples, etc. just by pasting them onto the end.

So here's an example for RotX, RotY, RotZ

And I've just seen that it's not so good we can't attach file types, cs, vbs, py because Notepad++ uses the extension in order to provide the correct environment for the chosen language. Using a zip file adds another step to the process.

Thoughts !



* RotX.zip (0.73 KB - downloaded 215 times.)
« Last Edit: May 15, 2015, 12:48:53 pm by dh42 » Logged

Made in England
lloydsp
CNC Jedi
*****
Online Online

Posts: 7946



View Profile
« Reply #1 on: March 21, 2015, 21:45:58 pm »

Man!  I love notepad++ for many reasons.

I hate it for one reason:

If you have opened the search or search/replace window, F3 no longer works to find-next, unless you move the context back to the text frame.  I would almost rather the damned search window NOT open that have that impediment.  When I'm searching for stuff, I'll searching many times. (at least in my code)  And I search a LOT in existing code I'm trying to debug.

OH, I wish they'd fix that!  I've seen no reactions, so far, from the developer on that issue.

But that aside, Eddy... yes. 

Lloyd
Logged

"Pyro for Fun and Profit for More Than Fifty Years"
Dragonfly
CNC Jedi
*****
Online Online

Posts: 2126



View Profile
« Reply #2 on: March 21, 2015, 22:20:41 pm »

I am using Programmer's Notepad but can't make a comparison. Came to me once together with WinAVR, I liked it and it's my Windoze Notepad replacement.
Logged
dave benson
CNC Jedi
*****
Offline Offline

Posts: 1118


View Profile
« Reply #3 on: March 21, 2015, 23:20:14 pm »

Hi All
Just downloaded Notepad++ and compared it to the others I have and for C# they all seemed comparable
producing the same format and layout But for scripting notepad++ was quite good wish I had  used it
for the Paraboliod script. I think no matter what editor you're using as long as it formats the file consistent with what we agree on as a standard It'll be fine. Having said that, I now have Notepad++  I'll use that.
Dave
Logged
dh42
Administrator
CNC Jedi
*****
Offline Offline

Posts: 5558



View Profile WWW
« Reply #4 on: March 21, 2015, 23:56:40 pm »

Hello,

I use Programmer's Notepad too for mach3, but I prefer Visual Studio for CB scripts, maybe because me, but I can't obtain the syntax help of the functions on PN as in VS (even for regular windows functions), the link to MSDN also don't works in PN. (F1 on a function/class ...etc) .. maybe not implemented ? .. its implemented in Notepad++ ?

++
David
Logged
EddyCurrent
CNC Jedi
*****
Offline Offline

Posts: 3993



View Profile
« Reply #5 on: March 22, 2015, 10:09:43 am »

Programmer's Notepad is also fine, it was more about the layout and how best to view it.

David,
this is not to do with making scripts or plugins, it's just about a method that everyone should use to document CamBam API methods as a reference resource. I will still be using Visual Studio etc. for programming.

I don't do much if any HTML work but would it be better, or even possible, to start with this existing API and add to it somehow ? http://www.cambam.info/doc/api/
« Last Edit: March 22, 2015, 10:15:20 am by EddyCurrent » Logged

Made in England
EddyCurrent
CNC Jedi
*****
Offline Offline

Posts: 3993



View Profile
« Reply #6 on: March 22, 2015, 16:41:47 pm »

Logged

Made in England
dh42
Administrator
CNC Jedi
*****
Offline Offline

Posts: 5558



View Profile WWW
« Reply #7 on: March 22, 2015, 17:07:51 pm »

Hello,

Quote
this is not to do with making scripts or plugins, it's just about a method that everyone should use to document CamBam API methods as a reference resource.

Ah ! OK ..

Quote
I don't do much if any HTML work but would it be better, or even possible, to start with this existing API and add to it somehow ?

I've not yet access to the English website, but it's planed, the English doc need some updates (at least the chapters that are in the French doc and that miss in the English doc).

Yesterday, I though that I can add a 3rd column with a link to view or download the example (picture) in the API "form"

I don't know what can be the appearance of code viewed on a web page I think that the indentation will disappears, I'll do some experiments on my website, it's the same template as Andy's site (of course it's his Smiley)

Do you think that can be a way to do ?

++
David


* Sans titre-1.jpg (77.35 KB, 936x508 - viewed 351 times.)
Logged
dh42
Administrator
CNC Jedi
*****
Offline Offline

Posts: 5558



View Profile WWW
« Reply #8 on: March 22, 2015, 17:20:21 pm »

Re

Fu*** connexion that go away every 3 min  Roll Eyes Roll Eyes

Quote
"Old habits die hard", as they say, and for me that means having stuff available offline. I have no interest in 'the cloud'. I know there are many online places to store source code but I have no interest in those.

Yes, my to , for the reason above ... but the HTML template can work offline as for the regular doc ; for English doc, it is installed with the soft, but French doc is just a html bundle that is exactly the web doc that I zip. That need 3 min to do the zip file after an update is done (and 30 min to upload it  Roll Eyes)

++
David
Logged
EddyCurrent
CNC Jedi
*****
Offline Offline

Posts: 3993



View Profile
« Reply #9 on: March 22, 2015, 17:30:15 pm »

I have no problem with a HTML document that is zipped ready for download. Maybe the source code can be like the file I attached in my first post, it would be in a sub folder and zipped with the HTML. Links in the HTML could open it using Notepad++ for example.
If it was done like that with the source code snippets files in a folder it would make updating the main HTML document a lot easier, only the Member name would need adding, maybe some comments,  and a link to examples files.
« Last Edit: March 22, 2015, 17:32:35 pm by EddyCurrent » Logged

Made in England
dh42
Administrator
CNC Jedi
*****
Offline Offline

Posts: 5558



View Profile WWW
« Reply #10 on: March 22, 2015, 18:10:24 pm »

Just tried an example ;

http://www.atelier-des-fougeres.fr/Cambam/Aide/API%20Doc/Cambam_cad_dll/Cambam_cad/polyline.html

Your .cs file is used as is in a separate tabs on the browser ... (link code)

++
David
« Last Edit: May 14, 2015, 19:47:34 pm by dh42 » Logged
EddyCurrent
CNC Jedi
*****
Offline Offline

Posts: 3993



View Profile
« Reply #11 on: March 22, 2015, 20:14:27 pm »

David,
The idea worked good for me. The link opened in a new web page so some formatting and the colours were lost, but I did a right click and 'save as' to my PC then opened it in my favourite editor e.g. Notepad++

So it was important to keep the .cs extension on the file, same for .vb .py  etc.

There could be more than one link e.g.

Code - vb
Code - C#
Code - Python
Logged

Made in England
dh42
Administrator
CNC Jedi
*****
Offline Offline

Posts: 5558



View Profile WWW
« Reply #12 on: March 22, 2015, 20:22:15 pm »

Quote
So it was important to keep the .cs extension on the file, same for .vb .py  etc.

I'll try what happens if extension is other than .cs (if pb, maybe we can use)

I don't know if it is possible to do that the file is immediately open in notepad++ or PN ... I'll take a look (I'm not a king with Dreamweaver !)

++
David
Logged
dh42
Administrator
CNC Jedi
*****
Offline Offline

Posts: 5558



View Profile WWW
« Reply #13 on: March 22, 2015, 20:30:55 pm »

Re

I tried, that works also with .vbs or .py extension  Cheesy ... try again the link

++
David
Logged
EddyCurrent
CNC Jedi
*****
Offline Offline

Posts: 3993



View Profile
« Reply #14 on: March 22, 2015, 20:36:56 pm »

It all works but when I do a 'save as' with the .vbs file it saves it to my PC as .vbs.txt
Maybe it's just my PC ? it is not a real problem though, I can easily rename it but that would be a work around.
Logged

Made in England
Pages: [1] 2 3 ... 6
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.172 seconds with 19 queries.

Copyright © 2018 HexRay Ltd. | Sitemap