"The text is written in a way that is difficult to understand."
Is it correct to translate this sentence as
Le texte est écrit d'une manière qui est difficile de comprendre.
In particular, is it correct to use the preposition "de" in "d'une manière"? If translated directly from English it would be "dans" or "en", but I usually see "de" used with "manière".
Also, is it correct to use "de comprendre" rather than "à comprendre"?