mdbook-katex icon indicating copy to clipboard operation
mdbook-katex copied to clipboard

Add version to the CLI

Open olorin37 opened this issue 3 years ago • 6 comments

mdbook-katex --version doesn't work. It was not added to the clap App.

olorin37 avatar Jan 27 '22 08:01 olorin37

Locally I couldn't build this patch because of errors in dependencies

Compiling tungstenite v0.14.0                                                                                                             
error[E0658]: const generics are unstable                                                                                                    
  --> /home/gramsz/.cargo/registry/src/github.com-1ecc6299db9ec823/tungstenite-0.14.0/src/buffer.rs:13:29                                    
   |                                                                                                                                         
13 | pub struct ReadBuffer<const CHUNK_SIZE: usize> {                                                                                        
   |                             ^^^^^^^^^^                                                                                                  
   |                                                                                                                                         
   = note: see issue #74878 <https://github.com/rust-lang/rust/issues/74878> for more information                                            
   = help: add `#![feature(min_const_generics)]` to the crate attributes to enable                                                           
                                                                                                                                             
error[E0658]: const generics are unstable                                                                                                    
  --> /home/gramsz/.cargo/registry/src/github.com-1ecc6299db9ec823/tungstenite-0.14.0/src/buffer.rs:18:12                                    
   |                                                                                                                                         
18 | impl<const CHUNK_SIZE: usize> ReadBuffer<CHUNK_SIZE> {                                                                                  
   |            ^^^^^^^^^^                                                                                                                   
   |                                                                                                                                         
   = note: see issue #74878 <https://github.com/rust-lang/rust/issues/74878> for more information                                            
   = help: add `#![feature(min_const_generics)]` to the crate attributes to enable                                                           
                                                                                                                                             
error[E0658]: const generics are unstable                                                                                                    
  --> /home/gramsz/.cargo/registry/src/github.com-1ecc6299db9ec823/tungstenite-0.14.0/src/buffer.rs:70:12                                    
   |                                                                                                                                         
70 | impl<const CHUNK_SIZE: usize> Buf for ReadBuffer<CHUNK_SIZE> {                                                                          
   |            ^^^^^^^^^^                                                                                                                   
   |                                                                                                                                         
   = note: see issue #74878 <https://github.com/rust-lang/rust/issues/74878> for more information                                            
   = help: add `#![feature(min_const_generics)]` to the crate attributes to enable                                                           
                                                                                                                                             
error: aborting due to 3 previous errors                                                                                                     
                                                                                                                                             
For more information about this error, try `rustc --explain E0658`.                                                                          
error: could not compile `tungstenite`     

So, I will need to investigate why this problem occurs.

olorin37 avatar Jan 27 '22 08:01 olorin37

Is your rust stable version up to date ? The tungstenite crate rely on const generics, which were introducted in 1.51

lzanini avatar Jan 27 '22 09:01 lzanini

I'll check the version. I porobably was the newest stable version, but Im not sure.

olorin37 avatar Jan 27 '22 18:01 olorin37

Yep, you are quite right. I had set nightly environment set (one quite old release), and I thought that in one commend I've changed the tool chain to stable and updated it. But in reality I haven't change tool chain to stable. Now it is working. I found now that clap CLI is creted after app starts reading stdio... I wonder if I can change order...

olorin37 avatar Jan 27 '22 19:01 olorin37

@lzanini OK, I thing its ready now, can you review, run workflow and finally merge it?. Tests and building (dbg and release) binaries works locally on my laptop. Didn't you have any Changelog file? Maybe its worth to add it.

olorin37 avatar Jan 27 '22 19:01 olorin37

hmm I do not understand why it now works only with 0.4.15 mdbook although it has used 0.4.10 in Cargo.toml... But maybe it is not a problem, it should work with the newest

olorin37 avatar Jan 27 '22 19:01 olorin37

I recently stumbled over this as well. Are there any plans to continue on this PR? As it's only a small change, I could otherwise also just open another PR for this change.

jontze avatar Dec 07 '22 21:12 jontze

Thank you @olorin37 for this PR!

SichangHe avatar Dec 11 '22 20:12 SichangHe