From: Abdullah Al-h. <al...@ho...> - 2021-01-15 07:50:04
|
Hi , I have translated docutils to Arabic, and it is working fine, however, I am getting the direction wrong ( text is aligned to left) [cid:image003.jpg@01D6EB29.AA4121B0] I saw these two scripts on Docutils FAQ (Frequently Asked Questions) (sourceforge.io)<https://docutils.sourceforge.io/FAQ.html#can-i-produce-documents-in-right-to-left-languages> , which should solve this issue. I followed the instruction but when I run rst2html_bidi I get the following error AttributeError: 'Element' object has no attribute 'dir' Exiting due to error. Use "--traceback" to diagnose. Please report errors to <doc...@li...>. Include "--traceback" output, Docutils version (0.17b.dev [release]), Python version (3.7.9), your OS type & version, and the command line used. Traceback (most recent call last): File "./rst2html_hibidi.py", line 38, in <module> publish_cmdline(writer=HiBiDiWriter(), description=description) File "/home/geohadab/github/docutils/docutils/docutils/core.py", line 355, in publish_cmdline config_section=config_section, enable_exit_status=enable_exit_status) File "/home/geohadab/github/docutils/docutils/docutils/core.py", line 220, in publish output = self.writer.write(self.document, self.destination) File "/home/geohadab/github/docutils/docutils/docutils/writers/__init__.py", line 79, in write self.translate() File "./rst2html_hibidi.py", line 30, in translate self.output = hibidi.hibidi_unicode(self.output, encoding=self.destination.encoding) File "/home/geohadab/github/hibidi.py", line 34, in hibidi_unicode return hibidi_str(u.encode(encoding), root).decode(encoding) File "/home/geohadab/github/hibidi.py", line 39, in hibidi_str hibidi_dom(doc, root) File "/home/geohadab/github/hibidi.py", line 50, in hibidi_dom assign_dirs(node) File "/home/geohadab/github/hibidi.py", line 101, in assign_dirs assign_dirs(child, node.dir) File "/home/geohadab/github/hibidi.py", line 101, in assign_dirs assign_dirs(child, node.dir) File "/home/geohadab/github/hibidi.py", line 97, in assign_dirs if not node.dir: AttributeError: 'Element' object has no attribute 'dir' Could you please help Thank you |