Giter Site home page Giter Site logo

adjivas / ml Goto Github PK

View Code? Open in Web Editor NEW
78.0 2.0 15.0 696 KB

A library to generating UML language from Rust's project into graphiz/dot file.

Home Page: https://adjivas.github.io/ml/mml

License: Apache License 2.0

Rust 100.00%
uml uml-graphs dot generator modeling-language

ml's Introduction

ML -Modeling Language-

Crate travis-badge appveyor-badge dependencyci-badge

A library to generating UML language from Rust's project into graphiz/dot file.

Usage

This repo is provided as a Cargo package and a build script.

  1. adjust your Cargo.toml to include.
build = "build.rs"

[build-dependencies.mml]
version = "0.1"
  1. And your build.rs to generate your uml graph/viz and Structured Vector Graphics at target/dot/$CARGO_PKG_NAME.{dot,svg}.
extern crate mml;

fn main() {
    let dest: String = concat!("target/doc/", env!("CARGO_PKG_NAME")).to_string();

    let _ = mml::src2both("src", dest.replace("-", "_").as_str());
}
  1. (Facultative) From your entry point library file, you can add the generated vectorized graph.
//! ![uml](ml.svg)
  1. (Facultative) With the travis-cargo's instructions, you can prepare your graphviz's dependency like with this example.
addons:
  apt:
    packages:
      - graphviz
before_script:
  - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update           ; fi
  - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install graphviz ; fi
...
script:
  - |
      travis-cargo build &&
...

Features

Consider this list of fonctionalities like unstandard-uml.

  • implem -- add a column to show the functions from a implementation.
  • fn-emilgardis -- the function fields are preceded by fn keyword (Asked by Emilgardis).

Knowledge

This is a reading list of material relevant to Ml. It includes prior research that has - at one time or another - influenced the design of Ml, as well as publications about Ml.

License

ml is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0), with portions covered by various BSD-like licenses.

See LICENSE-APACHE, and LICENSE-MIT for details.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

ml's People

Contributors

adjivas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ml's Issues

using error_chain

I'm having issues with using error_chain for MML.

Cargo.toml

[package]
build = "build.rs"

[dependencies]
error-chain = "0.11.0"

[build-dependencies.mml]
version = "0.1"
error-chain = "0.11.0"

build.rs:

// UML Generator https://github.com/adjivas/ml

#![allow(unused_imports)]
#![allow(unused_variables)]
#![allow(dead_code)]

extern crate mml;

#[macro_use]
extern crate error_chain;

pub mod errors { error_chain!{} }

use errors::*;

fn make_uml_diagram() {
    // Generate diagram in /diagrams/ml.svg for README.md
    let dest: String = "../diagrams/".to_string();
    let _ = mml::src2both("src", dest.replace("-", "_").as_str());

    // Generate diagram in /target/doc/diamond_drops_node/ml.svg
    let dest: String = concat!("../target/doc/", env!("CARGO_PKG_NAME")).to_string();
    let _ = mml::src2both("src", dest.replace("-", "_").as_str());
}

fn main() {
    //make_uml_diagram();
}
$ cargo test
warning: unused manifest key: build-dependencies.mml.error-chain
   Compiling diamond-drops-node v0.1.0-a (file:///home/james/dod/node)
error[E0463]: can't find crate for `error_chain`
  --> build.rs:10:1
   |
10 | extern crate error_chain;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate

error: aborting due to previous error

error E0423 in syntex_syntax

When I try using this on a few projects, I get a build error

error[E0423]: expected function, tuple struct or tuple variant, found struct `ast::Name`
   --> /home/jayvdb/.cargo/registry/src/github.com-1ecc6299db9ec823/syntex_syntax-0.58.1/src/symbol.rs:146:27
    |
146 |                       name: ast::Name($index),
    |                             ^^^^^^^^^
...
165 | / declare_keywords! {
166 | |     // Invalid identifier
167 | |     (0,  Invalid,        "")
168 | |
...   |
231 | |     (56, CrateRoot, "{{root}}")
232 | | }
    | |_- in this macro invocation
    |
    = note: this error originates in the macro `declare_keywords` (in Nightly builds, run with -Z macro-backtrace for more info)

e.g. I tried this with https://github.com/swift-nav/esthri/tree/master/crates/esthri
also some private projects which otherwise build normally.

Project state

Hello,

This project looks interesting; may I ask about the current state of the project in terms of maintenance and so on? If there is interest in maintaining this as a tool for generating UML from Rust crates and the goals are reasonably close to my own I would be interested in contributing. If on the other hand you know that e.g. some of the dependencies are unmaintained and this would be a huge amount of work then a clean slate approach might be better.

Best wishes, Max

Link elements to documentation pages

When generating an svg image as part of a handbook, it would be really nice to deep link into the handbook from the source code diagram elements.

Example diagrams

We currently have one example diagram. In order to test the project and make it useful, other code bases can be diagrammed and linked here. This list shows what it can do:

New folder structure

Hi,

the mml is not able to parse the newer folder structure, so I have to change it from:

"
folder [utility]
* one.rs
* two.rs
utility.rs
main.rs
"
to

"
folder [utility]
* one.rs
* two.rs
* mod.rs
main.rs
"

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.