tyxml
                                
                                
                                
                                    tyxml copied to clipboard
                            
                            
                            
                        IDEs and the ppx
Editing html with the ppx is ... a bit annoying.
- You don't get any fancy html handling/coloring. It would be nice to have something for that.
- Emacs: I know it's possible to do some fancy submodes but I don't know how to do it (and how easy it would be to distribute). cc @gsg @Chris00 ?
 - Vim : I'm not even sure who to call. @rgrinberg ?
 - Others : ???
 
 - Indentation by ocp-indent is terrible. @AltGr, can we do something about it ?
 
(See here for what the syntax looks like)
I am not sure what you expect for indentation. Recent ocp-indent supports ppx, and doesn't make assumptions about the contents of string quotations (i.e. they're indented as <:quot< >> used to be:
if starting with a newline, indentation is completely free and preserved by ocp-indent; otherwise, it's preserved but a minimum left margin corresponding to the first non-blank character is enforced)
it's preserved but a minimum left margin corresponding to the first non-blank character is enforced
That's the main issue. The string delimiters are placed a bit all over the place (since they are used as antiquotations..).
Consider this:
let%html my_paragraphs = {|
  <p>|}[my_span]{|</p>
  <p>more content</p>
|}
                                    
                                    
                                    
                                
In Tuareg, strings split on several lines are aligned with the opening {|.  I am not sure what general rule you would propose.  Why don't you write the above as:
let%html my_paragraphs =
  {|<p>|}[my_span]
    {|</p><p>more content</p>|}
                                    
                                    
                                    
                                
The goal is to format the inside of the quotation like you would format html.
@Drup so for you it would be best to follow the don't-touch rule whether the {| string starts with a newline or not ?
I think it would be better yes.