So...
I wrote this nice document in Markdown.
Looks exactly the way I want it in the preview window.
Uh...how do I save the generated HTML from within TextMate?
Sorry if this is a dumb question, I thought it would be obvious.
I could run the markdown.pl script from the command line but that seems unnecessarily convoluted.
Thanks,
S
If you like what you see in the preview window, you can hit Cmd+Option +U (the view source key in Safari and Mail.app) and you'll get a TextMate document with the HTML that was generated for the preview window. Alternatively, you can use the "Convert Document to HTML" (Ctrl+Shift+H) command from the Markdown bundle in the Markdown document.
-Brad
On Mar 31, 2007, at 5:11 PM, Lists In@IDC wrote:
So...
I wrote this nice document in Markdown.
Looks exactly the way I want it in the preview window.
Uh...how do I save the generated HTML from within TextMate?
Sorry if this is a dumb question, I thought it would be obvious.
I could run the markdown.pl script from the command line but that seems unnecessarily convoluted.
Thanks,
S
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
On Mar 31, 2007, at 8:17 PM, Brad Choate wrote:
If you like what you see in the preview window, you can hit Cmd +Option+U (the view source key in Safari and Mail.app) and you'll get a TextMate document with the HTML that was generated for the preview window.
I was using the TextMate preview, doesn't seem to be a way to get source out of there though that would be, obviously, very handy.
Alternatively, you can use the "Convert Document to HTML" (Ctrl +Shift+H) command from the Markdown bundle in the Markdown document.
That seems to convert to HTML in situ, is there an option to create a new HTML document from the source you're viewing?
Seems like this should be easier...
Thanks,
S
On 1. Apr 2007, at 02:33, Lists In@IDC wrote:
On Mar 31, 2007, at 8:17 PM, Brad Choate wrote:
If you like what you see in the preview window, you can hit Cmd +Option+U (the view source key in Safari and Mail.app) and you'll get a TextMate document with the HTML that was generated for the preview window.
I was using the TextMate preview, doesn't seem to be a way to get source out of there though that would be, obviously, very handy.
There is (as Brad said :) ). It’s View → View Source (⌥⌘U).
Alternatively, you can use the "Convert Document to HTML" (Ctrl +Shift+H) command from the Markdown bundle in the Markdown document.
That seems to convert to HTML in situ, is there an option to create a new HTML document from the source you're viewing?
Go to Bundles → Show Bundle Editor → Edit Commands… (⌃⌥⌘C)
Now locate Markdown → Convert Document / Selection to HTML (second item in the Markdown bundle) and change the “Output” from “Replace Selected Text” to “Create New Document”. Now ⌃⇧H will open a new window with the HTML.
Seems like this should be easier...
Manually converting your Markdown formatted text to HTML in TextMate and saving that somewhere is NOT a recommended workflow, and that is why we do not have a “Save the HTML to a new location” command by default (but it would be easy to add).
Let me clarify on the purpose of using Markdown, it may arise in two situations:
1) You are writing content for your blog, manual, web-site, or similar. In this case you want your content to STAY in Markdown, and have the conversion happen on display (potentially cached), i.e. never inside TextMate (here you only need the Preview command) -- the reason you want the content to stay as Markdown is so that you can go back and edit the easy-to-read version of your content.
2) You are submitting content, which is required to be in HTML, to somewhere, for example a comment on a blog. Here you want to write in Markdown, convert to HTML, and submit that (likely throwing away the original, since you generally do not keep a local copy of your comments to blogs, etc.) -- if for example it was a web-site comment, the workflow could be to invoke “Edit in TextMate” from the browser, write in Markdown, press ⌃⇧H to convert it to HTML, now save, close, and submit.
On Mar 31, 2007, at 11:05 PM, Allan Odgaard wrote:
Alternatively, you can use the "Convert Document to HTML" (Ctrl +Shift+H) command from the Markdown bundle in the Markdown document.
That seems to convert to HTML in situ, is there an option to create a new HTML document from the source you're viewing?
Go to Bundles → Show Bundle Editor → Edit Commands… (⌃⌥⌘C)
Now locate Markdown → Convert Document / Selection to HTML (second item in the Markdown bundle) and change the “Output” from “Replace Selected Text” to “Create New Document”. Now ⌃⇧H will open a new window with the HTML.
I have two different commands with two different scopes -- on one, the scope is text.html.markdown, the other is text.html.markdown.multimarkdown. The first is the one that's being used and it was set to replace while the other was set to create a new document and they were bound to the same key; ⌃⇧H.
Thanks for the pointer, they now both do what I want.
Seems like this should be easier...
Manually converting your Markdown formatted text to HTML in TextMate and saving that somewhere is NOT a recommended workflow, and that is why we do not have a “Save the HTML to a new location” command by default (but it would be easy to add).
Let me clarify on the purpose of using Markdown, it may arise in two situations:
- You are writing content for your blog, manual, web-site, or
similar. In this case you want your content to STAY in Markdown, and have the conversion happen on display (potentially cached), i.e. never inside TextMate (here you only need the Preview command) -- the reason you want the content to stay as Markdown is so that you can go back and edit the easy-to-read version of your content.
- You are submitting content, which is required to be in HTML, to
somewhere, for example a comment on a blog. Here you want to write in Markdown, convert to HTML, and submit that (likely throwing away the original, since you generally do not keep a local copy of your comments to blogs, etc.) -- if for example it was a web-site comment, the workflow could be to invoke “Edit in TextMate” from the browser, write in Markdown, press ⌃⇧H to convert it to HTML, now save, close, and submit.
3) You have to write a document with relatively light formatting to be e-mailed and/or posted to a one-off web page during fast and furious specification development. So, it needs to be pasted into an e-mail and/or "saved as" a simple file-based web page. You need to keep the Markdown version as that will form the basis of the final version but it's much too cumbersome to edit and format in Word at this stage (or any stage, but that's another discussion).
In other words, editing actual text in Word sucks -- I'm much faster in TextMate.
In that third use-case, I see a great reason to have both Convert-
new document and Save HTML to New Location.
Maybe I'm hitting this nail with the wrong type of hammer? Maybe what I'm really looking for is Latex? Seems like an awful lot of people on this list use it though I've never explored it at all.
What do other people use for writing specifications where TextMate is obviously the best tool (ever) for writing text but the final document needs to be fanch-schmancy for Suit consumption?
Thanks,
S
Lists In@IDC wrote:
What do other people use for writing specifications where TextMate is obviously the best tool (ever) for writing text but the final document needs to be fanch-schmancy for Suit consumption?
Markdown works fine for that, but you usually want to use your own command, which adds your own css/etc. to the output html. The preview is just supposed to be a preview, not a final document.
-Jacob
On Sun, Apr 01, 2007 at 08:21:03AM -0400, Lists In@IDC wrote:
- You have to write a document with relatively light formatting to be
e-mailed and/or posted to a one-off web page during fast and furious specification development. So, it needs to be pasted into an e-mail and/or "saved as" a simple file-based web page. You need to keep the Markdown version as that will form the basis of the final version but it's much too cumbersome to edit and format in Word at this stage (or any stage, but that's another discussion).
This is my own normal use of Markdown, and I like the idea of adding "Save HTML to new location" to the default Markdown bundle. In this usage case, the HTML is like the PDF compiled from LaTeX source; the PDF is for public consumption, but you need the LaTeX to continue to change the document.
-- Mike
On Apr 1, 2007, at 6:28 PM, Michael Williams wrote:
On Sun, Apr 01, 2007 at 08:21:03AM -0400, Lists In@IDC wrote:
- You have to write a document with relatively light formatting
to be e-mailed and/or posted to a one-off web page during fast and furious specification development. So, it needs to be pasted into an e-mail and/or "saved as" a simple file-based web page. You need to keep the Markdown version as that will form the basis of the final version but it's much too cumbersome to edit and format in Word at this stage (or any stage, but that's another discussion).
This is my own normal use of Markdown, and I like the idea of adding "Save HTML to new location" to the default Markdown bundle. In this usage case, the HTML is like the PDF compiled from LaTeX source; the PDF is for public consumption, but you need the LaTeX to continue to change the document.
There is a difference however, in that the LaTeX source has all the information determining how the resulting PDF should look like. On the other hand, Markdown doesn't contain any CSS information. So if we only care about the HTML, without any css specification, then this can be done of course, but I am not sure if it really is that useful.
-- Mike
Haris Skiadas Department of Mathematics and Computer Science Hanover College
On Apr 2 2007, at 01:39, Charilaos Skiadas wrote:
On Apr 1, 2007, at 6:28 PM, Michael Williams wrote:
On Sun, Apr 01, 2007 at 08:21:03AM -0400, Lists In@IDC wrote:
- You have to write a document with relatively light formatting
to be e-mailed and/or posted to a one-off web page during fast and furious specification development. So, it needs to be pasted into an e-mail and/or "saved as" a simple file-based web page. You need to keep the Markdown version as that will form the basis of the final version but it's much too cumbersome to edit and format in Word at this stage (or any stage, but that's another discussion).
This is my own normal use of Markdown, and I like the idea of adding "Save HTML to new location" to the default Markdown bundle. In this usage case, the HTML is like the PDF compiled from LaTeX source; the PDF is for public consumption, but you need the LaTeX to continue to change the document.
There is a difference however, in that the LaTeX source has all the information determining how the resulting PDF should look like. On the other hand, Markdown doesn't contain any CSS information. So if we only care about the HTML, without any css specification, then this can be done of course, but I am not sure if it really is that useful.
Well, if you use MultiMarkdown, you can use a metadata field to specify a CSS file. That would be a lot like inputting a standard preamble into a LaTeX file...
Anyway, part of the point of things like MultiMarkdown and pandoc[1] is to use and extended Markdown syntax to generate a variety of output---in which case the Markdwon file is functioning as a source file.
Best, Mark
On Mon, Apr 02, 2007 at 03:13:07AM +0100, Mark Eli Kalderon wrote:
Well, if you use MultiMarkdown, you can use a metadata field to specify a CSS file. That would be a lot like inputting a standard preamble into a LaTeX file...
Anyway, part of the point of things like MultiMarkdown and pandoc[1] is to use and extended Markdown syntax to generate a variety of output---in which case the Markdwon file is functioning as a source file.
Yes. The presence or otherwise of styling information such as CSS or a LaTeX preamble in addition to the content is a red herring. Clearly there are many differences between LaTeX and Markdown, but If you anticipate changing the document in the future, but need a rendered page now for whatever reason, there's no question that the source should be retained. A "Save (e.g.) HTML to new file" script in the default Markdown bundle would make this easier when working with Markdown in TextMate.
-- Mike
On 3/31/07 5:33 PM, in article 18C21D23-EFB0-4E4C-969E-B5C4CD2E22C0@integrateddevcorp.com, "Lists In@IDC" listsin@integrateddevcorp.com wrote:
On Mar 31, 2007, at 8:17 PM, Brad Choate wrote:
If you like what you see in the preview window, you can hit Cmd +Option+U (the view source key in Safari and Mail.app) and you'll get a TextMate document with the HTML that was generated for the preview window.
I was using the TextMate preview, doesn't seem to be a way to get source out of there though that would be, obviously, very handy.
Alternatively, you can use the "Convert Document to HTML" (Ctrl +Shift+H) command from the Markdown bundle in the Markdown document.
That seems to convert to HTML in situ
Convert Document to HTML in the MultiMarkdown suite does what you want, though.
m.