From d0b038ac72ac288c9199d69e8b29caf003b3132f Mon Sep 17 00:00:00 2001 From: Alexis Mousset Date: Thu, 25 May 2017 23:35:32 +0200 Subject: [PATCH] Add search to website --- docs/404.html | 4 +- docs/creating-messages/index.html | 90 ++++++++++++++++++- docs/getting-started/index.html | 88 ++++++++++++++++++- docs/getting-started/intro/index.html | 101 +++++++++++++++++++++- docs/json/search.json | 42 ++++----- docs/sending-messages/file/index.html | 101 +++++++++++++++++++++- docs/sending-messages/index.html | 90 ++++++++++++++++++- docs/sending-messages/intro/index.html | 101 +++++++++++++++++++++- docs/sending-messages/sendmail/index.html | 101 +++++++++++++++++++++- docs/sending-messages/smtp/index.html | 101 +++++++++++++++++++++- docs/sending-messages/stub/index.html | 99 ++++++++++++++++++++- website/config.toml | 9 +- 12 files changed, 884 insertions(+), 43 deletions(-) diff --git a/docs/404.html b/docs/404.html index 0333ea1..4cb13d8 100644 --- a/docs/404.html +++ b/docs/404.html @@ -2,8 +2,8 @@ - - + + 404 Page not found diff --git a/docs/creating-messages/index.html b/docs/creating-messages/index.html index 77bf534..9e0d282 100644 --- a/docs/creating-messages/index.html +++ b/docs/creating-messages/index.html @@ -5,8 +5,8 @@ - - + + @@ -53,6 +53,19 @@ + + + + + + + @@ -265,11 +278,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/getting-started/index.html b/docs/getting-started/index.html index c6df2db..41a0de3 100644 --- a/docs/getting-started/index.html +++ b/docs/getting-started/index.html @@ -5,8 +5,8 @@ - - + + @@ -53,6 +53,19 @@ + + + + + + + @@ -267,8 +280,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -225,6 +238,17 @@
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/json/search.json b/docs/json/search.json index e21cc97..cbb4915 100644 --- a/docs/json/search.json +++ b/docs/json/search.json @@ -1,56 +1,56 @@ [ - { - "uri": "/content/basics/_index", - "title": "Some Chapter title", - "content": "\nChapter X\n\n Some Chapter title\n\nLorem ipsum\n", - "tags": [] - }, - { - "uri": "/content/basics/first-content", - "title": "Some Title", - "content": "\nLorem Ipsum\n", - "tags": [] - }, { "uri": "/content/creating-messages/_index", "title": "Creating messages", - "content": "\nCreating messages\n\n test2\n\nLorem ipsum\n", + "content": "\nCreating messages\n", "tags": [] }, { - "uri": "/content/creating-messages/first-content", - "title": "Some Title", - "content": "\nLorem Ipsum\n", + "uri": "/content/getting-started/_index", + "title": "Getting started", + "content": "\nGetting started\n\nThis section explains how to manipulate emails you have created.", + "tags": [] + }, + { + "uri": "/content/getting-started/intro", + "title": "Introduction", + "content": "\nLettre is an email library that allows creating and sending messages. It provides:\n\nAn easy to use email builder\nPluggable email transports\nUnicode support (for emails and transports, including for sender et recipient addresses when compatible)\nSecure defaults (emails are only sent encrypted by default)\n", "tags": [] }, { "uri": "/content/sending-messages/_index", "title": "Sending messages", - "content": "\nSending messages\n\n test\n\nLorem ipsum\n", + "content": "\nSending Messages\n\nThis section explains how to manipulate emails you have created.", "tags": [] }, { "uri": "/content/sending-messages/file", "title": "File transport", - "content": "\nLorem Ipsum\n", + "content": "\nThe file transport writes the emails to the given directory. The name of the file will be\nmessage_id.txt.\nIt can be useful for testing purposes, or if you want to keep track of sent messages.\n\nuse std::env::temp_dir;\n\nuse lettre::file::FileEmailTransport;\nuse lettre::{SimpleSendableEmail, EmailTransport};\n\n// Write to the local temp directory\nlet mut sender = FileEmailTransport::new(temp_dir());\nlet email = SimpleSendableEmail::new(\n \"user@localhost\",\n vec![\"root@localhost\"],\n \"message_id\",\n \"Hello world\"\n );\n\nlet result = sender.send(email);\nassert!(result.is_ok());\n\nExample result in /tmp/b7c211bc-9811-45ce-8cd9-68eab575d695.txt:\n\nb7c211bc-9811-45ce-8cd9-68eab575d695: from=user@localhost to=root@localhost\nTo: root@localhost\nFrom: user@localhost\nSubject: Hello\nDate: Sat, 31 Oct 2015 13:42:19 +0100\nMessage-ID: b7c211bc-9811-45ce-8cd9-68eab575d695.lettre@localhost\n\nHello World!\n", + "tags": [] + }, + { + "uri": "/content/sending-messages/intro", + "title": "Introduction", + "content": "\nThis mailer contains several different transports for your emails. To be sendable, the\nemails have to implement SendableEmail, which is the case for emails created with lettre_email.\n\nThe following transports are available:\n\nThe SmtpTransport uses the SMTP protocol to send the message over the network. It is\n the prefered way of sending emails.\nThe SendmailTransport uses the sendmail command to send messages. It is an alternative to\n the SMTP transport.\nThe FileTransport creates a file containing the email content to be sent. It can be used\n for debugging or if you want to keep all sent emails.\nThe StubTransport is useful for debugging, and only prints the content of the email in the\n logs.\n", "tags": [] }, { "uri": "/content/sending-messages/sendmail", "title": "Sendmail transport", - "content": "\nLorem Ipsum\n", + "content": "\nThe sendmail transport sends the email using the local sendmail command.\n\nuse lettre::sendmail::SendmailTransport;\nuse lettre::{SimpleSendableEmail, EmailTransport};\n\nlet email = SimpleSendableEmail::new(\n \"user@localhost\",\n vec![\"root@localhost\"],\n \"message_id\",\n \"Hello world\"\n );\n\nlet mut sender = SendmailTransport::new();\nlet result = sender.send(email);\nassert!(result.is_ok());\n", "tags": [] }, { "uri": "/content/sending-messages/smtp", "title": "SMTP transport", - "content": "\nThis transport uses the SMTP protocol to send emails over the network (locally or remotely).\n\nIt is desinged to be:\n\nSecured: email are encrypted by default\nModern: Unicode support for email content and sender/recipient adresses when compatible\nFast: supports tcp connection reuse\n\nThis client is designed to send emails to a relay server, and should not be used to send\nemails directly to the destination.\n\nThe relay server can be the local email server, a specific host or a third-party service.\n\nSimple example\n\nThis is the most basic example of usage:\n\n{{ highlight rust }}\nuse lettre::{SimpleSendableEmail, EmailTransport};\nuse lettre::smtp::SmtpTransportBuilder;\nuse lettre::smtp::SecurityLevel;\n\nlet email = SimpleSendableEmail::new(\n \"user@localhost\",\n vec![\"root@localhost\"],\n \"message_id\",\n \"Hello world\"\n );\n\n// Open a local connection on port 25\nlet mut mailer =\nSmtpTransportBuilder::localhost().unwrap().security_level(SecurityLevel::Opportunistic).build();\n// Send the email\nlet result = mailer.send(email);\n\nassert!(result.is_ok());\n{{ /highlight }}\n\n Complete example\n\n{{ highlight rust }}\nuse lettre::smtp::{SecurityLevel, SmtpTransport,\nSmtpTransportBuilder};\nuse lettre::smtp::authentication::Mechanism;\nuse lettre::smtp::SUBMISSION_PORT;\nuse lettre::{SimpleSendableEmail, EmailTransport};\n\nlet email = SimpleSendableEmail::new(\n \"user@localhost\",\n vec![\"root@localhost\"],\n \"message_id\",\n \"Hello world\"\n );\n\n// Connect to a remote server on a custom port\nlet mut mailer = SmtpTransportBuilder::new((\"server.tld\",\nSUBMISSION_PORT)).unwrap()\n // Set the name sent during EHLO/HELO, default is localhost\n .hello_name(\"my.hostname.tld\")\n // Add credentials for authentication\n .credentials(\"username\", \"password\")\n // Specify a TLS security level. You can also specify an SslContext with\n // .ssl_context(SslContext::Ssl23)\n .security_level(SecurityLevel::AlwaysEncrypt)\n // Enable SMTPUTF8 if the server supports it\n .smtp_utf8(true)\n // Configure expected authentication mechanism\n .authentication_mechanism(Mechanism::CramMd5)\n // Enable connection reuse\n .connection_reuse(true).build();\n\nlet result_1 = mailer.send(email.clone());\nassert!(result1.isok());\n\n// The second email will use the same connection\nlet result_2 = mailer.send(email);\nassert!(result2.isok());\n\n// Explicitly close the SMTP transaction as we enabled connection reuse\nmailer.close();\n{{ /highlight }}\n\nLower level\n\nYou can also send commands, here is a simple email transaction without\nerror handling:\n\n{{ highlight rust }}\nuse lettre::smtp::SMTP_PORT;\nuse lettre::smtp::client::Client;\nuse lettre::smtp::client::net::NetworkStream;\n\nlet mut email_client: ClientNetworkStream = Client::new();\nlet _ = emailclient.connect(&(\"localhost\", SMTPPORT), None);\nlet _ = emailclient.ehlo(\"myhostname\");\nlet _ = email_client.mail(\"user@example.com\", None);\nlet _ = email_client.rcpt(\"user@example.org\");\nlet _ = email_client.data();\nlet _ = email_client.message(\"Test email\");\nlet _ = email_client.quit();\n{{ /highlight }}\n\n", + "content": "\nThis transport uses the SMTP protocol to send emails over the network (locally or remotely).\n\nIt is desinged to be:\n\nSecured: email are encrypted by default\nModern: Unicode support for email content and sender/recipient adresses when compatible\nFast: supports tcp connection reuse\n\nThis client is designed to send emails to a relay server, and should not be used to send\nemails directly to the destination.\n\nThe relay server can be the local email server, a specific host or a third-party service.\n\nSimple example\n\nThis is the most basic example of usage:\n\nuse lettre::{SimpleSendableEmail, EmailTransport};\nuse lettre::smtp::SmtpTransportBuilder;\nuse lettre::smtp::SecurityLevel;\n\nlet email = SimpleSendableEmail::new(\n \"user@localhost\",\n vec![\"root@localhost\"],\n \"message_id\",\n \"Hello world\"\n );\n\n// Open a local connection on port 25\nlet mut mailer =\nSmtpTransportBuilder::localhost().unwrap().security_level(SecurityLevel::Opportunistic).build();\n// Send the email\nlet result = mailer.send(email);\n\nassert!(result.is_ok());\n\n Complete example\n\nuse lettre::smtp::{SecurityLevel, SmtpTransport,\nSmtpTransportBuilder};\nuse lettre::smtp::authentication::Mechanism;\nuse lettre::smtp::SUBMISSION_PORT;\nuse lettre::{SimpleSendableEmail, EmailTransport};\n\nlet email = SimpleSendableEmail::new(\n \"user@localhost\",\n vec![\"root@localhost\"],\n \"message_id\",\n \"Hello world\"\n );\n\n// Connect to a remote server on a custom port\nlet mut mailer = SmtpTransportBuilder::new((\"server.tld\",\nSUBMISSION_PORT)).unwrap()\n // Set the name sent during EHLO/HELO, default is localhost\n .hello_name(\"my.hostname.tld\")\n // Add credentials for authentication\n .credentials(\"username\", \"password\")\n // Specify a TLS security level. You can also specify an SslContext with\n // .ssl_context(SslContext::Ssl23)\n .security_level(SecurityLevel::AlwaysEncrypt)\n // Enable SMTPUTF8 if the server supports it\n .smtp_utf8(true)\n // Configure expected authentication mechanism\n .authentication_mechanism(Mechanism::CramMd5)\n // Enable connection reuse\n .connection_reuse(true).build();\n\nlet result_1 = mailer.send(email.clone());\nassert!(result1.isok());\n\n// The second email will use the same connection\nlet result_2 = mailer.send(email);\nassert!(result2.isok());\n\n// Explicitly close the SMTP transaction as we enabled connection reuse\nmailer.close();\n\nLower level\n\nYou can also send commands, here is a simple email transaction without\nerror handling:\n\nuse lettre::smtp::SMTP_PORT;\nuse lettre::smtp::client::Client;\nuse lettre::smtp::client::net::NetworkStream;\n\nlet mut email_client: ClientNetworkStream = Client::new();\nlet _ = emailclient.connect(&(\"localhost\", SMTPPORT), None);\nlet _ = emailclient.ehlo(\"myhostname\");\nlet _ = email_client.mail(\"user@example.com\", None);\nlet _ = email_client.rcpt(\"user@example.org\");\nlet _ = email_client.data();\nlet _ = email_client.message(\"Test email\");\nlet _ = email_client.quit();\n\n", "tags": [] }, { "uri": "/content/sending-messages/stub", "title": "Stub transport", - "content": "\nLorem Ipsum\n", + "content": "\nThe stub transport only logs message envelope and drops the content. It can be useful for\ntesting purposes.\n\nuse lettre::stub::StubEmailTransport;\nuse lettre::{SimpleSendableEmail, EmailTransport};\n\nlet email = SimpleSendableEmail::new(\n \"user@localhost\",\n vec![\"root@localhost\"],\n \"message_id\",\n \"Hello world\"\n );\n\nlet mut sender = StubEmailTransport;\nlet result = sender.send(email);\nassert!(result.is_ok());\n\nWill log the line:\n\nb7c211bc-9811-45ce-8cd9-68eab575d695: from=user@localhost to=root@localhost\n`", "tags": [] } ] \ No newline at end of file diff --git a/docs/sending-messages/file/index.html b/docs/sending-messages/file/index.html index 7111dd9..37337a0 100644 --- a/docs/sending-messages/file/index.html +++ b/docs/sending-messages/file/index.html @@ -4,8 +4,8 @@ - - + + @@ -52,6 +52,19 @@
+ + + + + + + @@ -225,6 +238,17 @@
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/sending-messages/index.html b/docs/sending-messages/index.html index 63b8f49..b28df6d 100644 --- a/docs/sending-messages/index.html +++ b/docs/sending-messages/index.html @@ -5,8 +5,8 @@ - - + + @@ -53,6 +53,19 @@
+ + + + + + + @@ -267,11 +280,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/sending-messages/intro/index.html b/docs/sending-messages/intro/index.html index 8f824da..ba46909 100644 --- a/docs/sending-messages/intro/index.html +++ b/docs/sending-messages/intro/index.html @@ -4,8 +4,8 @@ - - + + @@ -52,6 +52,19 @@ + + + + + + + @@ -225,6 +238,17 @@
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/sending-messages/sendmail/index.html b/docs/sending-messages/sendmail/index.html index 11e6056..0d5b197 100644 --- a/docs/sending-messages/sendmail/index.html +++ b/docs/sending-messages/sendmail/index.html @@ -4,8 +4,8 @@ - - + + @@ -52,6 +52,19 @@
+ + + + + + + @@ -225,6 +238,17 @@
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/sending-messages/smtp/index.html b/docs/sending-messages/smtp/index.html index c759e8f..48287ab 100644 --- a/docs/sending-messages/smtp/index.html +++ b/docs/sending-messages/smtp/index.html @@ -4,8 +4,8 @@ - - + + @@ -52,6 +52,19 @@
+ + + + + + + @@ -225,6 +238,17 @@
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/sending-messages/stub/index.html b/docs/sending-messages/stub/index.html index c1d2e67..f133021 100644 --- a/docs/sending-messages/stub/index.html +++ b/docs/sending-messages/stub/index.html @@ -4,8 +4,8 @@ - - + + @@ -52,6 +52,19 @@
+ + + + + + + @@ -225,6 +238,17 @@
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/website/config.toml b/website/config.toml index 74fc41d..1120f42 100644 --- a/website/config.toml +++ b/website/config.toml @@ -2,7 +2,12 @@ baseURL = "https://lettre.github.io/lettre/" languageCode = "en-us" title = "Lettre site" theme = "hugo-theme-learn" -search = true -author = "Alexis Mousset" publishDir = "../docs" PygmentsCodeFences = true + +[params] + editURL = "https://github.com/lettre/lettre/edit/master/website/content/" + description = "Documentation for the Lettre mailer in Rust" + author = "Alexis Mousset" + autoNav = true + search = true \ No newline at end of file