<commit_before>package blang.runtime.internals.doc.contents

import blang.xdoc.components.Document
import blang.runtime.internals.doc.Categories

class BlangCLI {
  
  public val static Document page = new Document("CLI") [
    
    category = Categories::tools 
    
    section("Blang Command Line Interface (CLI) setup") [
      
      it += '''
        This page explains the simple possible method for using Blang from the command line. A more advanced 
        method is to use Blang within a Nextflow pipeline. This makes it easier to share and reproduce results, 
        and to systematically explore and combine several command line arguments. An example of how to do 
        this is available «LINK("https://github.com/UBC-Stat-ML/blang-mixture-tempering")»at this repository«ENDLINK».
      '''
      
      section("Prerequisites") [
        unorderedList[
          it += '''Java 8+ installed.'''
          it += '''Tested on a few UNIX architectures; in theory should run on windows but not tested yet.'''
        ]
      ]
      
      section("Instruction") [
        orderedList[
          it += '''
            Clone the «LINK("https://github.com/UBC-Stat-ML/blangSDK")»blangSDK repository«ENDLINK» 
            (also included in the main Blang download). 
          '''
          it += '''
            From the root of the SDK repo, run «SYMB»source setup-cli.sh«ENDSYMB».
          '''
        ]
      ]
      
      section("Usage") [
        orderedList[
          it += '''Type «SYMB»blang«ENDSYMB» and follow the instructions there, summarized below for convenience.'''
          it += '''
            Create a directory for your project, say «SYMB»blangProject«ENDSYMB»
          '''
          it += '''
            Create a blang file, e.g. an empty model «SYMB»model MyModel { laws{} }«ENDSYMB», save it as «SYMB»blangProject/MyModel.bl«ENDSYMB»
            (Note: the extension «SYMB».bl«ENDSYMB» is required.)
          '''
          it += '''
            From «SYMB»blangProject«ENDSYMB», type «SYMB»blang --model MyModel«ENDSYMB»
          '''
          unorderedList[
            it += '''
              This will compile every «SYMB».bl«ENDSYMB» file in «SYMB»blangProject«ENDSYMB» (and its subdirectories, if any)
            '''
            it += '''
              After compilation, the model «SYMB»MyModel«ENDSYMB» will be ran.
            '''
          ]
        ]
      ]
    ]
    
  ]
  
}<commit_msg>Improve CLI instruction based on the JSS submission<commit_after>package blang.runtime.internals.doc.contents

import blang.xdoc.components.Document
import blang.runtime.internals.doc.Categories
import blang.xdoc.components.Code.Language

class BlangCLI {
  
  public val static Document page = new Document("CLI") [
    
    category = Categories::tools 
    
    section("Installing Blang Command Line Interface (CLI)") [
        
      it += '''The prerequisites for the CLI installation process are:'''
      
      orderedList[
        
        it += '''A UNIX-compatible environment running «SYMB»bash«ENDSYMB». This includes, in particular, Mac OS
        X, where bash is the default terminal interpreter when launching Terminal.app.'''
        
        it += '''The «SYMB»git«ENDSYMB» command'''
        
        it += '''The Java Software Development Kit (SDK), version 8 or more recent (at the time of publication, 
        «SYMB»Open SDK«ENDSYMB» 8 and 11 are tested). The Java runtime environment is not sufficient, as 
        compilation of models requires compilation into the Java Virtual Machine. Type «SYMB»javac -version«ENDSYMB» to 
        test if the Java SDK is installed. If not, the Java SDK is freely available at 
        «LINK("https://openjdk.java.net/")»https://openjdk.java.net/«ENDLINK».'''
      ]
      
      it += '''The following installation process is most thoroughly tested on Mac OS X, which is the primary 
      supported platform at the moment, however users have reported installing it suc- cessfully on certain Linux 
      and Windows configurations and we plan to expand the set of officially supported platforms to both in the near future.
      To install the CLI tools, input the following commands in a bash terminal interpreter:
      '''
      
      code(Language::sh, '''
      git clone https://github.com/UBC-Stat-ML/blangSDK.git
      cd blangSDK
      source setup-cli.sh
      cd ..
      ''')
      
    ]
  ]
}
{'fraction_non_alphanumeric': 0.09868718877320054, 'fraction_numerical': 0.0011317338162064282, 'mean_word_length': 2.312593703148426, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 5, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6202499', 'n_tokens_mistral': 1235, 'n_tokens_neox': 1202, 'n_words': 521}