Commit Graph

9 Commits

Author SHA1 Message Date
Don Cross
200080ca79 JavaScript: Defined string-valued enumerated type "Body".
Instead of declaring all the "body" parameters in the
TypeScript/JavaScript code to be strings, I created a
string-valued enumerated type called Body.

The same string values can still be passed in from JavaScript
code, or callers can use syntax like Astronomy.Body.Moon.

This improves the type checking inside the TypeScript source,
plus it adds better documentation for each of the parameters.
In the generated Markdown documentation, the user can click
on the Body type and see all the supported bodies.

The other three supported languages (C, C#, Python)
already use enumerated types for bodies, so this
brings the JavaScript version more in sync with them.
2021-03-27 10:44:50 -04:00
Don Cross
eac7750fba Fixed #86 - eliminated redundant JS functions MakeObserver and MakeSpherical.
In the TypeScript/JavaScript code, the functions MakeObserver and MakeSpherical
are no longer needed, because the classes Observer and Spherical are now exported,
along with their constructors. I deleted those functions and reworked callers
to use the equivalent constructors instead.

Also fixed a few breakages in the html/browser examples that crept in recently.
2021-02-09 19:49:00 -05:00
Don Cross
3c6b569cd4 Fixed breakage in nodejs demos.
I had to require('./astronomy.js') instead of require('astronomy.js')
to get the nodejs demos working, now that I maintain a redundant
copy of astronomy.js in the demo directories.
2020-08-10 11:37:34 -04:00
Don Cross
db9eb6b180 Maintain redundant copies of Astronomy Engine source in demo folders.
Windows does not support relative links in Git by default.
This broke the first-time experience for Windows users.
From now on I will maintain copies of the astronomy.js
and astronomy.py in the demo folders, so that the demos
will work on Windows immediately after cloning the repo.
2020-08-10 11:08:27 -04:00
Don Cross
233232ea1e JS demo programs: validate command line parameters.
Print meaningful error messages and exit, if the JavaScript
demo programs are given invalid command line parameters.
2020-07-23 20:31:25 -04:00
Don Cross
83544bf57d Added C# demo for lunar eclipse.
Alphebetized demo readme pages.
2020-05-17 14:03:01 -04:00
Don Cross
1b0ba300d8 Removed all references to GitHub Pages, because it has been disabled.
I'm not going to use GitHub Pages after all, because it is
causing more problems than it is helping. All I really wanted
was a way to host live JavaScript browser examples.
I will find my own way of hosting just those.

The main problem is that GitHub pages uses a different flavor
of Markdown than GitHub. This makes it really difficult to get
something that works right across both.  In general, it doubles
how much stuff I have to look at when I make a cosmetic change.

So I have already turned off GitHub Pages on this repo,
and this commit removes all links and references to it.
2019-07-09 19:49:28 -04:00
Don Cross
5e755fe894 Fixed warnings found by lgtm. 2019-06-16 13:47:10 -04:00
Don Cross
bffce01bb3 Added node.js example of calculating sunrise, sunset, moonrise, moonset. 2019-06-15 15:45:56 -04:00