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

Completion generation from pandoc manpage is broken #2937

Closed
daenney opened this issue Apr 14, 2016 · 9 comments
Closed

Completion generation from pandoc manpage is broken #2937

daenney opened this issue Apr 14, 2016 · 9 comments

Comments

@daenney
Copy link

daenney commented Apr 14, 2016

Reproduction Steps:

  1. Install pandoc and put the manpage on the MANPATH
  2. fish_update_completion
  3. pandoc -<tab>

Expected behavior:

Get completions for the long and short options in the man page.

Observed behavior:

Get completions for long and short options in the man page riddled with a lot of garbage:

-\).                                            (Here is a simple example: * one * two * three T… [See Man Page])
---                                                                                                    (author:.)
---\)                                                      (In reading LaTeX, parse the characters `, [aq], and.)
-----  -----:                                                                  (apple|2. 05 pear|1. 37 orange|3.)
------  -------  ----------                                                    (12 12 12 12 123 … [See Man Page])
-----------  -------------------------                                                            (First row 12.)
---------------                                          ((This syntax is compatible with PHP Markdown Extra. ).)
------------------                              (The header text can contain inline formatting, … [See Man Page])
-------------------------------------------------------------  (Centered Default Right Left Head… [See Man Page])
--ascii                                                                    (Use only ascii characters in output.)

Fish version: fish, version 2.2.0

Operating system: OS X 10.11 and Homebrew

Terminal or terminal emulator: iTerm2

@daenney
Copy link
Author

daenney commented Apr 14, 2016

I've gisted the man page here: https://gist.github.com/daenney/4cd81d2795cd5221b0a06e4277a8c78e

@faho
Copy link
Member

faho commented Apr 14, 2016

Yes, it's borked. Seems we choke on some of the YAML-blocks.

Though my preferred solution would be just writing a pandoc completion - there's a few things here that the generated ones won't do anyway, like formats, and it doesn't seem too complicated.

@faho faho added bug Something that's not working as intended completions labels Apr 14, 2016
@faho faho added this to the next-2.x milestone Apr 14, 2016
@daenney
Copy link
Author

daenney commented Apr 14, 2016

I agree a more complete one should be written by hand. In this case though as long as we could skip the YAML blocks I think that would solve most problems.

@faho faho modified the milestones: fish 2.5.0, next-minor Jan 6, 2017
@krader1961 krader1961 added enhancement and removed bug Something that's not working as intended labels Feb 20, 2017
@krader1961 krader1961 modified the milestones: fish-future, 2.6.0 Feb 20, 2017
@krader1961
Copy link
Contributor

This is not a bug other than in the most narrow sense. Completions generated from man pages is always best effort and seldom optimal. Improving the parsing of random man pages is an enhancement. Although, frankly in this case I think it makes more sense for someone who uses pandoc to write a custom completion script.

@dsanson
Copy link
Contributor

dsanson commented Jan 21, 2018

I've written a completion for pandoc. I'm new to fish, so doubtless there are ways it could be improved.

https://github.com/dsanson/fish-completion-pandoc

@zanchey
Copy link
Member

zanchey commented May 29, 2018

@dsanson, would you be willing to submit that for inclusion in fish? It would mean relicensing as GPL 2.

@dsanson
Copy link
Contributor

dsanson commented Jul 2, 2018

@zanchey: I changed the license to GPL 2. What is the process ofr submitting it for inclusion?

@faho
Copy link
Member

faho commented Jul 4, 2018

@dsanson: A PR that adds it to share/completions/ would work. Or do you mean something else?

@zanchey zanchey closed this as completed in 7926b69 Nov 4, 2018
@zanchey
Copy link
Member

zanchey commented Nov 4, 2018

Thanks - I've included this as 7926b69.

@zanchey zanchey modified the milestones: fish-future, fish-3.0 Nov 4, 2018
@zanchey zanchey self-assigned this Nov 4, 2018
ridiculousfish pushed a commit to ridiculousfish/fish-shell that referenced this issue Nov 24, 2018
Taken from https://github.com/dsanson/fish-completion-pandoc under the
GNU GPL as at 7195da6fc4bcbdd49ea63d47c27e4bfec2135660.

Closes fish-shell#2937.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants