From abf344242e0bdc2eeb829cbbc0370f60d5d7b2ac Mon Sep 17 00:00:00 2001 From: Bartholomew Jardine <70293946+bartjuw@users.noreply.github.com> Date: Tue, 26 Mar 2024 20:25:44 -0700 Subject: [PATCH] Update Readme.md --- docs/Readme.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/docs/Readme.md b/docs/Readme.md index f355e17..781ad2a 100644 --- a/docs/Readme.md +++ b/docs/Readme.md @@ -1,4 +1,49 @@ # Using libantimonyjs in your project. + ## In a webpage +- For use in a webpage just copy the contents of the ../release/v##### into a suitable directory in your website. +- In the webpage where you want to load the libantimony library just insert the following lines into the page so that your code can find the library: + + ``` + + + ``` + +- Next write the javascript code to load the library: + ``` + + ``` +- Now you can call the Antimony instance to translate Antimony string to SBML string or translate an SBML string to Antimony string: + ``` + var result = antimonyLibrary.convertAntimonyToSBML( antimonyString ) ; + if(result.isSuccess()) { + sbmlResult = result.getResult(); } + ``` + or: + ``` + result = antimonyLibrary.convertSBMLToAntimony( sbmlString ); + if(result.isSuccess()) { + sbmlResult = result.getResult(); } + ``` +- Both of these methods returns a Result object which has three methods: +- `result.getResult()`: Returns the translated string or the error message if isSuccess() is false. +- `result.isSuccess()`: +- `result.getWarnings()` : returns any warnings generated from the translation (Note: isSuccess will often return true if there are warnings.) +- dsf ## In node.js + +## The basic APIs: +- +