Copy markdown as HTML

315 views
Skip to first unread message

Frank Eves

unread,
Nov 7, 2022, 4:01:21 PM11/7/22
to BBEdit Talk
Markdown focused applications like iA Writer, Marked2 and Ulysses have an Edit Menu item 'Copy as HTML'. I find it handy when creating WordPress content. Unfortunately, for my purposes, BBEdit's Edit menu's 'Copy as Styled HTML' outputs more complex text. Can someone suggest an easy way to copy markdown as basic HTML in BBEdit?

Rick Gordon

unread,
Nov 8, 2022, 6:14:19 AM11/8/22
to bbe...@googlegroups.com
I suspect that the information on this page, referring to the
python3-markdown utility, could be used, along with BBEdit's ability to
run terminal commands and/or text filters.

http://tuxdiary.com/2016/06/30/markdown-to-html-terminal

Rick Gordon

----

On November 7, 2022 at 1:15:10 PM [-0800], Frank Eves wrote in an email
entitled "Copy markdown as HTML":
> --
> This is the BBEdit Talk public discussion group. If you have a feature
> request or need technical support, please email
> "sup...@barebones.com" rather than posting here. Follow @bbedit on
> Twitter: <https://twitter.com/bbedit>
> ---
> You received this message because you are subscribed to the Google
> Groups "BBEdit Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to bbedit+un...@googlegroups.com
> <mailto:bbedit+un...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/bbedit/186955c6-fd95-4e9e-8703-028543b9f1d5n%40googlegroups.com
> <https://groups.google.com/d/msgid/bbedit/186955c6-fd95-4e9e-8703-028543b9f1d5n%40googlegroups.com?utm_medium=email&utm_source=footer>.

___________________________________________
RICK GORDON
EMERALD VALLEY GRAPHICS AND CONSULTING
___________________________________________
WWW: http://www.shelterpub.com

Rich Siegel

unread,
Nov 8, 2022, 6:57:15 AM11/8/22
to BBEdit Talk
"Copy as Styled HTML" is intended for copying an HTML representation of the actual text displayed in the editing area, e.g. for including the syntax-colored text as a code example in a web page.

When used with a Markdown document, the "Export as HTML" command on the File menu will export the same HTML that is used for previewing.

R.

Neil Faiman

unread,
Nov 8, 2022, 7:33:12 AM11/8/22
to BBEdit Talk Mailing List
On Nov 8, 2022, at 6:57 AM, Rich Siegel <sie...@barebones.com> wrote:

When used with a Markdown document, the "Export as HTML" command on the File menu will export the same HTML that is used for previewing.

Is that functionality accessible through AppleScript?

Greg Raven

unread,
Nov 8, 2022, 10:18:56 AM11/8/22
to BBEdit Talk
The obvious answer is to copy the Markdown and paste it into WordPress. WordPress will convert it to it's own special format(s), and then your should be good to go.

If you insist on using HTML for WordPress, Daring Fireball offers a BBEdit plugin that converts Markdown to HTML.

jj

unread,
Nov 8, 2022, 11:54:00 AM11/8/22
to BBEdit Talk
You could try pandoc.

 Install it from Terminal with homebrew:

    % brew install pandoc
   
Create this simple BBEdit script in ~/Library/Application\ Support/BBEdit/Scripts/copy_markdown_as_html.applescript
   
and call the script from menu Script > Apply Text Filter > copy_markdown_as_html.

HTH,

Jean Jourdain

jj

unread,
Nov 8, 2022, 12:08:29 PM11/8/22
to BBEdit Talk
Oups! Hastily copy/pasted:
* ... and call the script from menu Script > Apply Text Filter > copy_markdown_as_html.

Should read:
and call the script from menu Scripts > copy_markdown_as_html.

Rails Smith

unread,
Nov 25, 2022, 8:15:19 PM11/25/22
to bbe...@googlegroups.com

not bbedit but may be helpful

# brew install cmark

# cmark -t html src.md > dst.html

if you are really interested in the markdown details:

# brew install markdownlint-cli

# markdownlint src.md > errors-md.txt 2>&1


Reply all
Reply to author
Forward
0 new messages