Open avigoldman opened 6 years ago
Just a thought: Maybe tags can also have a plain text (or markdown, ...) representation? Otherwise I'm sure there are lots of tools to choose from that already attempt to convert HTML into plain text.
@avigoldman I am interested in contribution, if someone can guide me a bit i can pick this up... as its my first time to do.
@karfau interesting thought. I'm not sure what behavior HTML to plaintext tools will have with email code that uses tables for the layouts. My thought with this is that we already know the desired output with each element so we can convert to text with more certainty.
@CharanyaR so psyched to get your help on this! I'll comment in here when I have more docs around how the internal work and how to contribute!
@avigoldman Sure..keep me posted..so that i can get started...
thanks a lot )
Being able to render to the email as a plain text file will great as it will let users write their content in a single place and get it in both of the formats they'll need to send out.
Braindump time
I'm not sure what the best interface for the package/cli is. I'm leaning towards a flag on the CLI but I can also see it as a separate command. Maybe also an option for the
develop
command?My initial thought is having an option of the file type to export to: either
txt
oreml
which might point to more of a standalone command. (See #7)For the implementation, I'm thinking a default
plaintext
function that gets added by thecreateElement
that simply returns the content. For elements where that doesn't work, you override it. i.e. theimg
element returns the alt text and the image url.Any and all suggestions are welcome! 🙌