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

Improve readability with new line as terminator and whitespace #38

Closed
chrisalley opened this issue Dec 9, 2014 · 7 comments
Closed
Labels
Status: Approved Is ready to be worked on Type: Enhancement New feature or request

Comments

@chrisalley
Copy link

It would be nice to (optionally) end statements without a semicolon and use a new line instead. For example, instead of this:

graph LR;
    A[Hard edge]-->|Link text|B(Round edge);
    B-->C{Decision};
    C-->|One|D[Result one];
    C-->|Two|E[Result two];

you could just write:

graph LR
    A[Hard edge]-->|Link text|B(Round edge)
    B-->C{Decision}
    C-->|One|D[Result one]
    C-->|Two|E[Result two]

The latter is more readable as it is less dense on the eyes.

Furthermore, you could improve readability by allowing optional spaces between parts of a statement. e.g.

graph LR
    A[Hard edge] -->|Link text| B(Round edge)
    B --> C{Decision}
    C -->|One| D[Result one]
    C -->|Two| E[Result two]
@knsv
Copy link
Collaborator

knsv commented Dec 9, 2014

I like the syntax. Readability is important. Will give this some thought.

@knsv knsv added the Type: Enhancement New feature or request label Dec 9, 2014
@vijay40
Copy link
Contributor

vijay40 commented Dec 10, 2014

Hi knsv,

If nobody is currently working on this issue, I like to work on it.

@knsv
Copy link
Collaborator

knsv commented Dec 10, 2014

Great! It is yours.
Good luck!

vijay40 added a commit to vijay40/mermaid that referenced this issue Dec 13, 2014
…d link to improve readablity for issue mermaid-js#38. There should not be any space between vertex and its text and link and its text. flow.spec.js is modified to include three new tests for testing new graphs.
@vijay40
Copy link
Contributor

vijay40 commented Dec 13, 2014

I have created a pull request for allowing spaces between vertices and link.

The another issue discussed here is about ending a statement with a newline instead of semicolon. I can do that too, but it requires the last statement of the graph to either end with a semicolon or have some special symbol to represent the end of graph. If we can discuss and decide about that then it will be great, before starting to work on it.

knsv added a commit that referenced this issue Dec 13, 2014
Improves readablity discussed in issue #38
@knsv
Copy link
Collaborator

knsv commented Dec 13, 2014

Sounds good! I have added a comment statement that does not require a semi colon at the end. The same structure could be used for the other statements. Let me merge and clean things up before you go at it. Will post here when done!

@knsv
Copy link
Collaborator

knsv commented Dec 13, 2014

Ok Vijay thanks for your pull-reqest. I have merged it and refactored the token lists a bit to avoid duplications. In order to avoid conflict when merging next pull request It good if you get the latest version before the elimination of ; requirement

@knsv knsv added the Status: Approved Is ready to be worked on label Dec 13, 2014
knsv added a commit that referenced this issue Dec 15, 2014
New grammar will allow statements ending without semicolon as disccused in Issue #38
@knsv
Copy link
Collaborator

knsv commented Dec 15, 2014

Good work Vijay. Included in release 0.2.16

@knsv knsv closed this as completed Dec 15, 2014
mgenereu referenced this issue in mgenereu/mermaid Jun 25, 2022
fix(marketing-links): fixes Mermaid CLI link
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Approved Is ready to be worked on Type: Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants