telegram-export icon indicating copy to clipboard operation
telegram-export copied to clipboard

add html formating

Open mr-tron opened this issue 6 years ago • 7 comments

Maybe it`s not very pretty code and rendering result, but it works for me. I copied some styles from telegram desktop exporter.

mr-tron avatar Oct 21 '18 20:10 mr-tron

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.

Lonami avatar Oct 23 '18 15:10 Lonami

Yea, but we can start from small improvments, i think.

mr-tron avatar Oct 23 '18 15:10 mr-tron

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.

expectocode avatar Oct 24 '18 23:10 expectocode

Do you plan to merge this pull request? For pagination i need support on level begore htmlformatter. maybe baseformatter

mr-tron avatar Oct 25 '18 08:10 mr-tron

Yes, let's start with small improvements as you said. We can build on this.

expectocode avatar Oct 25 '18 10:10 expectocode

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.

expectocode avatar Oct 25 '18 10:10 expectocode

I am very busy in this days. May be on next week.

mr-tron avatar Oct 27 '18 09:10 mr-tron