Skip to content
Snippets Groups Projects
Select Git revision
  • e099ac514a38a9a2d365c01671d9c8654036162c
  • master default protected
  • rednatco-v2
  • base-pairs-ladder
  • rednatco
  • test
  • ntc-tube-uniform-color
  • ntc-tube-missing-atoms
  • restore-vertex-array-per-program
  • watlas2
  • dnatco_new
  • cleanup-old-nodejs
  • webmmb
  • fix_auth_seq_id
  • update_deps
  • ext_dev
  • ntc_balls
  • nci-2
  • plugin
  • bugfix-0.4.5
  • nci
  • v0.5.0-dev.1
  • v0.4.5
  • v0.4.4
  • v0.4.3
  • v0.4.2
  • v0.4.1
  • v0.4.0
  • v0.3.12
  • v0.3.11
  • v0.3.10
  • v0.3.9
  • v0.3.8
  • v0.3.7
  • v0.3.6
  • v0.3.5
  • v0.3.4
  • v0.3.3
  • v0.3.2
  • v0.3.1
  • v0.3.0
41 results

markdown-docs.ts

Blame
  • user avatar
    yakomaxa authored
    a5728728
    History
    markdown-docs.ts 1.58 KiB
    /*
     * Copyright (c) 2017-2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
     * @author Koya Sakuma <koya.sakuma.work@gmail.com>
     * Adapted from MolQL project
    */
    
    import { properties } from './properties';
    import { operators } from './operators';
    import { keywords } from './keywords';
    
    
    const _docs: string[] = [
        'Jmol',
        '============',
        '--------------------------------',
        ''
    ];
    
    _docs.push(`## Properties\n\n`);
    _docs.push('--------------------------------\n');
    for (const name in properties) {
        if (properties[name].isUnsupported) continue;
    
        const names = [name];
        if (properties[name].abbr) names.push(...properties[name].abbr!);
        _docs.push(`\`\`\`\n${names.join(', ')}\n\`\`\`\n`);
    
        if (properties[name]['@desc']) {
            _docs.push(`*${properties[name]['@desc']}*\n`);
        }
    }
    
    _docs.push(`## Operators\n\n`);
    _docs.push('--------------------------------\n');
    operators.forEach(o => {
        if (o.isUnsupported) return;
    
        const names = [o.name];
        if (o.abbr) names.push(...o.abbr!);
        _docs.push(`\`\`\`\n${names.join(', ')}\n\`\`\`\n`);
    
        if (o['@desc']) {
            _docs.push(`*${o['@desc']}*\n`);
        }
    });
    
    _docs.push(`## Keywords\n\n`);
    _docs.push('--------------------------------\n');
    for (const name in keywords) {
        if (!keywords[name].map) continue;
    
        const names = [name];
        if (keywords[name].abbr) names.push(...keywords[name].abbr!);
        _docs.push(`\`\`\`\n${names.join(', ')}\n\`\`\`\n`);
    
        if (keywords[name]['@desc']) {
            _docs.push(`*${keywords[name]['@desc']}*\n`);
        }
    }
    
    export const docs = _docs.join('\n');