Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request for a very small sample application that we could use as a template #112

Open
OleksiyPetroKovalenko opened this issue Sep 7, 2023 · 1 comment
Labels
feature New feature or enhancement

Comments

@OleksiyPetroKovalenko
Copy link

OleksiyPetroKovalenko commented Sep 7, 2023

Is your feature request related to a problem? Please describe.

I'm struggling to grasp how to utilize MathLive and the compute engine. When I check Gitter, I notice many others have posed similar queries, frequently repeating the same questions.

Describe the solution you'd like

Would you be able to supply a few straightforward sample applications showcasing the various functionalities and capabilities? For instance, I'm currently facing a minor issue, and our discussions have been extensive. If a sample program had been available, it could have eliminated the need for this prolonged conversation.

For my own needs, I'd like to ask for a sample that encompasses, at a minimum, the following. Other would I am sure benefit from a larger sample that showed how to use MathLive and the many other capabilities.

<!DOCTYPE html>
<html>
<head>
    
<script type="module" src="mathlive.ms"></script>
<script type="module" src="compute-engine.js"></script>
   
   <script type="module">
        document.addEventListener('DOMContentLoaded', function() {
        window.mf = document.getElementById('mf');
        
        import {ComputeEngine} from "compute-engine.js";
        
        const ce = new ComputeEngine({
            latexDictionary: [
            ...ComputeEngine.getLatexDictionary().filter((x) => x.name !== 'PlusMinus'),
            {
                trigger: ['\\smoll'],
                parse: function(parser) {
                return [
                    'Divide',
                    parser.matchRequiredLatexArgument() ?? ['Error', "'missing'"],
                    parser.matchRequiredLatexArgument() ?? ['Error', "'missing'"],
                ];
                },
            },
            ],
        });
        });
   </script>

</head>
<body>
     <math-field class="mf" id="mf" ></math-field>
  </body>
</html>

This doesn't use NPM, doesn't use external files. Just uses the source for your MathLive and ComputeEngine.

Describe alternatives you've considered

I've attempted the above solution, including relocating the script to a main.js file and performing the import from there. Despite dedicating several hours and exploring every possible avenue, I can't seem to access the static function getLatexDictionary. While I'll keep seeking guidance in the other thread, having a sample application to reference would simplify the process for all involved.

Additional context

I'm convinced that such a resource would be advantageous for everyone. It would not only save time but also simplify the process of understanding how to use the applications, easing the challenging learning curve for all. Even better, when you add new capabilities if you added those and updated the sample, we would all know what's available.

@OleksiyPetroKovalenko OleksiyPetroKovalenko added the feature New feature or enhancement label Sep 7, 2023
@rs-mobitech
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or enhancement
Development

No branches or pull requests

2 participants