From 2a147c6fd117bc0c641ab7b9bdf305fb402700bf Mon Sep 17 00:00:00 2001 From: Ansgar Grunseid Date: Sun, 9 Feb 2020 00:26:06 -0800 Subject: [PATCH] Add code example. --- docs/edify.css | 9 +++++++++ docs/index.html | 14 ++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/docs/edify.css b/docs/edify.css index 27c7393..8abd0e7 100644 --- a/docs/edify.css +++ b/docs/edify.css @@ -20,6 +20,15 @@ div, p, h1 { code { white-space: nowrap; } +.pre { + display: block; + line-height: 1.5; + white-space: pre-line; + margin: 1em 0 1em 1.5em; +} +.pre:first-line { /* https://stackoverflow.com/a/14948580 */ + line-height: 0; +} td, th { padding: .5em 1em; diff --git a/docs/index.html b/docs/index.html index aef8dea..fb50f20 100644 --- a/docs/index.html +++ b/docs/index.html @@ -12,8 +12,18 @@

Python's strftime directives

-

Note: Examples are based on - datetime.datetime(2013, 9, 30, 7, 6, 5) +

+ Example: + + + >>> import datetime + >>> d = datetime.datetime(2013, 9, 30, 7, 6, 5) + >>> d.strftime('%H:%M:%S on %A %B %d, %Y') + '07:06:05 on Monday September 30, 2013' + + + Note: The examples below are based on + datetime.datetime(2013, 9, 30, 7, 6, 5).