Giter VIP home page Giter VIP logo

classgenerator's Introduction

ClassGenerator

issues license

PlantUML class generator for JavaScript

Requirements

Program Function Optional Download
PlantUML Render UML images; PNG, SVG, etc... โœ… ๐Ÿ’พ
Graphviz Render linked UML images. โœ… ๐Ÿ’พ

Installation

Download a copy of this repository to your system.

Git clone

git clone https://github.com/Justin-Byrne/ClassGenerator.git

Usage

Help menu

python3 BuildClass.py {<source>} [<destination>] [flags] [args[|args...]]

PATHS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

source                       File or directory location of javascript file(s) to convert

                             usage:
                                 (single)    "/javascript/classes/one.js"
                                 (multiple)  "/javascript/classes"

destination                  File or directory location to save class diagrams

                                 usage:
                                     (single)    "/javascript/classes/output/one.txt"
                                     (multiple)  "/javascript/classes/output"

FLAGS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

-o, --omit "<filename>"      Omit the following filenames from the source directory

                             usage:
                                 (single)    --omit "file1"
                                 (multiple)  --omit "file1|file2|file3"

-s, --skin "<skinparam>"     Embed skin parameters within the class uml generated

                             usage:
                                 (single)    --skin "skinparam+one+1"
                                 (multiple)  --skin "skinparam+one+1|skinparam+two+2"

-m, --make "<image_type>"    Make the class generated diagram into an image

                             usage:
                                 (single)    --make "png"
                                 (multiple)  --make "png|svg|eps"

-l, --link                   Link available classes to generated class diagrams

                             usage: --link

-h, --help                   Display this help menu

                             usage: --help

Configuration

Configurations settings for each generated file can be set within ../app/config/config.txt.

These settings are commented out by default

####    FILE OMISSIONS
filename_one
filename_two
filename_three

####    SKIN PARAM
left to right direction
skinparam DefaultFontSize 16
skinparam DefaultFontName Courier New
skinparam ClassAttributeIconSize 0

####    IMAGE OUTPUT
png
svg
eps
eps:text
pdf
vdx
xmi
scxml
html
txt
utxt
latex
latex:nopreamble
braille

####    PLANTUML PATH
path=~/Programs/PlantUML

Note: for best results use the following skin-params:

skinparam DefaultFontSize 16
skinparam DefaultFontName Courier New

Examples

python3 BuildClass.py ~/Programs/JavaScript/Classes/class.js -m "png"

JavaScript PlantUml ( Text ) PlantUml ( PNG )
class ClassName
{
    _prop0 = 0;
    _prop1 = 'string';
    _prop2 = new Two;
    _prop3 = new Three;

    constructor ( ) { }

    set prop0 ( value ) { }
    get prop0 ( ) { }

    set prop1 ( value ) { }
    get prop1 ( ) { }

    set prop2 ( value ) { }
    get prop2 ( ) { }

    set prop3 ( value ) { }
    get prop3 ( ) { }
}
@startuml

class ClassName {
_prop0   {number}
_prop1   {string}
_prop2   {Object}
_prop3   {Object}
__ Setter __
prop0
prop1
prop2
prop3
__ Getter __
prop0
prop1
prop2
prop3
}
@enduml

python3 BuildClass.py ~/Programs/JavaScript/Classes/class.js -l -m "png"

JavaScript PlantUml ( Text ) PlantUml ( PNG )
/**
 * @class     {Object}  One
 * @property  {number}  prop0
 * @property  {string}  prop1
 * @property  {Two}     prop2
 * @property  {Three}   prop3
 *
 */
class One
{
    _prop0 = 0;
    _prop1 = 'string';
    _prop2 = new Two;
    _prop3 = new Three;

    constructor ( ) { }

    set prop0 ( value ) { }
    get prop0 ( ) { }

    set prop1 ( value ) { }
    get prop1 ( ) { }

    set prop2 ( value ) { }
    get prop2 ( ) { }

    set prop3 ( value ) { }
    get prop3 ( ) { }
}
@startuml

class One {
prop0   {number}
prop1   {string}
prop2   {Two}
prop3   {Three}
__ Setter __
prop0
prop1
prop2
prop3
__ Getter __
prop0
prop1
prop2
prop3
}
One *-- Three
One *-- Two

class Two {
prop0   {number}
prop1   {string}
prop2   {One}
prop3   {Three}
__ Setter __
prop0
prop1
prop2
prop3
__ Getter __
prop0
prop1
prop2
prop3
}

class Three {
prop0   {number}
prop1   {string}
prop2   {One}
prop3   {Two}
__ Setter __
prop0
prop1
prop2
prop3
__ Getter __
prop0
prop1
prop2
prop3
}
@enduml

Support

Please open an issue for support.

Structure

.
โ”œโ”€โ”€ docs
โ”‚ย ย  โ”œโ”€โ”€ CHANGELOG.md
โ”‚ย ย  โ””โ”€โ”€ FUNDING.yml
โ”œโ”€โ”€ source
โ”‚ย ย  โ””โ”€โ”€ app
โ”‚ย ย      โ”œโ”€โ”€ config
โ”‚ย ย      โ”‚ย ย  โ””โ”€โ”€ config.txt
โ”‚ย ย      โ”œโ”€โ”€ core
โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ generator.py
โ”‚ย ย      โ”‚ย ย  โ””โ”€โ”€ linker.py
โ”‚ย ย      โ”œโ”€โ”€ utilities
โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ custom
โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ debug
โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ view_arguments.py
โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ filter
โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ filter_properties.py
โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ filter_type.py
โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ list
โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ get_column_max.py
โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ validation
โ”‚ย ย      โ”‚ย ย  โ”‚ย ย      โ”œโ”€โ”€ is_extension.py
โ”‚ย ย      โ”‚ย ย  โ”‚ย ย      โ””โ”€โ”€ is_js_class.py
โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ system
โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ file
โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ get_file_bounds.py
โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ get_file_omissions.py
โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ get_files.py
โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ set_file.py
โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ validation
โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ is_directory.py
โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ is_file.py
โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ is_flag.py
โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ is_program.py
โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ get_command_type.py
โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ get_commands.py
โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ parse_commands.py
โ”‚ย ย      โ”‚ย ย  โ””โ”€โ”€ util.py
โ”‚ย ย      โ””โ”€โ”€ BuildClass.py
โ”œโ”€โ”€ LICENSE
โ””โ”€โ”€ README.md

Copyright

Byrne-Systems

== Byrne-Systems ยฉ 2023 - All rights reserved. ==

classgenerator's People

Contributors

justin-byrne avatar

Stargazers

Zearin avatar Omran Jamal avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.