From 97a944e8026de754038213d32a2863a92185ceeb Mon Sep 17 00:00:00 2001 From: Han Su Date: Wed, 18 Oct 2023 10:19:43 -0400 Subject: [PATCH] Update README.md more examples to readme --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index bdabbf1..7c860f2 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,15 @@ post = Post( post.add({'type': 'paragraph', 'content': 'This is how you add a new paragraph to your post!'}) +#bolden text +post.add({'type': "paragraph",'content':[{'content': "This is how you "},{'content': "bolden ",'marks':[{'type': "strong"}]},{'content': "a word."}]}) + +#add hyperlink to text +post.add({'type':'paragraph','content':[{'content': "View Link",'marks':[{'type': "link",'href':'https://whoraised.substack.com/'}]}]}) + +#add image +post.add({'type':'captionedImage','src': "https://media.tenor.com/7B4jMa-a7bsAAAAC/i-am-batman.gif"}) + draft = api.post_draft(post.get_draft()) api.prepublish_draft(draft.get("id"))