Replies: 5 comments
-
Oh, and I almost forgot, we also fixed the table sorting by date in the web interface using the sugar parser shown here: https://mottie.github.io/tablesorter/docs/example-parsers-dates.html
We also added this to the end, with all the scripts:
Then you can add the class "sorter-sugar" to any table with a dates column and the sorting is fixed. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Hey!
I don't think this is something most Ghostwriter users will come up against, but when I try to extend Ghostwriter's abilities with less conventional templates and whitecards, this is something that I get quite a lot. I am planning to modify Ghostwriter's server side more rather than client-side and in the template to fit our needs. |
Beta Was this translation helpful? Give feedback.
-
Thank you for the explanation. The templates are interesting. If you have other examples, I can look into how to make things easier. You can do a lot with Jinja2, but more complicated filtering and looping can get messy, making the template more challenging to maintain. Adding your |
Beta Was this translation helpful? Give feedback.
-
Hey @KomodoGuy, I'm working on an update for this week. I've added the I set all columns with date ranges to use a standard The docm support will take a little longer. In the meantime, you can use docx files with macros, which make their way into the final document. It will be nice to support docm as an option. Other PRs would be nice to have, too, so it might make sense to create a custom fork of |
Beta Was this translation helpful? Give feedback.
-
Hey o/
We've been loving Ghostwriter for making better reports faster :) but it had a few features missing and needed a small fix.
Since we've modified it quite a bit our version is a bit outdated so if these have already been fixed or added then sorry.
Fix: correct link behavior
When using normal Ghostwriter links which are inserted using TinyMCE as clickable links came out both as a link and text:
This can be fixed by adding a
return
to the end of the "hyperlink" section of "_write_xml" in "ghostwriter/modules/reportwriter.py":Links then come out correctly.
Fix: use lists longer than 2 in report template
This can be done by adding a jinja2 filter, to see how to do that, see #284.
The jinja2 filter we added is:
and is used like this:
{{ "cat,dog,parrot,kangaroo".split(',') | get_item(3) }}
will print "kangaroo".Feature: add .docm support
We use word document macros to help with the reporting process since Ghostwriter is used to get the first draft which is revised outside of it.
We add the same macros to each document so we wanted our templates to include them.
This was a bit problematic and the solution is not elegant, as one of the libraries Ghostwriter uses, "python-docx", does not support it.
However, there is a pull request which adds this feature: python-openxml/python-docx#716
I integrated the pull request using the Dockerfile by adding these lines:
I also added the updated library files to the directory, they are attached as text files, change them to python files :)
api.py.txt
constants.py.txt
init.py.txt
Ghostwriter also needs to be updated, this is also a bit janky, but works. I changed the "Get" method of the class "GenerateReportDOCX" in ghostwriter/reporting/views.py:
We've also rearranged a lot of items, and made fully extendible fields using whitecards, a whole lot of Javascript and a fitting template.
Best,
Ellen and the Komodo team 😄
Beta Was this translation helpful? Give feedback.
All reactions