Feedback appreciated. ---------- I will try to add more definitions after hearing what features are needed. ##Features Markdown capabilities differ from environment to environment so I expect this will be only a base that someone will modify so it fits his/her needs best. - SE MD only supports **H1-H3** and Sub/sub/Titles got them. Sub/sub/Sections have **H4-H6** so you may change it since the latter group will look here as ordinary text. - Output cells generated by `whatever // TraditionalForm` are automatically $\LaTeX$ blocks. Inline `TraditionalForm` is inline $\LaTeX$. - At the moment only this one type of **Output cell** is parsed. - **Unknown cell styles** leave MD comment: `[//]: # (No rules defined for *CellStyleName*)`, which is not displayed ofc. - I tried to convert **`Hyperlinks`** and it seems to work. ---------- ##Tests I've put it as a procedure in palette which can convert things quite nicely. This is a **test notebook** I'm using and the result of tests pasted here: CreateDocument@ Uncompress@ "1:eJztFz2PG0XUueTyRS5BgBAFgkma3Fd8Z5MQcVEI9xETS3e5k/eSi5SgaGyP7VFmZ5bZ2dgXoAk1HQXkB1BRIvELUqWFno6CBjoqwnuz9q53vXbsHEgUNDszb957877f27NVVWlM53I5/zh8birDqko9aBxCyBH4bHLfxKd1JkRjCk8z3dPHWgXeBjW0cSJBcjhBcqj3wC7rGIs91Y/tHMUrbgQj4QWiOmZfsDXVcRCrqkQ9pqkEgvknYVNS0uwx3mwZi7UGWM50j1cK/0xXmPUWlU22y13mM8RA2XD97uea+PLab6udwp92nVAFVN8JqmaYFqgiN1TwWkquE109HEFlaImyRXOO93GcUJcn33zlog7Pvv9aDurivBJy9rvM0+cJHyt5HYWPPN15ateY3D52CzbXpWGaGLAcaTHN8iQE7Gpa54YrSUVJaZdw6QWGNJQm7CEVAcUrABJKfOZRTQ0jNWBJqkyo9op1OXpjvPhMuCvLucdsBHUssgWgLyqqDbAYPc6HsW+PDMRJGbRvojoO4t4dzc/idOx3sW//if0uvOA13Dif6pDJ3QQ52mNpyUHvpvxgU6iMvpgwEn669uQwRkDuo5PTw1Ko38pTPQC+isKPNqxFx1gtaVpDcRHFAk/bAPaY9muaewbzLVa12PddiIVAs0SIfpYZUJDtwIxlh2TF1O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aCQ92uCUXnLm42ELcyF1JqZQEsSMv/Cttqd0Eij0jvq7ntc1lUb58pknJdxUyheulxGD18uLKdoZyLa7tw6rN7hiX873f1RyJhbESF5x8Vfz59nDAolraS5Luu3YeaBdHIuoYjL+fdsEdriNa181TAkFMsns+9fvACVb47MbsNPCCQY+WCRFJcLl+ZSvG2Nx4F5gzW4tKnqO2gcONNAmLys/g3mY1Qp" (*^ double click to select. Don't evaluate this if the last edit was made by someone else than me*) # Result ---------- # Title **bold** ## Subtitle *italic* ### Subsubtitle Enter text here. Enter TraditionalForm input for evaluation in a separate cell below: ---------- Integrate[x, x] + Sqrt[x] // TraditionalForm $$\frac{x^2}{2}+\sqrt{x}$$ + Enter bulleted item text here. Enter item paragraph text here. + Enter subitem text here. Enter text here. Enter formula for display in a separate cell below: [//]: # (No rules defined for DisplayFormula) #### Section with Hyperlink: [Wolfram Research, Inc.](http://www.wolfram.com) and a TraditionalForm expression: $\frac{x^2}{2}+\sqrt{x}$ (*both are in InlineCells*) Enter text here. Enter an inline formula like this: $4$. 1. Enter numbered item text here. Enter item paragraph text here. 1. Enter numbered subitem text here. Enter item paragraph text here. 1. Enter subitem text here. Enter item paragraph text here. Enter text here. Enter formula for numbered display in a separate cell below: [//]: # (No rules defined for DisplayFormulaNumbered) Enter text here. Enter Wolfram Language program code below. ---------- fun[x_] := 1 Enter text here. Enter non-Wolfram Language program code below. [//]: # (No rules defined for Program) ---------- # /Result ## Code for palette CreatePalette[#, CellContext -> Notebook] &@DynamicModule[{}, Button["Export to Markdown", CreateDocument@exportMD@InputNotebook[]], Initialization :> ( itemIndent = " "; codeIndent = " "; itemMark = "+ "; itemPrefix = Function[{cellObj, style}, Module[{ ind, depth, numberedQ, paragraphQ}, ind = ToString@CurrentValue[cellObj, {"CounterValue", style}]; depth = StringCount[style, "sub", IgnoreCase -> True]; numberedQ = StringCount[style, "numbered", IgnoreCase -> True] > 0; paragraphQ = StringCount[style, "paragraph", IgnoreCase -> True] > 0; StringJoin@Flatten@{ ConstantArray[itemIndent, depth + If[paragraphQ, 2, 1]], Which[ numberedQ, {ind, ". "}, paragraphQ, "", True, itemMark] } ]]; prefix[styleName_] := Switch[styleName, "Title", "# ", "Subtitle", "## ", "Subsubtitle", "### ", "Section", "#### ", "Subsection", "##### ", "Subsubsection", "###### ", "Text", "", "items", itemPrefix, "code", codeIndent ]; styleWrapper[opts___] := Module[{italic, bold, wrapper }, italic = MemberQ[{opts}, Verbatim[Rule][FontSlant, "Italic"]]; bold = MemberQ[{opts}, Verbatim[Rule][FontWeight, "Bold"]]; Print[italic, " ", bold]; wrapper = Which[ bold, "**", italic, "*", True, "" ]; wrapper <> # <> wrapper & ]; parseCodeData[data_] := StringReplace[ First[FrontEndExecute[FrontEnd`ExportPacket[data, "InputText"]]], "\n" -> "\n" <> codeIndent ]; textStyleQ = (StringCount[#, "title" | "section" | "text", IgnoreCase -> True] > 0) &; itemStyleQ = (StringCount[#, "item", IgnoreCase -> True] > 0) &; codeStyleQ = MemberQ[{"Code", "Input"}, #] &; exportMD[nb_NotebookObject] := StringJoin@Flatten[exportMD /@ Cells[nb]]; exportMD[cellObj_CellObject] := exportMD[NotebookRead[cellObj], cellObj]; exportMD[cell_Cell, cellObj_CellObject] := exportMD[#2, #, cellObj] & @@ cell; exportMD[style_?textStyleQ, data_, cellObj_CellObject] := { prefix[style], parseData@data, "\n\n" }; exportMD[style_?itemStyleQ, data_, cellObj_CellObject] := { prefix["items"][cellObj, style], parseData@data, "\n\n"}; exportMD[style_?codeStyleQ, data_, cellObj_CellObject] := { "\n\n----------\n\n", codeIndent, parseCodeData@data, "\n\n"}; exportMD["Output", BoxData[FormBox[boxes_, TraditionalForm]], cellObj_CellObject] := TemplateApply[ "$$``$$\n\n", {boxesToTeX@boxes} ]; parseData[list_List] := parseData /@ list; parseData[string_String] := string; parseData[data_ (BoxData | TextData)] := List @@ (parseData /@ data); parseData[cell_Cell] := parseData@First@cell; (*inlince cells style skipped*) parseData[StyleBox[expr_, opts___]] := styleWrapper[opts]@parseData[expr]; parseData[ FormBox[boxes : Except[_TagBox], TraditionalForm, ___]] := Module[{teXForm}, teXForm = boxesToTeX@boxes; "$" <> teXForm <> "$" ]; parseData[ box : ButtonBox[_, ___, BaseStyle -> "Hyperlink", ___]] := Module[{label, url}, {label, url} = {#, #2} & @@ ToExpression[box]; TemplateApply[ "[``](``)", {StringJoin@Flatten@{parseData@label}, url}] ]; (*default behaviour for boxes*) parseData[boxes_] := parseData@First@boxes; (*default behaviour for cell styles*) exportMD[s_, ___] := TemplateApply["[//]: # (No rules defined for ``)\n\n", {s}]; boxesToTeX = ToString[ToExpression@#, TeXForm] &; ) ] [1]: https://i.sstatic.net/4Lh8o.png