aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2021-03-20Update TODOHEADv0.0.1masterTeddy Wing
2021-03-20doc/ottolangy.1.txt: Add the version command line argument to docsTeddy Wing
2021-03-20main(): Add a version command line argumentTeddy Wing
Make it easy to find out what version of the program is installed.
2021-03-20Makefile: Create a distribution packageTeddy Wing
2021-03-20doc/ottolangy.1.txt: Add the install prefix to installed filesTeddy Wing
2021-03-20README: Add more description, examples, and install informationTeddy Wing
2021-03-20Add man pageTeddy Wing
2021-03-17README: Remove the Usage section and replace it with InstallTeddy Wing
Realised that there wasn't really a difference between the content for the two.
2021-03-17Add in-progress READMETeddy Wing
2021-03-16Update TODOTeddy Wing
2021-03-16100-creates-a-french-attribution-config: Fix test for attribution_localeTeddy Wing
The file reading code I had previously was incorrect: it only read the first line of the file into `$generated_config` instead of the whole file. Fix the file reading code and add the new `$attribution_locale` config line.
2021-03-16Set `$attribution_locale` in generated muttrcTeddy Wing
The French attribution from before capitalised the month name because I have an EN locale by default. The month shouldn't be capitalised in French. Set the `$attribution_locale` to match the language of the attribution template string. Hard-coding `en_US` on the English one as that's the locale I'm used to.
2021-03-16Update TODOTeddy Wing
2021-03-14muttrc: Add description and licenseTeddy Wing
License the muttrc file under the Unlicense to allow the macros to be used freely.
2021-03-14Update TODOTeddy Wing
2021-03-14Remove TODOs and debug output from multipart and HTML workTeddy Wing
Now that we've handled 'multipart/relative' and HTML-only 'text/plain'-less emails, we can remove these.
2021-03-14Extract HTML tag remover to a functionTeddy Wing
Now that we're using it in two places, move it to a function. Also remove the `unwrap` call.
2021-03-14Extract email body from HTML part if no text part existsTeddy Wing
We're already doing this for single-part emails. This change makes it work additionally for multipart emails.
2021-03-14get_email_body(): Remove unnecessary loops over headersTeddy Wing
Now that I know the `Content-Type` header is already parsed in the original email parse call, use that instead of looping over the headers trying to find the content type.
2021-03-14Strip HTML tags from single-part HTML emailsTeddy Wing
When an HTML body is fed to 'whatlang', it recognises it as English. This is likely due to the English HTML syntax. Remove all HTML tags with a simple regex substitution to get the language recognition working more properly. This doesn't remove CSS, which could also confuse the language recogniser. In a limited test, it seemed to work without having to remove any CSS, so not bothering with that. Still need to get this working for multipart emails.
2021-03-14Debug email content typesTeddy Wing
Figuring out the different content types and subparts for different kinds of emails.
2021-03-14Update TODOTeddy Wing
Fix date. That was last night.
2021-03-14get_email_body(): Add TODOsTeddy Wing
2021-03-14get_email_body(): Support emails with attachmentsTeddy Wing
Parse the text email body out of `multipart/alternative` parts.
2021-03-14Update TODOTeddy Wing
2021-03-14muttrc: Add help text to macrosTeddy Wing
2021-03-14muttrc: Only define `L` macro in `pager`, not `index`Teddy Wing
In `index` view, the `L` binding maps to `bottom-page`.
2021-03-14muttrc: Unset `wait_key`Teddy Wing
Don't require a key to be pressed when using the overridden reply macros.
2021-03-14Add a muttrc fileTeddy Wing
Add the Mutt macros necessary to make the system work. Override the reply commands, wrapping them to pipe the message to Ottolangy.
2021-03-14Add TODOTeddy Wing
2021-03-14Import `thiserror::Error` as `Error`Teddy Wing
Now that we're no longer using `anyhow::Error` as `Error`.
2021-03-14main: Collapse `match`Teddy Wing
Collapse arms that return the same exit code.
2021-03-14Add additional sysexits error codes for other errorsTeddy Wing
Give types to the errors in `run()` and exit with appropriate error codes. Split out an additional error type so we can wrap errors from the non-main functions. Remove 'anyhow', replacing it with 'thiserror' now that we're using error types.
2021-03-14Exit with sysexits.h error codes on errorTeddy Wing
2021-03-14Wrap errors in a custom `OttolangyError` typeTeddy Wing
Give us a way to match on the type of error so we can return an appropriate exit code.
2021-03-14Add an integration testTeddy Wing
Feed a sample email to the program and test whether it wrote the correct Muttrc config.
2021-03-14Remove Idea.txtTeddy Wing
Now that the program is basically finished.
2021-03-14Remove mail.pyTeddy Wing
Now that I've figured out what was wrong with parsing email bodies.
2021-03-14Add license (GNU GPLv3+)Teddy Wing
2021-03-13Add context to errorsTeddy Wing
Include the 'anyhow' crate to add additional context to errors.
2021-03-13Add documentationTeddy Wing
2021-03-13get_email_body(): Add a real error stringTeddy Wing
Replace the temporary error string with one that provides a hair more context.
2021-03-13get_email_body(): Remove unnecessary `else` branchTeddy Wing
2021-03-13Remove debug print callsTeddy Wing
These print outputs were for help developing and debugging. They're no longer necessary since the program is basically working.
2021-03-13main(): Replace `unwrap`s with tryTeddy Wing
Move the `main()` function contents to a new `run()` function that returns a `Result`. This way we can easily print the error in `main()`.
2021-03-13Replace `unwrap`s with try in non-main functionsTeddy Wing
2021-03-13Write an attribution config fileTeddy Wing
Set attribution config strings for French and English. If the input email's body language is in French, set my French attribution string. Otherwise use English. Write the attribution string to a config file at `~/.local/share/ottolangy/attribution.muttrc`. We can then source this config file to set the attribution.
2021-03-09Use 'whatlang' to detect the language of the email bodyTeddy Wing
2021-03-09Move email body parsing code to a new functionTeddy Wing
Isolate this block.
2021-03-09Fix single-part email handlingTeddy Wing
The old code was from when I was testing with a multipart email and hadn't figured out how to extract the body from it.