telegram-export
telegram-export copied to clipboard
add html formating
Maybe it`s not very pretty code and rendering result, but it works for me. I copied some styles from telegram desktop exporter.
Looks appealing to me, but any browser will struggle with very large exports (I tried with a 145MB file and stopped Firefox at 4.4GB of memory used). Maybe we would need some sort of pagination? I also found that context is None
but that's probably a bug in telegram-export
itself, or an old broken database of mine.
Yea, but we can start from small improvments, i think.
I really appreciate you taking the time to work on this @mr-tron, thank you. This has been a feature we've been discussing for a long time.
Do you plan to merge this pull request? For pagination i need support on level begore htmlformatter. maybe baseformatter
Yes, let's start with small improvements as you said. We can build on this.
Some improvements that need to happen before this can be merged:
-
get_forward()'s code style should be made more consistent with the other get_X functions in BaseFormatter. I know it seems small, but consistency makes the code easier to read, and then a reader doesn't have to wonder if get_forward works differently and try to work out the differences.
-
get_human_readable_forwarded seems to me like it belongs at a higher level than BaseFormatter. It only uses public methods of the BaseFormatter, so this shouldn't be difficult. However, when you do move it, please also make its style consistent with other functions (in use of str.format() instead of % formatting, and correct spelling)
-
More style edits in htmlformatter (str.format() again)
I'll use GitHub's tools to annotate specific lines.
Once again, thank you so much for working on this. The reason I ask for these changes is not because I think you've done a bad job, but because I want this code to be a foundation for great things and that starts with fixing these nags.
I am very busy in this days. May be on next week.