-
Notifications
You must be signed in to change notification settings - Fork 11
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
roff preview? #3
Comments
I suppose I could always make one. Wouldn't be terribly hard, I think. Just a case of piping Groff's output to Atom like a postprocessor. :) |
I'll see what I can do, mate. |
Hey @bronson, just letting you know I've not forgotten about this. :) Trying to get work finished on the I have the worst track record of starting projects and putting them down to start another... |
No worries, I really like file-icons too. Gotta admit, given the popularity difference between roff and icons, your time might be better spent over there. :) |
Alright, all done! Lot of work, as you can see. Now then... let's get some EDIT: Okay, erm, maybe later. I spoke too soon... bloody Nuclide. :( |
Hey @Alhadis, would this be part of the package or are you working on a separate package? Are you accepting pull requests? |
I'm making every effort to get around to it, but so far I've had to fight through urgent crap with
No pull-requests, sorry. I'm way too much of a control freak; and this is actually really complicated, but it's just a matter of focus. It'll be in this package, don't worry. |
Thanks for the immediate response! No worries. I appreciate the effort you make towards the Atom community. G'luck with |
On the plus side, guess what? The roff-preview will be a full-blown real-time renderer for It's not like it's avoidable. Due to the way |
@arbourd You can track progress on the Bonus: Will be able to convert tokenised output as SVG and Markdown. So far, so good. Shit is rock-solid. |
Halfway there. =) EDIT: More than halfway: |
@arbourd Are you good with maths and/or trigonometry? I, erm, need help. I'm dyscalculic, and stuck on figuring out arc-drawing. E.g., this code:
... should look like this in the previewer: Instead, it's currently looking like this: I only have these coordinates to go by:
But the canvas
The part with radii and angles is what's killing me... 😢 |
Hi @Alhadis! I'm a friend of @arbourd and also a mathematician. I present a solution if you still require it! That being said... Alright! Euclidean Geometry! Game on! So you've got a few things going on here, I'm sure you've figured out that...
You'll need a way to compute the angle measured clockwise from the x-axis for any general point. Luckily, you have inverse trig functions! (I did my test calculations with atan2: [https://en.wikipedia.org/wiki/Atan2]) Let's set this up a bit first: If tan(theta) = y/x, then the inverse trig function arctan(y/x) = theta, you have 2 points, so that doesn't work as arctan will only accept 1 point as an argument and give you back the angle from the x-axis. You'll need to do the following computation for both the start point and the end point. Begin by translating the non-centre point by the same transformation you would apply to bring the centre of the circle to the origin: startXnew = (startX - centreX) Then compute arcttan(startYnew / startXnew), this is your startAngle. As stated before, the same process applies for the end angle. CAVEAT! arctan is periodic, so if your arc crosses the positive x axis, there is a chance that you may get some odd behaviours. If this is the case, and it gives you trouble, I'd be happy to help. I hope this was clear and helpful and not too excessive! Best of luck! |
Oh wow, thank you! This was much more help than I expected... and a lot for my poor little head to take in, but I'm trying. Some generous folks on Groff's mailing list have also extended their help. I'm going through everything now, but plotting it on paper to help me visualise it. Dyscalculia is part of what's making this so hard... 😢 The numbers in my head keep "slipping" when I try to follow them, so I keep getting lost in people's explanations. I'll update once I finally figure this out... thank you so much again!! |
Right, finally realised why I've spent so long deliberating on implementation decisions. I've been developing two distinct projects in tandem with one another. Say hello to Electroff. JavaScript-based Troff integration. It'll be worked into the Atom package as a dependency. Dunno if it'll be published to NPM under that name, though... because it's not strictly Electron-specific. Anyway, we'll see. Need to get EDIT: Okay, yeah, erh... better give that module a less wanky name... |
So how do we get to see previews of man pages? edit: Nevermind, i found the "save-as" option finally... |
It's literally nearing completion. Work on this is taking place over at the Roff.js repository, where I'm wrapping up surface-level APIs for loading and formatting files with Everything is ready to go, it's really just me bikeshedding with myself and being a perfectionist. If you want a glimpse of what you'll be getting, you can checkout the Roff.js repository, and run ... which is what a man page is supposed to look like. 😉 However, since we're all used to seeing them formatted for terminal display, you'll probably expect this instead: Obviously, that'll be supported as an alternate display mode, but as you can see, it does little to show what Troff is really capable of... 😉 |
There's an absurd amount of improvements, bug fixes, and features that've been added to I've been itching for years to cut a release, but the current state of the master branch kinda blocks me from cutting one until the preview feature is finished. Which I've sworn to get done this year. Honest. 😅 The amount of work I've put into this project is unreal. |
Right, so I vowed to get this finished sometime this decade, and because I'm still having troubles with live-reloading, I've finally done what any sane developer would have already done long ago — release now, iterate upon it later. Something my completionist self doesn't understand very well. You'll be able to view man pages inside Atom, but edits to Roff files won't show up in the preview automatically (long story short: Atom's APIs don't make it easy for implementing live views). Will probably fix this in a future release. |
Still amazing work! Happy new decade. 🎉 |
First COVID-19, then the BLM riots, and now war between Russia and Ukraine. We sure jinxed the shit out of this decade, huh? |
The screenshot in the README makes me think you have a preview mode that I can see in Atom? I'm looking for something like the continually-updated Markdown Preview.
Looking at the code, though... I guess this plugin contains syntax files and snippets, and I still need to escape to the terminal to preview?
The text was updated successfully, but these errors were encountered: