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

Proposal: support for double-lined boxes with unicode box-drawing chars (would you accept a PR for this?) #5

Open
alexanderbird opened this issue Feb 4, 2019 · 2 comments

Comments

@alexanderbird
Copy link
Contributor

I'm interested in adding some new functionality, are you interested in a PR for the following?

Double-lined rectangles

  • +d is like +o
  • +D is like +O

Except it produces

╔════════╗
║        ║
╚════════╝

Likewise for arrow and line commands.

If you're open to it, I'll do some more work on the proposal so you can give more detailed feedback.

@alexanderbird
Copy link
Contributor Author

alexanderbird commented Feb 5, 2019

I just did a spike of this on my account -- you can see it here: master...alexanderbird:patch/double-box-draw

It works find with python 3, but there are more encoding issues that need to be addressed before it would work with python 2. Probably the different utility methods would need to be made unicode-aware.

It looks like once unicode is fully supported, it wouldn't be much work to add more unicode boxes. Maybe:

  • +ud ("unicode double") for ╔═════╗
  • +us ("unicode single") for ┌───┐
  • +uh ("unicode heavy") for ┏━━┓
  • +ua ("unicode dAshed") for ┌╌╌╌╌╌┐

@gyim
Copy link
Owner

gyim commented Feb 13, 2019

Thank you for the spike, I like the idea!

I'd like to support both Python 2 and 3 so that it will work out-of-the-box with system Python for most users. So far I only concentrated on ASCII because I primarily used the plugin to produce files for Ditaa.

Maybe the best way would be to use stdin in binary mode (needs some Python 2/3 wizardy), and pass the file encoding explicitly to the script. This way even non-UTF8 files could be supported, and the character positions would be handled correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants